# The Code tab

> The Code tab on code.extension.dev is an editor over every file in the project, where your edits reach the agent as a diff and the agent's edits are marked until you read them.

Canonical: https://docs.extension.dev/code/code-tab
This page as Markdown: https://docs.extension.dev/code/code-tab.md
Section: Code
Siblings: [AI generation](https://docs.extension.dev/code.md) · [Terminal](https://docs.extension.dev/code/terminal.md) · [Chat mode](https://docs.extension.dev/code/chat-mode.md) · [Starters and templates](https://docs.extension.dev/code/starters.md) · [Live preview](https://docs.extension.dev/code/preview.md) · [Select to edit](https://docs.extension.dev/code/select-to-edit.md) · [Build console](https://docs.extension.dev/code/build-console.md) · [Checkpoints](https://docs.extension.dev/code/checkpoints.md) · [Drafts](https://docs.extension.dev/code/drafts.md) · [Firefox engine](https://docs.extension.dev/code/firefox-engine.md) · [Download and run locally](https://docs.extension.dev/code/download-and-run.md) · [Share links](https://docs.extension.dev/code/share.md) · [Publish and import](https://docs.extension.dev/code/publish.md) · [Generation allowance](https://docs.extension.dev/code/allowance.md) · [Settings and sign-in](https://docs.extension.dev/code/settings.md)
Map of every page: https://docs.extension.dev/llms.txt · Whole corpus: https://docs.extension.dev/llms-full.txt

---

# The Code tab

The Code tab is the editor over every file in the project. Reach for it when
you want to read what the agent wrote, or change a line yourself instead of
asking for it.

## Quick start

Open **Code** in the header, or add `/code` to the draft address, such as
`/drafts/<id>/code`. Pick a file in the tree, edit it, and press **Save &
rebuild**. The build runs and the preview reloads what changed. On the
agent's next turn it finds your edit as a diff and reads it before writing
to the same paths.


## How it works

### Your edits reach the agent

The Code tab and the terminal edit the same files. Save a file between turns
and the agent's next turn finds `CHANGES.md` at the root of the workspace,
headed `# Changes since your last turn`, with a unified diff of what you
changed since it last looked. The `changes` command prints the same diff and
marks it read, or answers `No edits outside the terminal since your last
turn.` The file is a message, not a project file. It never lands in your
draft or your download.

### The agent's edits are marked for you

Every file the agent writes is listed above the editor under **Changed by
the agent** until you open it, and the **Code** tab carries the count of
files you have not looked at yet. **Review changes** opens the diff view. A
path the agent wrote over your own unsaved edit reads `over your edit`. The
badge means not yet seen, not recent. Opening the file clears it.

### Save and rebuild

Edits stay pending until you press **Save & rebuild**, which shows the
number of files waiting. The button reads **Saved** when nothing is pending.
A save writes a checkpoint and compiles, so the preview reloads only what
changed.

### The tree is for reading

The file tree selects and expands. Creating, renaming and deleting files is
the agent's work, so ask for it in the terminal or the chat.

## Reference

| Address | What it opens |
| --- | --- |
| `/new/code` | The Code tab of a workspace with no project yet |
| `/drafts/<id>/code` | The Code tab of that draft |
| `/<workspace>/<project>/code` | The Code tab of a project address |

| Limit | Value |
| --- | --- |
| Diff lines before `CHANGES.md` falls back to whole-file lines | 4000 |
| Files in one draft | 300 |

## When it fails

- **The agent overwrote your edit.** It wrote the file before reading your
  diff, or in the same turn. The strip marks the path `over your edit`.
  Restore the checkpoint the save wrote, from [Checkpoints](/code/checkpoints).
- **`changes` says there are no edits, but you edited a file.** The edit is
  still pending. Press **Save & rebuild** first.
- **A new file is not in the tree.** The tree cannot create files. Ask the
  agent to write it, and it appears under **Changed by the agent**.

## Next

- [Terminal](/code/terminal) for the `changes` command and the agent's turn
- [Checkpoints](/code/checkpoints) for the restore point every save writes
- [Build console](/code/build-console) for what a save compiles
