You can drive Moon CLI from Code on chat.realmoon.ai, in a browser or on a phone, in two ways: moon rc starts a session in a folder on your computer, and /rc lets you drive the conversation already open in the terminal. The agent always runs on your computer; the page sends your requests and shows its answers, permission requests and changes. Code is available on plans that include Moon CLI; switch to it with the toggle at the top of the sidebar.
Start a session with moon rcLink to the Start a session with moon rc section
cd my-project
moon rc- Moon CLI connects to Moon AI and shows the address of the page, then “En attente d’une page… (Ctrl+C pour arrêter)” (waiting for a page, Ctrl+C to stop).
- Open that address while signed in to the same Moon AI account as Moon CLI. The machine also shows up in Code, in the sidebar.
- The terminal shows “Piloté depuis le web.” (driven from the web), or “Piloté depuis le web par …” (driven from the web by …). Every permission the agent asks for shows in the terminal and on the page. Answer on the page: “Allow once”, “Always allow” or “Deny” for a file change or a command; “Allow once” or “Deny” for an action of a Moon AI connector and, with Moon CLI 0.5.0, for
git pushor creating a pull request. - CtrlC stops the session.
If Moon CLI is not signed in, moon rc asks you to sign in first: see Sign in.
From an open conversation: /rcLink to the From an open conversation: /rc section
In the Moon CLI interface (started with moon), type /rc: the current conversation can then be driven from the Code page, without leaving the terminal. You need Moon CLI 0.4.0 or later (moon update).
- Moon CLI first tells you what the page will see: “La page verra toute cette conversation, fichiers joints et sorties d’outils compris, ainsi que les autres sessions de ce dossier, qu’elle pourra renommer, archiver ou supprimer. Ce contenu passe par Moon AI sans Moon Blur.” (the page will see this whole conversation, including attached files and tool output, as well as the other sessions of this folder, which it can rename, archive or delete; this content goes through Moon AI without Moon Blur).
- If Moon Blur is not turned off in this terminal, Moon CLI asks for your approval before turning remote control on: “Activer le contrôle à distance ?” (turn on remote control?). “Annuler” (Cancel) is selected by default and Esc cancels; nothing is sent until you choose “Activer” (Turn on).
- The address of the page and a QR code appear, and the page opens in your browser; on a phone, scan the QR code. Use the same Moon AI account as Moon CLI. A “Contrôle à distance actif” (remote control on) banner stays visible in the terminal as long as the page can drive the conversation.
- Messages sent from the page are marked “depuis le web” (from the web) in the terminal. A permission request shows on both sides: answer with the keyboard or on the page, and the first answer counts. When you answer with the keyboard, the request leaves the page, which keeps the line “Answered on the computer”.
/rc stop, or/rca second time, stops remote control; answers started from the page stop first. Closing Moon CLI stops it too.
During /rc, Moon CLI switches back to Ask mode, and the page stays in it: see On the page.
What the page seesLink to the What the page sees section
With moon rc as with /rc:
- The page receives the whole conversation, including the content of attached files and the output of tools and commands (with
/rc, the conversation history is replayed when the page opens), along with the sessions of this folder, archived ones included. - This content goes through the Moon AI server without Moon Blur: Moon Blur masks what goes to the model, not what the page displays. If a conversation contains data you don’t want to pass through Moon AI in clear text, don’t make it remotely controllable.
- The page does not receive the terminal screen, only the agent’s messages. Your account token stays in Moon CLI.
- The page only sees the sessions of the folder where Moon CLI is working, never those of another folder.
- With Moon CLI 0.5.0, the page also receives the steps of sub-agents (their title, often a command, a search pattern or a file name, and the files they touched, never the output of their tools) and the breakdown of the context (names and shares, never any content).
- With Moon CLI 0.5.1, the page also receives the output of background commands (their last lines), of the same kind as for other commands: whatever a program prints, sometimes an address or a secret.
On the pageLink to the On the page section
- Permission mode: with
moon rc, “Ask every time” (the default), “Accept edits” or “Autonomous”. During/rc, the page stays in “Ask every time”: the other choices are grayed out with “Change the permission mode in the terminal.”, and “Always allow” is not offered. Outside Autonomous mode, files that run on their own (git hooks,package.json, editor tasks) and anything outside the folder always ask for your permission, and so dogit pushand creating a pull request with Moon CLI 0.5.0: see Publishing. Since Moon CLI 0.6.0, Autonomous mode no longer asks for anything: see Autonomous mode. With Moon CLI 0.5.4, “Keep the chosen mode” makes the next sessions of the folder start in the last mode you chose: see Keep the chosen mode. - Folder Moon Blur: with Moon CLI 0.5.4, a pill in the message box always shows the Moon Blur level of the folder, which you can set from the page: see Folder Moon Blur.
- Modes: from the page, with
moon rcas with/rc, you can only choose the Build and Plan modes. Other modes, such as an agent you wrote, are changed in the terminal. Requested from the page, they are refused: “Changez de mode dans le terminal.” (change modes in the terminal). - Connectors: Moon AI connectors (GitHub, Notion, Gmail…) are chosen in the “+” › “Connectors” menu. With Moon CLI 0.6.0, they are all checked as long as you haven’t changed anything for this folder; Moon reads your connectors freely and asks you before every write, “Allow once” or “Deny”, whatever your setting, except in Autonomous mode. See Moon AI connectors in Moon CLI.
- Long sessions: a session opens on its last 20 turns. “Show earlier messages”, at the top of the thread, adds the earlier ones without moving what you are reading. Exporting the conversation, the changed files and the plan always cover the whole session.
- Mode colors: in the message box, “Plan” is green, “Edits accepted” blue and “Autonomous” amber; “Ask” and “Build” stay neutral.
- Typing while Moon works: Enter queues your message above the message box (“1 message waiting”, 10 at most). You can edit or remove it, and it is sent on its own when Moon is done; several queued messages go together, as one. If Moon is stopped or its answer fails, nothing is sent: the queue stays, with “Send now” and “Remove all”.
- Launching a plan: below a finished plan in Plan mode, “Launch this plan?” offers “Build, ask me first”, “Build, accept edits” and “Keep planning”. One click changes the mode and asks Moon to apply the plan. During
/rc, “edits accepted” is not offered. - Attaching files and photos: “+” › “Files or photos”, a drag and drop onto the page, or a paste: see The message box.
- Remembering a rule:
/retenirfollowed by a rule, or a single line that starts with “#”, asks Moon to add it to the project’sAGENTS.mdfile. The write goes through the usual permission request. - Recap when you come back: when you return to a session after being away for at least a minute, a line tells you what happened, for example “While you were away, 4 files changed, 6 commands, finished at 2:32 PM”.
- Comments on a diff: hover over a line of a diff and a “+” opens a comment; drag, or Shift-click another “+”, to take several lines. On a touch screen, “Comment on lines” is below the diff. Comments show below their lines, and the comments bar above the message box sends them all in one message (“Send comments”, or “Send after the answer” if Moon is working). Until they are sent, they stay in your browser.
- Getting started: in an empty session, “Explain this project”, “Find and fix a bug” and “Write tests” fill in the message box, which you can complete before sending.
- Stopping Moon: the square in the message box, or Esc, stops Moon. The button shows “Stopping…” while it stops, and the step that was running is marked “Interrupted”. A command Moon already left running in the background keeps going: stop it in the “In progress” panel (see Background commands).
- Deny and say what to do: after “Deny”, “Tell Moon what to do instead” puts the cursor in the message box.
- A pending request: if you are reading further up the thread when Moon asks for your permission, “A request is waiting for your answer” takes you back to it.
- End of an answer: below the last answer, a line gives the working time and the changed files, for example “Worked for 2 min 10 s”, with “View changed files”.
- Copying an answer: “Copy response” below each answer. Code blocks in answers are syntax highlighted.
- Diffs of changes: with Moon CLI 0.5.1, the line numbers of a change are those of the file, and “File deleted” only shows for a file that was really deleted. An emptied file, or a removed block, stays a change, with its removed lines.
- Recalling your last message: in an empty message box, the up arrow brings back your last message, so you can fix it and send it again.
- Session actions: the “…” menu next to the title offers “Rename”, “Archive”, “Export as Markdown”, “Copy conversation” and “Copy into a new session”.
- Offline: if your device loses the network, a banner says so: “You are offline. The session resumes as soon as the network is back.”
- Files and commands:
@attaches a file from the folder; Moon CLI commands (session status, Moon Blur, Moon Guard, diagnostics, undo and redo the last request, compact the conversation) are available on the page; models that offer reasoning levels show them too. With Moon CLI 0.5.0,@also targets an agent (see Hand off a task with @), and/revue,/,revue-securite /prand/stylejoin the “/” menu.
The message boxLink to the The message box section
The Code message box has the same options as the Chat one, on the web and in Moon Desktop. They don’t need any update of Moon CLI or Moon Desktop.
- Files or photos: “+” › “Attach” › “Files or photos” attaches photos and text or code files (a log, an excerpt, a spec). A photo (PNG, JPEG, WebP or GIF) goes to Moon as an image, 4 at most per message; a heavy photo is downsized before sending. A text or code file goes as attached text: 256 KB per file, 4 files per message. A
.envfile, a private key or a binary file is refused, and the page says so below the message box. If the agent doesn’t read images, the entry is called “File” and only takes text and code. - A PDF or an office file can’t be attached: “PDFs and Office files stay in the folder: mention them with @.”
- Drag and drop: drop photos or files anywhere on the page. An overlay says “Drop files here to attach them to the message”, and each file goes where it belongs, as with “+”. A folder is refused: “A folder cannot be attached. Open it as the session folder, or reference its files with @.”
- Paste: a copied image or file is attached as with “+”.
- Camera: on a phone or a tablet, “+” › “Attach” › “Camera” takes a photo and attaches it, if the agent reads images.
- Long pasted text: a text of more than 5,000 characters becomes a “Pasted text” card above the message, as in Chat. Click the card to review or edit the text; the cross removes it. To keep the text in the field, paste with Ctrl/⌘ShiftV. The “Paste long text as an attachment” setting (“Settings” › “General” › “Typing”) also applies to Code. A text too long for the message is refused: “This text is too long to paste. Attach it as a file instead.”
- Microphone: dictation follows the Chat rules. If your organization forbids it, the microphone is grayed out with “Disabled by your organization”. In the iPhone or Android app, if microphone access is denied, a sentence tells you where to allow it.
- Model: CtrlShift2 (⌘Shift2 on a Mac) opens the model picker, as in Chat. The shortcut is shown in its search field.
- Commands: “+” › “Commands”, next to “Mention a file”, opens the list of “/” commands. A command starts the message: if the field isn’t empty, the page says so: “Commands must start the message. Clear the field to type one.”
- Connectors: “+” › “Connectors” lists those of the folder, each with a checkbox, and shows on the right how many are active, for example “2 active”. See Moon AI connectors in Moon CLI.
- In an empty session, a line reminds you what the field takes:
/for commands,@for a project file, CtrlShift2 for the model, and “Drop a photo or file to attach it”. It isn’t shown on a touch screen. - The message box bar keeps only five items, on a single line, even a narrow one: “+”, the model, the agent’s mode (“Ask”, “Edits accepted” or “Autonomous”, as one pill), the microphone and the send or stop button. The model is never moved: it gets shorter if space runs out. On a computer, the tooltip of the mode pill says in one sentence what the current choice does. On a very narrow bar (a phone held upright), the mode pill moves into the “+” menu.
- The “+” menu puts everything else in submenus, with the current setting shown on the right: “Attach”, “Mention a file”, “Commands”, “Connectors”, “Thinking”, “Mode” (Build or Plan), “Style”, “Permissions” and “Moon Blur”. On a computer, a submenu opens next to its line (right arrow to open it, left arrow to close it); on a phone or in a narrow window, it takes the place of the menu, with a “Back” line at the top. A dot on the “+” button means something is active in it: connectors, Plan mode, a style, or a Moon Blur level lower than the default (in amber).
In Moon Desktop, “+” also offers “Take a screenshot”, and a file dropped onto the page is attached to the message: it never opens in the window.
Keep the chosen modeLink to the Keep the chosen mode section
With moon rc and Moon CLI 0.5.4 or later, a session can start in the mode you kept for its folder, instead of “Ask every time”:
- In the message box, open the mode pill (or “+” › “Permissions”) and check “Keep the chosen mode”: “Future sessions in this folder start in the last mode you chose.”
- The “Keep this mode for this folder?” window says what the next sessions will do, what is still asked and where the setting applies. It warns: “A malicious file, comment or web page can trick Moon into running a harmful command without asking you. Only keep this mode for folders you trust.” “Cancel” is the main button; “Keep this mode” only responds a moment after the window opens.
- From then on, each mode you choose in a session of this folder becomes the kept mode.
Each time a session opens, a line in the thread reminds you of the kept mode, for example “Autonomous mode, kept for this folder. Moon acts without asking in this session.” The moon rc terminal also notes each kept mode.
- To stop, choose “Ask every time”, or uncheck “Keep the chosen mode”.
- Outside Autonomous mode, Moon always asks for connectors, for anything outside the folder and for files that run on their own (Git hooks, project scripts). In every mode, Autonomous included since Moon CLI 0.6.1, it asks before publishing or deploying (
git push, pull request,npm publish,vercel…). In Autonomous mode, nothing else is asked: see Autonomous mode. Moon Guard, if turned on, still blocks dangerous commands. - A mode kept from the web only applies to Code on the web: Moon Desktop keeps its own choice (see Keep the chosen mode in Moon Desktop), and the terminal ignores it.
- During
/rc, nothing is kept: “During /rc, the permission mode is changed in the terminal.” - If your organization forbids Autonomous mode, “Autonomous” is no longer offered, and the menu says so: “Moon CLI’s Autonomous mode is turned off by your organization.” A kept Autonomous mode is not applied: the session starts in Ask, and the thread says so. See Moon CLI Autonomous mode.
Folder Moon BlurLink to the Folder Moon Blur section
With moon rc and Moon CLI 0.5.4 or later, the “Moon Blur” line of the “+” menu shows the level of the folder, for example “Secrets”. When the level is lower than the default, or off, the dot on the “+” button turns amber. In “+” › “Moon Blur”, “Reset” restores the default level in one click.
Clicking the pill opens the Moon Blur window: the current level and where it comes from (“Set for Code on the web”, “Default level”, “Raised for this session”…), the values masked in the session, and the levels:
| Level | What it does |
|---|---|
| “Strict” | Masks secrets and personal data, and refuses to send a new message that contains a secret. |
| “Secrets and personal data” | Masks secrets and personal data (email addresses, phone numbers, social security numbers…). |
| “Secrets” | Masks passwords, keys, tokens, IBANs and card numbers. The default level. |
| “Off” | Masks nothing: everything goes to the model as it is. |
“Report only”, which masks nothing and only counts what would have been masked, only appears if it is already the current level.
- Raising the level applies right away.
- Lowering the level opens the “Lower Moon Blur for this folder?” window, which says what will go to the model as it is. At the “Off” level: “Nothing will be masked anymore. Your messages, the contents of files read and command output will be sent to the model as is, including any passwords, API keys, tokens, IBANs, card numbers, email addresses and phone numbers they contain. They go through Moon AI, then the model provider.” “Keep protection” is the main button; “Lower Moon Blur” confirms.
- The level applies right away to the current session. The
moon rcterminal notes each lowering. - Chosen from the web, the level “applies to this folder in Code on the web only (moon rc), until you set it back”: Moon Desktop and the terminal keep their own level. In the terminal,
moon blurshows it separately, andmoonremoves it too (see Moon Blur in Moon CLI).blur reset --here - In Moon Desktop, the same pill sets the level of the folder for both the app and the terminal, and a lowering is confirmed in a window of the app: see Folder Moon Blur in Moon Desktop.
- During
/rc, the level is lowered in the terminal: “During /rc, Moon Blur is lowered in the terminal (/blur).”
Moon Blur recognizes known formats of secrets and personal data, and may miss others: see What Moon Blur does not cover. It masks what goes to the model, not what the page displays (see What the page sees).
Carry out a taskLink to the Carry out a task section
With Moon CLI 0.6.0 or later on the computer, Code carries out a task from start to finish and lets you follow it: Moon asks its questions along the way, its deletions go through the trash and stay on record, and the page shows how far along it is. With an older version, none of this appears: run moon update, then start moon rc or /rc again.
Moon’s questionsLink to the Moon’s questions section
When a decision is yours to make, Moon asks its question in a card in the thread, in place of its step:
- the suggested answers, each with its explanation; the one Moon recommends is marked “Recommended” and selected in advance;
- “Something else…” opens a field to write your own answer; “Multiple answers allowed” when the question accepts more than one;
- “Reply” sends your answer, “Skip” lets Moon go on without it. Several questions follow one another (“1 of 3”, “Next”). With the keyboard: the arrow keys, then Enter.
Answering doesn’t authorize anything: every action is still asked. An answered question stays in the thread as one line (“Answered · …” or “Question skipped”). While it waits, the session shows “Waiting for your answer”, and Code alerts you as for a permission request, with “Moon has a question” (see Get notified). During /rc, the question is also asked in the terminal: the first answer counts.
DeletionsLink to the Deletions section
In the Ask and Accept edits modes, a deletion that Moon CLI recognizes is always asked, in a red card:
- its title, for example “Delete 3 files?”, and the list of files (“and 12 others” beyond that);
- what will happen: “The files will be moved to the trash.” when Moon uses its deletion tool; “This command can permanently delete or overwrite files. Nothing goes to the trash.” for a command (
rm,git clean,git, an overwritten file…); “The list could not be read. The command may delete other files.” when Moon CLI can’t tell which files will go;reset --hard - “Move to trash” (or “Delete”) and “Deny”, selected by default.
Moon prefers its deletion tool, which moves files to the system trash instead of erasing them. After a deletion, the “Files” card of the rail keeps a “Deleted” part: one line per deletion, with its files, “to the trash” or “permanently”, “without asking” when it happened in Autonomous mode, and “Restore” when the files are in the trash and Moon CLI can put them back (Windows and Linux). Restoring only puts a file back in a free spot in the project, never overwriting anything, and the page tells you what could not come back. The summary at the end of the turn counts the deleted files.
The status line and the railLink to the The status line and the rail section
- The status line, above the message box, says in one sentence where the session stands: “Moon is working: … · Step 2 of 4”, “Waiting for your answer”, “Waiting for your permission”, “Waiting for the network”, “Finished · 3 files changed”. A click opens the steps of the turn, or the card that is waiting.
- The rail, to the right of the thread, gathers collapsible cards: “Progress” (the plan and the sub-agents), “Files” (produced, changed, to review and deleted), the session context (folder, mode, Moon Blur, connectors), “Running in the background” (the commands and sub-agents that are running) and “Instructions”. “Hide rail” folds it; its width and its folded cards are kept. On a narrow screen, “Show the task” opens it over the thread.
To reviewLink to the To review section
The “Files” card of the rail counts the files changed by Moon that you haven’t reviewed yet (“3 to review”). On the web, a file is reviewed once you have opened its diff on the page, or with “Mark as reviewed” and “Mark all as reviewed”; this tracking stays in your browser and writes nothing on the computer. In Moon Desktop, the list comes from the app, where you keep or undo each hunk: see Keep or undo hunk by hunk.
A folder without a git repositoryLink to the A folder without a git repository section
Code isn’t only for code: a folder of documents, invoices or photos opens in the “task” layout. The home screen offers “Review this folder”, “Summarize the documents” or “Rename and sort”, and the message box asks “What should Moon do in …?”. Since the folder has no git history, a line says so: “This folder has no Git repository, so there is no history to go back to. Ask mode is recommended.”, with “Switch to Ask”. Nothing changes without you.
In Moon Desktop, a PDF, a Word document, an Excel spreadsheet or an image from the folder opens in a preview: see Documents.
InstructionsLink to the Instructions section
The “Instructions” card of the rail tells you which instructions Moon follows: the instructions file of the folder (for example “AGENTS.md of the folder · 2 instructions”) and your personal Moon CLI instructions (“Your instructions · 1 instruction”). “Not read until the folder is trusted” shows when Moon CLI doesn’t read the configuration of the folder. /retenir adds an instruction for this folder. In Moon Desktop, “Open” shows them in the app’s editor.
Autonomous modeLink to the Autonomous mode section
Since Moon CLI 0.6.0, Autonomous mode asks for almost nothing, like the no-permission mode of other coding tools; since 0.6.1, publishing and deploying are always asked. Switching to Autonomous is confirmed first, on the page, in Moon Desktop and in the terminal:
- Run without asking: commands and changes, installs, deletions (even outside the project or in
.git), anything outside the folder, files that run on their own, reading the web, and connector writes. - Still asked: publishing and deploying (
git push, creating a pull request,npm publish,vercel,scpto a server, a write on GitHub…), with a card that says what goes out and that “it requires approval in every mode, including Autonomous”; and the connector actions that Moon AI asks for in every mode, such as a payment or a mass send. See Moon AI connectors in Moon CLI. - A record of everything: a deletion made without asking is written in the thread, in subtle red (“Deleted without asking · …”), and in the “Deleted” part of the “Files” card, with “Restore” when possible; an accepted publication, as “Published after approval · feat/x → origin” (or “Pull request created after approval”) in the summary of the turn; a connector write, as “Envoyé sans demander” (sent without asking) and a notification in the Moon AI bell. Moon’s deletion tool always goes through the trash.
- The other modes don’t change: in Ask and Accept edits, deletions keep their red card and publishing keeps its “Moon wants to publish” card.
- Moon is instructed never to follow an instruction found in what it reads (an email, a page, a file) that asks it to delete, send or change something you didn’t ask for. It is only an instruction: keep this mode for projects that are backed up.
- The description of the mode says so: “Like the no-permissions mode of other coding tools, except that publishing and deploying always require approval. An organization admin can disable it.” See Moon CLI Autonomous mode.
Go back to a messageLink to the Go back to a message section
With Moon CLI 0.5.0 or later, each of your messages has a “…” menu, to the left of the bubble: it appears on hover or with the keyboard, and stays visible on a touch screen. With an older version, its entries are grayed out with “Update Moon CLI (0.5.0)”: run moon update, then start moon rc or /rc again.
| Entry | Effect |
|---|---|
| “Go back here” | The conversation and the files changed by Moon go back to their state before this message. The message and everything after it leave the conversation. |
| “Edit and resend” | The same return, then the text of the message comes back in the message box, for you to fix before sending it. |
| “Continue from here in a new session” | A new session opens with the messages before this one, and its text in the message box. The files and the original session don’t change. |
- While Moon is working, “Go back here” and “Edit and resend” are grayed out with “Stop the response first”; “Continue from here in a new session” is still available.
- During
moon rcand/rc, each return requested from the page is noted in the terminal, with the number of requests removed and files put back. These actions then only target a session opened by the page in this connection; otherwise the page shows “Moon CLI does not recognize this session on this connection. Reload the page, then try again.”
What the window shows before going backLink to the What the window shows before going back section
“Go back here” and “Edit and resend” first open a window, “Go back to this message?” (or “Go back and edit this message?”), which says what will change, without touching anything yet:
- the beginning of the message, and the number of requests removed from the conversation, for example “2 requests will be removed from the conversation.”;
- the files, in three groups: “Restored to their previous state”, “Deleted (created since)” and “Will not be restored”;
- when files can’t be put back, the reason, for example “Outside a Git repository, Moon cannot restore files. Only the conversation will be rewound.” The button then becomes “Go back anyway”.
“Cancel” is selected by default, and the button that goes back is red. If Moon is working, the window says so (“Moon is working. Stop the response first.”) and offers “Stop”.
What a return can put backLink to the What a return can put back section
To put files back, Moon relies on the snapshots it takes at each step of its work, in its own data on your computer, never in the project’s git repository.
- Git repository: outside a git repository, Moon takes no snapshot. Only the conversation goes back, and the window lists the files written by Moon under “Will not be restored”.
- What is put back: the files of the folder that Moon changed since this message, including through a command it ran, when a snapshot covers them.
- What is deleted: only the files created since then by one of Moon’s tools, sub-agents included. A file created by a command or by hand stays in place.
- Never touched: a file outside the project folder, a file in
.git, and a file reached through a symbolic link or a junction. - Not covered: files ignored by git, and files over 2 MB never tracked by git.
- 7 days: Moon erases its snapshots after 7 days. Going back to an old message may only put back some of the files, or none.
- Missed snapshot: if Moon could not take the snapshot of a step, the window says so, and the files of that step stay as they are.
- Your own changes: in a file that Moon also changed since this message, they are lost when you go back. Your other files don’t move.
- On Windows, a file open in another program may not be put back without Moon reporting it: check it after going back.
All the files Moon knows it can’t put back are listed under “Will not be restored”, before you confirm.
RedoLink to the Redo section
After going back, the “Conversation rewound to this message” notification offers “Redo” for 30 seconds: the conversation and the files return to their state before you went back. After that, /redo restores one request at a time.
- The first message sent after going back makes it final: “It is too late to redo. A message has been sent since.”
- “Redo” doesn’t rewrite a file you changed after going back, and doesn’t delete any file.
Undo a fileLink to the Undo a file section
In “Changed files”, “Undo this file” puts a single file back as it was before the session, without touching the conversation: it is an icon on each line (on hover, with the keyboard, always visible on a touch screen) and a button in the header of the open file. It needs Moon CLI 0.5.0 or later, and stays grayed out while Moon is working.
- A window, “Undo the changes to this file?”, says what will happen: “Restore src/app.ts to how it was before the session? Anything written to it since will be lost, and this cannot be undone.”, or, for a file Moon created during the session, “Delete src/neuf.ts? It was created during the session.”
- Confirm with “Restore file” (or “Delete file”).
- A notification confirms it, and the line of the file shows “File restored” (or “File deleted”) until Moon changes it again.
- The file goes back to its state before the first change the session made to it. Whatever you had changed in it by hand before Moon touched it stays.
- This cannot be undone, neither with “Redo” nor with
/redo. - Moon is told with your next message, so that it doesn’t redo its changes in this file unless you ask.
- Moon only puts back a file it changed in this session, in the project folder, and that a snapshot covers. Otherwise the window says “Moon cannot restore this file.”
- A file in
.gitor a secret file (.env, a key) is never put back from the page: “This file must be restored from the terminal.” - During
moon rcand/rc, each file undone from the page is noted in the terminal.
The Context panelLink to the The Context panel section
The context gauge, in the message box, shows how much of the model’s window the session takes up. With Moon CLI 0.5.0 or later, clicking it opens the “Context” panel, on the right (in a window on a phone, or when space runs short):
- at the top, “Context used”, the latest measurement, with a marker at the automatic summary threshold, for example “Moon summarizes automatically at about 77%.”;
- below, “What fills the context”, part by part, as a percentage of the window, labeled “estimate”: “System instructions”, “Project instructions”, “Tools”, “Connectors and MCP servers”, “Skills”, “Context summary”, “Messages”, “Tool results” and “Files read”;
- clicking a part expands its lines: the instruction files, each MCP server (“Moon AI connectors” for the connectors of your account), the files read;
- “Summarize now” runs
/compact, once Moon is done.
The panel only shows names and shares: never the content of a message or a file, nor a number of tokens. The shares are estimates, so their total may differ from the measurement at the top. The panel is refreshed at the end of each answer.
A long sessionLink to the A long session section
When you reopen a session, or more than 5 minutes have passed since Moon’s last answer, and the context takes up half of the window or more, a line shows above the message box: “This session is long. Your next message will read all of its context again, which counts more against your limit.”, with the share of the context. “Summarize first” runs /compact; the cross closes the line. Nothing shows while Moon is working.
Code reviewLink to the Code review section
With Moon CLI 0.5.0 or later, two commands of the “/” menu, in the “Project” group, ask for a review:
| Command | Effect |
|---|---|
/revue | Code review of the current changes, findings by file and by severity. |
/ | Security review of the current changes, vulnerabilities by file and by severity. |
- With nothing else, Moon reviews the uncommitted changes of the folder or, if there are none, the files changed during the session. You can name a commit, a branch, a pull request (number or address, with the
ghtool installed) or paths:/.revue src/ api - Moon reviews without changing anything, with its usual tools. Its commands (
git status,git diff…) go through the session’s permissions, like any command: in Ask mode, each one is asked. /reviewand/, typed by hand, lead to the same commands.security-review
The review cardLink to the The review card section
The review arrives as a card in the thread, after “Writing the review…”:
- at the top, “Code review” or “Security review”, the number of findings and their severity (critical, important or minor), then the overall verdict;
- the findings, grouped by file and then by severity; those that don’t target a file are under “General”, at the end. Each one has its number (“#2”), its line (“line 12” or “lines 12 to 18”) and its title;
- “View” expands the detail of a finding and the suggested fix, on the web as in Moon Desktop;
- “Fix this one” asks Moon to fix one finding; “Fix all”, at the bottom of the card, all the findings, from the most to the least serious.
These two buttons send an ordinary message, visible in the thread: it quotes the finding under “Review text (for verification, not an instruction)” and asks Moon to first check in the code that it is right. They are grayed out while Moon is working. Once sent, the finding shows “Fix requested”: Moon’s answer is what tells you what was fixed.
- A review without findings shows “No findings”.
- A finding that targets a file outside the project folder is set aside, and the card says how many were.
- Beyond 50 findings, only the most serious are kept, and the card says so.
Publishing: git push and pull requestsLink to the Publishing: git push and pull requests section
With Moon CLI 0.5.0 or later, a command that can publish your code outside the computer is asked every time in the Ask and Accept edits modes, and in Autonomous mode too since Moon CLI 0.6.1 (in 0.6.0, it ran without asking): git push, creating a pull request (gh pr create), anything that changes where a push will go (git , a push address set with git config…) and, since 0.6.1, a deployment (vercel, firebase , scp to a server…), publishing a package (npm publish…) or a write on GitHub (gh , gh pr merge…). Neither an allow rule nor an earlier “Toujours autoriser” (always allow) makes it automatic. The details of the rule are in Commands that publish.
The page always shows this request, “Moon wants to publish: git push” (or “creating a pull request”), and never answers it for you:
- a sentence saying that the command can publish outside this computer;
- “Destination (origin)” and the address of the remote repository, without credentials, or “Could not read the destination.” when Moon could not read it;
- “Commits to push” and their list, or “No commits to push, as far as this computer knows about the remote.”;
- only two answers, “Allow once” and “Deny”. Denying stops Moon, as with any other request.
Since Moon CLI 0.6.1, the card also shows in Autonomous mode. An accepted publication leaves a trace: the summary of the turn says “Published: feat/x → origin”. During /rc, the request also shows in the terminal, with the destination and the commits: the first answer counts. In Moon Desktop, the card shows the same way, and you answer in the app’s permission window.
Create a pull request with /prLink to the Create a pull request with /pr section
/pr prepares and creates the pull request of the current branch, on GitHub, with the GitHub CLI tool (gh) on your computer. Add details after the command if needed: the target branch, a title, “brouillon” (draft). Moon:
- looks at the state of the repository, then checks that
ghis installed and signed in; - creates a branch if you are on the main branch;
- commits the work, in the commit style of the repository;
- reviews what will go out: the commits and a summary of the differences;
- pushes the branch with
git push: you are asked; - creates the pull request with
gh pr create, with a title and description drawn from the commits and the differences: you are asked. If a pull request already exists for the branch, Moon gives its address; - ends with the address of the pull request.
- Moon stops without sending anything, and says why: outside a git repository, without a remote repository, with a remote repository somewhere other than GitHub, without
ghor if it isn’t signed in (then runghin a terminal), or if there is nothing to propose.auth login - The instructions of
/prrule out--forceand--no-verify, a push to the main branch and merging the pull request. Each push is asked anyway. - If you deny the push or the pull request, Moon stops and says where it stands.
- In Ask mode, each command of
/pris asked; in Autonomous mode, only the push and the creation of the pull request are asked (Moon CLI 0.6.1; in 0.6.0, nothing was asked). Run/prin Build mode: in Plan mode, Moon changes nothing.
Response stylesLink to the Response styles section
With Moon CLI 0.5.0 or later, the “Style” pill, in the options of the message box, chooses how Moon answers in the session:
| Style | Effect |
|---|---|
| “Default” | Moon does the work and keeps to the essentials. |
| “Explanatory” | Moon explains its choices and what it learns about the code as it works, in short “À retenir” (key takeaway) boxes. |
| “Learning” | When the task lends itself to it, Moon lets you write small parts, marked “À FAIRE (vous)” (to do, you) in the file, and guides you: it stops, says what to write, then reviews what you wrote. |
- The pill shows the name of the style when it isn’t “Default”.
/stylein the “/” menu opens the same choice;/sets it directly.style apprentissage - The style applies from the next request on, and is kept with the session: it comes back when you reopen it. A new session opened on the page starts in “Default”.
- A style changes neither the tools, nor the permissions, nor Moon Blur, nor Moon Guard.
- In the terminal,
/stylemakes the same choice, and the style shows below the message box when it isn’t “Par défaut” (default).
Behind the scenes of a sessionLink to the Behind the scenes of a session section
With Moon CLI 0.5.0 or later, the page also shows what Moon does outside the thread: when it summarizes the context, when it hands part of the work to a sub-agent, and the whole session on a map.
Context summarizedLink to the Context summarized section
When a session gets close to the context limit, Moon summarizes the beginning of the conversation to keep going; /compact and “Summarize now” ask for it too. A card shows it in the thread:
- during the summary, “Summarizing the context…”, with “Automatic” or “At your request”;
- at the end, “Context summarized”, the share of the context before and after (for example “77 % → 2 %”) and “Show summary”, which expands the text of the summary;
- if it fails, a line (“Summary stopped”, “Conversation too long to summarize” or “The context summary did not complete”): the context hasn’t changed.
Right after a summary, the tooltip of the context gauge says for example “Context used, about 3% (estimate)”, until Moon’s next answer.
Sub-agentsLink to the Sub-agents section
Moon can hand part of the work to a sub-agent, for example explore to search the project. Each sub-agent has its own card in the thread:
- its name, its task, its state (“In progress”, “Done”, “Failed”, “Stopped”, “Sub-agent stopped by you”, or “Waiting for your answer”) and its duration;
- its steps, expanded while it works, then folded (“12 steps”);
- a sub-agent started by another one shows in that one’s card;
- at the end, its answer and the files it wrote, also counted in “Changed files”.
When a sub-agent asks for a permission, the request shows “Requested by sub-agent explore”: you answer it like the others, with the same choices. Stopping Moon also stops its sub-agents.
Stop a sub-agentLink to the Stop a sub-agent section
With Moon CLI 0.5.1 or later, “Stop this sub-agent”, below the header of the card of a working sub-agent and on its node of the session map, stops only this sub-agent: the rest of the answer goes on.
- The button shows “Stop requested…”, then the card says “Sub-agent stopped by you”.
- The sub-agents it had started stop with it. A permission it was still asking for is removed from the page.
- Moon is told that you stopped it, with the instruction not to start it again unless you ask.
- The commands this sub-agent left running in the background keep going: they stay in the “In progress” panel (see Background commands).
- “This sub-agent had already finished.”: it was done before your click, and nothing was done.
- During
moon rcand/rc, the stop is noted in the terminal: “Demande du web : arrêter un sous-agent.” (request from the web: stop a sub-agent), then the name of the sub-agent.
With an older version of Moon CLI, the button doesn’t appear. To stop the whole answer, sub-agents included, use the square in the message box.
Hand off a task with @Link to the Hand off a task with @ section
In the message box, “@” offers agents before files: explore (“Quickly explores the project: reads and searches, but changes nothing.”) and general (“Handles multi-step tasks on its own and can change files.”). Pick one to hand it your message, for example “@explore where are the tests of the relay?”.
- Four agents at most per message. A message that targets an agent goes alone, never grouped with queued messages.
- An agent the mode doesn’t allow is grayed out, “Not available in this mode”: in Plan mode,
general, which can change files. - Targeting an agent gives it no extra rights: its requests go through the session’s permissions.
- From the web, you can only target Moon’s agents; your own agents are requested in the terminal, or in Moon Desktop.
- If the agent is refused, nothing goes out: the message comes back in the message box, and a line says why, for example “@general is not available in this mode. Nothing was sent.”
The session mapLink to the The session map section
“Session map”, in the top bar next to “Changed files”, or AltShiftM (OptionShiftM on a Mac), opens a panel on the right (a window on a phone). It shows the session as a tree: your requests, Moon’s steps for each one, its sub-agents and their steps, the changed files and the context summaries, each with its state and time.
- With the keyboard, the arrow keys move through the tree: Right expands, Left folds, Enter takes you to the step in the thread.
- Clicking one of Moon’s steps scrolls the thread to it.
- “Enlarge” opens the map full size, as a mind map.
- A very long session doesn’t fit in full: the map says so (“… and more steps”).
- A session that is still empty shows “Nothing to show yet”.
Background commandsLink to the Background commands section
With Moon CLI 0.5.1 or later, Moon leaves running in the background a command that doesn’t stop on its own, such as a development server (npm run dev) or a test watcher. It takes back control after a few seconds, with the first lines of the command, and you can try your site while it keeps running. Before, such a command was cut off after two minutes, or started without any tracking.
- The request: a background command is asked like any command, according to the permission mode of the session, and the card says so in two lines: “This command keeps running in the background after this step.” and “Anything it opens, such as a browser, may close with it.” Moon Guard and the publishing rule apply the same way: nothing more is accepted.
- In the thread: the step that started it shows the “In the background” pill, with “See in the In progress panel”.
- The “In progress” button, in the top bar, or AltShiftE (OptionShiftE on a Mac), opens the “Background commands” panel on the right (a window on a phone). A dot on the button says how many commands are running.
The In progress panelLink to the The In progress panel section
The panel shows the commands of the session, those of its sub-agents included, in two groups: “In progress”, then “Finished commands” (the last 10). “Refresh” reloads the list; “Clear” empties “Finished commands” on the page only. For each command:
- the command, and its folder when it isn’t the session’s folder;
- its state: “Running for 3 min”, “Finished (code 0)”, “Failed (code 1)”, “Stopped by you” (from the page, Moon Desktop or
/fondin the terminal), “Stopped along with the response”, “Stopped along with its session”, “Stopped when Moon CLI closed”, or “Command stopped” when Moon stopped it itself; “Started by sub-agent explore” when a sub-agent started it; - its last lines, which follow the end of the output as long as you haven’t scrolled up, with “The beginning of the output is not shown.” when it is cut; for a running command, “Show full output” shows more (up to 200 lines); “Copy output” copies it;
- “View step”, for a command started by Moon itself, scrolls the thread to the step that started it;
- in Moon Desktop, “Open preview of http://localhost:5173/” when the output gives the address of a local server.
The output shows as text: an address in it is never a link. Without any background command, the panel shows “No background commands.”
Stop a commandLink to the Stop a command section
“Stop” stops the command right away, without confirmation: stopping a command doesn’t change any file. The button shows “Stopping…”, then the state becomes “Stopped by you”. The command stops with everything it started; anything it opened, such as a browser, may close with it. Moon’s answer goes on, and Moon isn’t told, unless it reads the output of the command again.
A background command also stops:
- on its own, when it is done (“Command finished” or “Failed”);
- when you stop the answer in the first seconds after it starts, before Moon has taken back control (“Stopped along with the response”);
- when its session is deleted (“Stopped along with its session”);
- when Moon CLI stops (“Stopped when Moon CLI closed”):
moon rcstopped, Moon CLI quit in the terminal, or Moon Desktop quit.
It stops neither at the end of the step, nor at the end of the answer, nor when you stop Moon afterwards. Moon can also read its output or stop it itself, for example to start it again with other options. In the Moon CLI interface (moon), /fond lists these commands and stops them too: see Background commands.
Moon CLI runs at most 8 background commands at a time per session, and 16 for the same Moon CLI. Beyond that, Moon has to stop one before starting another.
LimitsLink to the Limits section
- During
moon rcand/rc, each stop requested from the page is noted in the terminal (“Demande du web : arrêter une commande de fond.” (request from the web: stop a background command), then the result). These stops only target a session opened by the page in this connection; otherwise, the page shows “Moon CLI does not recognize this session on this connection. Reload the page, then try again.” - “Moon CLI is no longer tracking this command.”: Moon CLI restarted since and no longer knows this command, which stopped with it (unless it was force-killed on macOS or Linux, see below). The line moves to “Finished commands”.
- “Moon CLI could not stop this command.”: try again, “Stop” is offered again.
- On Windows, these commands stop even if Moon CLI is force-closed. On macOS and Linux, a force-killed Moon CLI (
kill -9) leaves them running. - A program that really detaches from the command (a system service, a scheduled task) is no longer followed: stop it as usual.
- Before going back to a message, stop a background command that writes in the folder (a watcher, a development database): what it writes there enters Moon’s snapshots, and, on Windows, a file it keeps open may not be put back.
- The output of these commands shows on the page like that of other commands: see What the page sees.
- With an older version of Moon CLI, neither the “In progress” button nor the stops appear: run
moon update, then startmoon rcor/rcagain.
Get notifiedLink to the Get notified section
When Moon is waiting for your permission, has a question or is done, Code lets you know, even if you are somewhere else.
- Elsewhere in Moon AI: a “Moon is waiting for your approval” (or “Moon is done”) line appears, with “Open Code”, which takes you back to the session.
- Tab in the background: the title of the tab becomes “(1) Moon is waiting · Code” or “Moon is done · Code”, and a browser notification goes out if you allowed it.
- No page open on the machine: the server sends the notification through the channels of your account (browser, iPhone, Android): “Moon is waiting for your approval” or “Moon has a question” (“Open Code to answer.”), or “Moon is done” (“Open Code to see the result.”). A click opens the session.
- Notifications give neither the command, nor the file, nor the name of the machine. Each request is announced only once, nothing goes out for an answer you stopped, and nothing during your quiet hours.
- To turn them off: “Settings” › “Notifications” › “Code, when Moon is waiting or done”.
The sidebarLink to the The sidebar section
The Code sidebar lists your machines (on the web) or your folders (in Moon Desktop), and their sessions.
- Search: “Search sessions” searches titles, folders, machines and branches. Alt+Shift+S jumps there from anywhere on the page.
- Filters: the button to the right of the search offers “All sessions”, “Needs your answer”, “In progress” and “Archived”, each with its count, and “Group by date”.
- State of each session: a mark says whether Moon is working, whether it is waiting for your answer, whether the session stopped on an error, or whether it is finished and you haven’t seen it yet. When the page knows them, the changed lines also show, for example “+52 −18”.
- Groups: sessions are sorted by machine or by folder, which you can fold, then by date: Today, Yesterday, Previous 7 days, Older.
- Pin: “Pin”, in the “…” menu or with a right-click, keeps a session at the top of its group, under “Pinned sessions”. Pins are kept in your browser: they don’t follow you from one device to another.
- Keyboard: the arrow keys move from one session to another, F2 renames, and a right-click opens the same menu as “…”.
- Moon CLI and help: at the bottom, this menu opens usage and limits, Moon Blur, Moon Guard, the workspace of the session, the Moon CLI check, the commands and shortcuts, and the documentation.
Several machinesLink to the Several machines section
Switching from one machine to another in the sidebar doesn’t cut anything: the page keeps the link with each machine where Moon is working, up to 4 at a time, and lets you know when Moon is done, is waiting for your permission or has a question on a machine you aren’t looking at. Beyond 4, nothing is closed: wait until one of the jobs ends, or stop one. In Moon Desktop, the same rule applies to your folders: see Several folders at the same time.
Manage sessionsLink to the Manage sessions section
In the Code sidebar, on the web as in Moon Desktop, each session of the folder has a “…” menu: “Rename”, “Archive” (or “Restore”), “Select several” and “Delete”. These actions need Moon CLI 0.4.0 or later on the computer; with an older version, they are grayed out with “Update Moon CLI (0.4.0)”. Run moon update, then start moon rc or /rc again.
- Rename: the name is edited in place, 120 characters at most. Enter keeps it, Esc cancels.
- Archive: the session leaves the list; you find it again with the “Archived” filter of the sidebar. “Restore” puts it back in the list. Archiving is saved on the computer: it also applies in the terminal and in Moon Desktop.
- Select several: each line gets a checkbox, and a bar offers “Select all”, “Archive” (or “Restore”), “Delete” and “Cancel selection”. Esc leaves the selection.
- Delete: a window always asks for confirmation, with the name of the session or the number of selected sessions: “The conversation and its history will be deleted from this computer. The files changed by Moon stay as they are.” Confirm with “Delete session” (or “Delete sessions”), or choose “Cancel”. A deleted session can’t be recovered.
- While Moon is working: a session where Moon is working can’t be deleted. The window says so (“Moon is working in this session. Stop it first, then delete it.”) and offers “Stop”. If Moon CLI finds Moon at work at the moment of deletion, it refuses, and the page shows “Stop Moon first.”
Only the sessions of the folder where Moon CLI is working are affected, and Moon CLI notes each request. If you archive or delete the open session, Code closes it and opens a new session.
If the page doesn’t connectLink to the If the page doesn’t connect section
“En attente d’une page…” doesn’t changeLink to the “En attente d’une page…” doesn’t change section
The terminal keeps showing “En attente d’une page…” (waiting for a page):
- Make sure you open the address shown by the terminal, or the machine in Code, with the same account as Moon CLI (
moon whoamishows it). With another account, the page is refused without revealing that the session exists. - “Page fermée : en attente d’une page…” (page closed, waiting for a page): the page was closed or reloaded; open it again.
- On the page, “Machine disconnected”: the terminal lost the connection; it comes back on its own as soon as the network does.
“Connexion perdue … nouvelle tentative dans N s”Link to the “Connexion perdue … nouvelle tentative dans N s” section
The terminal shows “Connexion perdue … nouvelle tentative dans N s” (connection lost, retrying in N s). Moon CLI retries on its own after 1, 2, 4, 8, 15 and then 30 seconds, and keeps the agent’s session during the outage. If the message keeps coming back, your network probably blocks the persistent connection (WebSocket) to wss://:
- behind a corporate proxy, set
HTTPS_PROXY(see Network and proxy) and ask your IT department to allow WebSocket connections tochat.realmoon.ai; - otherwise, use Moon CLI in the terminal (
moon), without the page.
The workspace requires Moon BlurLink to the The workspace requires Moon Blur section
In a workspace where Moon Blur is required, remote control isn’t offered: moon rc refuses to start, and so does /rc. The content of the session (command output, files read, changes) would go through the Moon AI server without being masked to show on the page. If the workspace starts requiring Moon Blur during /rc, remote control stops. Use Moon CLI in the terminal (moon).
If Moon AI doesn’t say right away whether your workspace requires Moon Blur, Moon CLI retries twice (“Moon AI n’a pas encore dit si votre workspace impose Moon Blur : nouvelle tentative…”, Moon AI hasn’t said yet whether your workspace requires Moon Blur, retrying), then stops: “Le contrôle à distance ne démarre pas : Moon AI n’a pas dit si votre workspace impose Moon Blur. Réessayez dans un instant (« moon rc »), ou lancez « moon doctor ».” (remote control doesn’t start because Moon AI hasn’t said whether your workspace requires Moon Blur; try again in a moment, or run moon doctor). Run moon rc again a little later; if it keeps happening, moon doctor checks the connection to Moon AI.
/rc doesn’t startLink to the /rc doesn’t start section
| Message | What to do |
|---|---|
| “Le contrôle à distance n’est disponible que dans Moon CLI lancé par « moon » (0.4.0 ou plus récent).” (remote control is only available in Moon CLI started with moon, 0.4.0 or later) | Open Moon CLI with the moon command, on the computer where the folder is, after moon update if needed. |
| “Le contrôle à distance demande le lanceur Moon CLI 0.4.0 ou plus récent (moon update).” (remote control needs the Moon CLI launcher 0.4.0 or later) | Run moon update, then open Moon CLI again. |
| “Contrôle à distance non activé.” (remote control not turned on) | You chose “Annuler” (Cancel) or pressed Esc: nothing was sent. Type /rc again to turn it on. |
| “Le contrôle à distance n’est pas actif.” (remote control isn’t on) | /rc stop has nothing to stop. |
The other refusals (workspace, plan, required Moon Blur) are the same as with moon rc: see Refusal codes and Troubleshooting.
Refusal codesLink to the Refusal codes section
| Code | What it means | Terminal message | What to do |
|---|---|---|---|
| 4401 | Moon CLI session missing, expired or revoked. | “Moon AI refuse cette session (expirée ou révoquée). Lancez : moon login” (Moon AI refuses this session, expired or revoked; run moon login) | moon login, then run moon rc again. |
| 4403 | Refused: Code not available to your account, a plan without Moon CLI on the workspace of the session, or another person’s page. | “Moon AI refuse le contrôle à distance : …” (Moon AI refuses remote control: …) | Check the workspace (moon ) and your plan. moon rc doesn’t retry. |
| 4429 | Too many sessions, connections or messages: 5 remote control sessions at a time at most per person. | “Connexion perdue (…) : nouvelle tentative dans 30 s.” (connection lost, retrying in 30 s) | Stop another moon rc session (CtrlC, or “Stop remote control” in Code); Moon CLI retries after 30 seconds. |
| 4409 | The session was taken over somewhere else. | “Cette session de contrôle à distance a été reprise ailleurs.” (this remote control session was taken over somewhere else) | Run moon rc again if needed. |
| 4410 | The session was stopped from the page. | “Contrôle à distance arrêté depuis le web.” (remote control stopped from the web) | Nothing: run moon rc again for a new session. |
A network outage or a server restart doesn’t stop the session: Moon CLI reconnects and the page finds it again.