# How Lucid Works

Lucid works by outputting JavaScript code based on the Actions and Events you create. Lucid puts Javascript comments around all the arguments and parameters that it is able to manipulate, and this allows Lucid to read back in the Javascript file and edit it. The comments do not affect how the code runs in any way.

Lucid also puts commented data at the top of functions/actions created in Lucid to store information about their position in the Lucid action tree. Again, these comments do not affect other programs or browsers which edit/run the JavaScript.

## What about lucidDebug?

The lucidDebug function present in all Lucid Javascript files allows Lucid to monitor the Javascript as it runs, and does not do anything when run in anything other than Lucid.

## Can I make changes outside of Lucid?

Generally, yes, but you should leave the Lucid comments in place if you want to re-open in Lucid at any time. If you want to use the Lucid Javascript, but take away the comments and Lucid specific details, you may use "Export Minimised..." from Lucid. However, keep a back up of the original file, as Lucid cannot re-import the minimised files.
If you make changes to code outside of Lucid, Lucid will attempt to keep those changes, although if you want to use a lot of custom code, you should use a Custom Code action, or have that code in another file.