Code tab
The Code tab is a coding agent that works in one project folder: it reads and edits files and runs commands there, never outside it. It can move files it made in the session, or trash them, unless you've changed them. For Windows (a Windows folder or WSL), see the code-windows page.
Start a session
Click New session (or + by the tabs) and pick the project folder; Work in a new worktree gives it its own branch (see the code-sessions page). Open in Code in a Shell tab's assistant starts one in its folder.
Type what you want and press Enter. After the first reply the model names the session unless you did. Sessions save as they go.
The camera button attaches the screen, a window or a region to your next message.
Look things up on the web
The agent can search the web and read pages, with Chat's search and proxy; see the search-and-network page. To test your web app in a browser, see the mcp-servers page.
Read what the agent did
- Edits show as a diff with line numbers; past 40 lines Show all … lines opens it. Unlike Chat, rewrites don't ask first. A second whole rewrite in one turn needs a command (a test, say) run first.
- Commands show as a card: command, exit code, time and output (the last 20 lines until Show all). Open in Shell types it in a new Shell tab, not run.
- Searches and reads show as steps.
- Reasoning sits above its step, collapsed (live: Thinking…); what the agent says before a step is above it in grey.
- A call being written shows as Writing, Editing or Preparing command….
- File names in the folder (
src/app.ts:42) open in an editor window; Preview beside an.htmlfile shows it (see theweb-previewpage).
Commands that need a terminal
Commands that need a password (sudo) or a terminal can't run here, so the agent hands them to you: a new Shell tab opens at the folder with the command typed in. Check it, then press Enter.
The conversation shows Waiting for you in Shell N — press Enter there, with Go to shell and Cancel. The agent then gets the exit code and output. Cancel stops the wait (the agent carries on); Stop ends the turn; either way the Shell tab stays. If the shell doesn't report finished commands (old fish), the agent asks you.
Edit files
Files open in an editor window, one per folder, a tab per file. Open above the sessions opens any file or folder. ⤢ on a tab moves the file to its own window. Keys: see the shortcuts page. The agent can open files and see the project's images, but can't see your edits. Models, images and sounds open in viewers (see the viewers page).
An outside edit reloads the file, keeping your place. With unsaved edits it shows Changed on disk (Reload / Keep mine), and saving over a change you haven't seen asks Overwrite or Reload first. A deleted file shows Deleted on disk; saving recreates it. Live reload unavailable: outside changes won't show.
Steer or stop the agent
While the agent works, Enter queues your message and its images (Queued); the agent reads them after its running tools (Delivered) and says what it will do. × drops a queued message. Stop (Esc) ends the turn, which the agent won't redo unasked; a cut-short command shows stopped; unread messages return to the input box. / opens the commands and skills list, as in Chat.
A dot on a session's tab shows it working (filled) or waiting for the model (hollow), which one turn uses at a time; a turn lets go of it while a tool runs over a few seconds or waits for you. Stop on a waiting session gives your message back.
Pick the model and effort
The header above the conversation holds:
- the folder — click to open it in your file manager;
- the git branch, with ● for uncommitted changes. Click it to switch branch or start one with Branch from current… or Branch from main… (shown when another branch is checked out). Switching waits for an idle agent and committed or stashed changes; it warns when another open session uses the repo;
- the model — click it to pick Settings model (follows Settings → Inference), Remote server (your saved servers, starting on Settings' one; see the
saved-serverspage) or OpenRouter (cloud), then Save. The local model is only reachable through Settings model; picking one never starts it; - Effort — how hard the model thinks, where it has levels;
- Extras — the session's helpers; see the
helperspage; - the AGENTS.md badge when the repo's instructions are in use (see the
skillspage), and how full the context is; - tokens used, sub-agents' included, and OpenRouter cost (hover for more).
Model, effort and extras apply from the next message.
Background processes
Servers, watchers and long builds run in the background. Running: N in the header lists them: Output shows what each printed, Stop ends it. Closing the tab or quitting stops them.
Command approval and limits
Safe-looking commands just run. A risky one (sudo, rm -rf, a pipe to a shell) opens Run this command? first; one that reaches outside the folder always asks. Prompts from several sessions queue. Allow for this session lasts until its tab closes. Settings → Code holds the time, step and log limits and Auto-approve commands; see the settings-tools page.
What it doesn't do yet
- Each command runs on its own, so
cdand environment changes don't carry over. - Rewind to here doesn't undo commands' changes; see the
code-sessionspage. - Small local models get stuck; see the
modelspage.