What can the Code agent do, and how does it work?

The Code agent changes real code in a folder you choose, inside a review-grade editor. It asks a map of your code before opening files, checks what a change will break before making it, and saves a hidden checkpoint before every turn's first edit, so any turn can be undone without touching your own git.

What makes it different

what it does the primitive behind it what that buys you
Asks the code, not the folder A code graph of every function, class and call in your project, queried with one code tool It finds the right files without listing directories and reading everything, so reading budget goes to the code that matters
Checks what breaks before editing impact and change_contract: callers grouped as direct, indirect (by distance), or name-only guesses A change to shared code comes with the list of what else must change. An empty answer is never read as "nothing calls this"
Never guesses which one you meant An ambiguous name returns every candidate; the agent has to pick one A wrong pick can't travel silently all the way to an edit
Every turn can be undone A hidden checkpoint before the turn's first write, in a separate git repo Restore puts a whole turn back. Your own .git is never touched
Reads in measured amounts Each read is capped at 8,000 tokens; files past the cap are listed to read by line range Reads stay in the conversation as real code, never swapped for a pointer the agent would have to read back
Edits that refuse stale ground edit_file aborts if the file changed on disk since the agent read it It can't overwrite your own change with an edit based on an old copy

How it works

Your folder, your session

  • Pick a folder from the header (the system folder picker), even before the first message. A chat with no folder works in a scratch folder.
  • The folder is remembered, even across restarts. Each chat has its own folder, shell and code map, and switching folders resets them.
  • The agent keeps its working files in a .code_index/ folder inside your project. It ignores itself in git, so it never shows up in your git status.

Pointing at files with @ (alpha)

Type @ in a coding chat and pick a file or folder: the agent gets its contents with your message, so it starts on the code you mean instead of searching for it. It works in coding chats on your Mac and on another computer. The main chat's @ lists toolkits only.

  • A Files group appears above Toolkits and lists the whole project. Matching is fuzzy and filters as you type: the letters you type, in order, anywhere in the path. A folder row opens, so you can pick inside it.
  • A picked file or folder becomes a chip in your message, like [📄 db.ts]. The contents go to the agent, never into the chat bubble.
  • What the agent receives:
you pick the agent gets
a file up to 2,000 lines and 100 KB the whole file
a bigger file its path and "too big to include (N lines). Read it with read."
a folder the names of the files directly inside it, up to 200
a binary file its path and "binary file"
a file that can't be read at send its path and the reason; the message still sends
  • Contents are read when you send, from the computer the chat is on. Paths outside the project folder are refused. The same file mentioned twice is sent in full once; later mentions point back to it.
  • The file list is fetched once per chat and fetched again when you type @ more than 30 seconds later, or after you create, rename or delete a file in the files panel. A very large project shows the first 50,000 files: keep typing to narrow.
  • On another computer that can't be reached, the Files group shows one row, "Can't reach work-vm — Reconnect to search files". Toolkits are still listed.

Why: the file you point at arrives with the question, so the agent doesn't spend steps (and usage) finding it, and a size limit keeps one big file from crowding out the conversation.

Remote (SSH) projects

The agent works on a Linux computer you can SSH into, and your Mac keeps the brain. Files, search, commands, the terminal and background jobs run on that computer, in the project folder. The chat, its memory, its approvals and its job list stay on your Mac, and nothing is installed on the other computer.

Why: the project never has to be copied to your Mac to be worked on. Your Mac keeps the conversation and the approvals, and the only way project files come across is Save to my Mac, which you start.

Connect: - In a coding chat, open the folder menu and choose Another computer…. In an empty chat, Where's the project? has an [Another computer] button too. - A card floats over the chat. Type user@host, or pick from: - Recent: computers you connected to before, kept in a file on your Mac. - From your SSH settings: the hosts in your ~/.ssh/config, each showing the address SSH resolves it to, "(via jump)" for a jump host, and "● open" when another chat is already connected there. - Irene uses your Mac's own ssh, so your config, keys, key agent and jump hosts all work. SSH's own questions (a passphrase, a host key) appear word for word in Irene's box. Irene never saves a passphrase or password, and never writes to ~/.ssh/config. Why: the login stays yours; Irene only carries the questions. - Pick a folder. The card starts in your home folder over there. Show hidden reveals dot-folders. The files panel then reads host : folder.

Where things run:

what where
the agent, the chat, memory, approvals, the job list your Mac
files, search, shell commands, the terminal, background jobs the other computer, in the project folder
undo checkpoints .code_index/ inside the project, over there
background job logs and run markers ~/.irene-remote/ over there

Irene writes nothing else on the other computer. Commands there run as your account and are not inside Irene's Mac safety wall. The approval card says so.

Connection states. While connected there is no pill: the files panel label, 🔗 work-vm : folder, is how you see where you are. A pill appears above the chat box only when something needs you.

what you see state what happens
no pill; the files panel reads work-vm : folder connected commands run on the other computer
work-vm · connecting… connecting the link is being set up
⚠ work-vm · Reconnect (amber) lost the link dropped under a running command. The command stops, the reply ends with "Lost the connection to work-vm.", and the agent makes no more tool calls that turn
⚠ work-vm · Reconnect (amber) failed the first connect did not get through
work-vm · disconnected · Reconnect (grey) disconnected you chose Disconnect in the folder menu. It stays disconnected, even after a restart, until you click Reconnect
  • Reconnect brings the chat back on the same computer and folder. Sending a message while lost tries one reconnect first, and the composer says "Sending reconnects first…".
  • No silent fallback. A remote chat never switches to a folder on your Mac. While the link is down, its tools refuse with "work-vm isn't connected. Reconnect first."
  • Measured on a test computer 72 ms away: a dropped link ends the running command within about 10 seconds, and a reconnect takes under a second. Why: a drop is said out loud, so a command never looks finished when the link died under it.

Long commands. A long command keeps running on the other computer. Stop ends it over there, not only on your Mac, and so does closing Irene. Background jobs keep running there when you close Irene; their card names the computer, and while the link is lost it reads "can't reach work-vm (still running there)". Why: the job runs where the files are, so closing your Mac doesn't touch it.

Port forwarding (a dev server). - When a command runs in the background over there and serves a page, its port comes to your Mac by itself — no click. What counts is the port the job's own processes listen on, asked of that computer, so a server that prints nothing is still found; a page it only mentions in its output is not forwarded. - The card then reads work-vm:5173 → this Mac:5173 with Open and Stop forwarding. Open shows the page in Irene's Browser pane; nothing opens there until you press it. - The forward listens on your Mac's own loopback addresses only, 127.0.0.1 and [::1], so localhost:5173 works in any browser on the Mac and other devices on your network can't reach it. Why: SSH is the only connection between the two computers. No other port opens on either one. - Stop forwarding closes it and it stays closed for that job — the next check does not put it back, and neither does a reconnect or a restart. The row then offers Forward to this Mac if you change your mind. - A job that ends closes its forwards. A lost link pauses them; Reconnect brings back the ones you did not stop, at the same port on your Mac when it is free.

Save to my Mac. Right-click a file or folder, or use the folder menu, and choose Save to my Mac. - The card shows the size first. Skip heavy folders is ticked by default and leaves out node_modules, .venv, .git, dist, build, target and __pycache__. The count and the copy use the same choice. - Files that look like secrets are named on one line. They are still copied: it's your computer and your folder. - To: defaults to the folder you picked last. Change… picks another. - Files arrive in a hidden temporary folder beside the target, and are renamed into place only when the copy is complete. Cancel removes the partial copy. If the name exists, choose Keep both or Replace. - One save runs per chat at a time. Why: this is the single, visible way project files reach your Mac.

Closing and reopening. Your chat is saved on your Mac. When you open Irene again, the chat comes back on the same computer and folder, shown as disconnected, until you click Reconnect. Why: Irene doesn't show a link as up until it has checked it since the app opened. A Disconnect you chose stays through restarts.

Limits of remote projects: - Linux only. A Mac or Windows computer can't be the other computer yet. - The code graph is off over there. The agent is told this up front and searches with the shell (rg, grep, find). If it asks the code graph anyway, it gets "Code index isn't available on <host>. Use shell (rg/grep) instead." and you see a short notice above the chat box that fades after about 4 seconds. The files panel says it once per connection. - Video, audio and scanned PDFs can't be read over there yet: "Reading video/audio files on another computer isn't supported yet." - Code chats only. The main chat has no SSH. - Cloud coding and autocomplete are not available yet.

The code graph

  • Built in the background the first time you work in a folder. Basic answers are available within about 30 seconds on a large project, and complete ones within a couple of minutes. While it's still building, answers say so.
  • What you can ask it:
action answers
context a task-focused view of the project: start here for project-wide questions
outline one file's structure
search find by meaning, name or pattern
symbol a definition's source and signature
callers · calls who calls this; what this calls
references is this used anywhere
impact what breaks if this changes, grouped by how far away
change_contract is this change safe, and which callers must change
  • Across files needs a language server. For Python, TypeScript and JavaScript, Irene installs one for you. For Go, Rust, Ruby, C, C++, PHP, C# and Java, it uses the one already on your computer. The install is offered once in the app's setup box, never in chat. Without one, answers about other files are marked "within-file only".
  • Measured on Irene's own code: finding callers in other modules went from 4% with no language server to 82% with one, and finding references from 36% to 85%. Names resolved correctly 100% of the time.

Checkpoints

  • Before a turn's first write (an edit, a new file, a shell command), the folder is checkpointed in a hidden git repo inside .code_index/. Turns that only read take none.
  • The Changes panel compares any two checkpoints, or a checkpoint against now. Restore shows exactly which files will change or disappear, takes a safety checkpoint first, then puts the folder back. Chat history stays.
  • Kept: the last 50 checkpoints. Files over 5 MB, folders over 2 GB, and node_modules, virtual environments, build output and caches are skipped.

Why a separate repo: your own git history, staging and branches stay exactly as you left them. Undoing an agent's turn never becomes a git operation on your repo.

Its tools

tool does
code ask the code graph (above)
read_file read one or many files, up to 8,000 tokens per call; also Word, PowerPoint, Excel, PDF, images
edit_file replace text in a file; forgiving about indentation and stray line numbers, and refuses if the file changed since it was read
write_file create or replace a whole file
shell run commands in a persistent terminal (2-minute default). Several commands in a row stop at the first failure. Background jobs report back when they finish
plan the task plan for work past a couple of files; it's the same plan you see on the Plans page
set_coding_workspace switch to another project folder

Tests and git run through shell.

It also carries discovery, skill, recipe, reflex, chronicle, delegate, equip, web and cards. → Main agent

Deliberately not carried: - The general file and shell tools. They work in one shared folder and would fight the per-chat project picker. The Code agent's own tools also keep the code map up to date as they write. - The task list (todo). plan is the one planning surface, so there aren't two. - Plugins, sites and language-server setup are added only when needed. Each one's description would cost tokens on every turn.

Why 7 tools: it used to have 26, and its instructions described tools that no longer existed. Fewer, sharper tools means a smaller prompt on every turn and fewer wrong calls.

How it's told to behave

  1. Repository questions start with code, not by listing folders.
  2. Size the job from what code returns, not from how the request sounds: small → do it · the same mechanical change many times → a reflex · broad investigation → explorers in parallel.
  3. Never take the first of several matches. Ask which one, or pick by id.
  4. Read graph answers by group. "Nothing direct" means nothing it could resolve, not nothing at all. Confirm with references or a text search before deleting or renaming.
  5. Before editing shared code, run impact. Run change_contract before changing a signature.
  6. Write less code: does it need to exist? Is it already in this codebase, the standard library, or a dependency you have? Only then write the smallest thing. Never "simplify" away validation, error handling, security or accessibility.
  7. Project rules: an Irene.md or AGENTS.md at the project root is followed like your own instructions. If both exist, Irene.md wins.
  8. One sharp question only when a wrong assumption would waste real work. Otherwise take a sensible default and say so.

Commands (Code only)

command does
/understand picks the question first: what is this, why is it like this, or what happens if I change this (which runs impact first)
/grill asks every open design question in numbered rounds, each with a recommended answer, and won't build until the big decisions are made
/init reads the project and proposes an Irene.md of project rules. It shows a diff before overwriting one, and never installs, commits or publishes
/review-pr reviews a pull request (or two branches) against standards and the spec, with blocking risks and fixes. Posts nothing to GitHub
/security-review reviews the change's trust boundaries and runs Semgrep, Gitleaks and OSV Scanner. Secrets are never printed

Approvals

  • Every edit, write and shell command asks first (unless you've trusted it). The diff appears in the Changes panel once the change lands, and any turn can be restored.
  • In auto mode, git is sorted by what it does:
    • Runs: status, diff, log and other reads; add, commit, checkout and other local changes.
    • Treated as deletes: push --force, reset --hard, clean, branch -D.
    • Treated as sends: push to main, master or production, deploys (vercel --prod, fly deploy, terraform apply…) and gh pr merge.
    • Always held: sudo, and rm -r on the project root.
  • Package installs of named packages go to the auto-mode judge.

→ Approvals & auto mode

Where you see it

  • The coding workspace: a files rail · the chat · a code column (Code | Diff, plus Plan and Changes) · an optional browser dock for previewing what you're building.
  • The editor: multi-tab with syntax colours for 30-plus languages. Changed lines are marked in the gutter. Ctrl+click (Command+click on a Mac) jumps to a definition through the code graph (and asks when there are several), find-references opens a peek, and Ctrl+Shift+F (Command+Shift+F on a Mac) searches the project.
  • The Changes panel reviews like a pull request: every changed file as a card with its own diff, unified or split. Pick what to compare:
    • this chat's turns (checkpoints)
    • Local Git (your branches against your working files, read-only)
    • a GitHub pull request (files, conversation, commits, checks and reviews, read-only)
  • The terminal: a real terminal in the project folder.
  • Live updates: as the agent edits, the tree, open files and diffs refresh. Files you're editing yourself aren't overwritten.

How it gets better

  • 41 built-in coding skills (55 with the ones shared by every agent) cover the whole path: understanding a codebase, turning a request into a spec, designing, planning, testing first, making a surgical change, finding bugs by reproducing them, checking what was claimed, reviewing PRs, resolving merge conflicts, and working in parallel git worktrees.
  • 6 built-in reflexes:
reflex does
understand-code answer a question about the code
write-tests write tests, run them, repair once
check-my-diff review the current diff and say GO or HOLD
apply-many-edits the same change across many files, in one restorable turn
audit-for-a-rule check the codebase against a rule
investigate-in-parallel send explorers into different parts at once
  • It writes its own: the second time it notices the same shape of task, it writes a reflex. After a run worth repeating, it saves a recipe.
  • Memory: returning to a project, it checks Chronicle for past notes first. It saves durable facts and write-ups as it goes.

A real one: on a small URL-shortener project, asked to add a delete to its link service, it found the right code through the graph, wrote the test first, edited the service, and ran the tests five times until green. A background command it started reported back on its own when it finished.

What it costs

  • Model usage at what we pay + 20%, on the model set for Code (any model per chat). No plan gate.
  • What keeps it cheap: the code graph instead of reading whole folders, the 8,000-token read cap, tools loaded only when needed, and compaction that always keeps the latest turn verbatim, so the last diff is never blurred.

Limits

  • Git is read-only in the app. No staging, committing, branching or PR writing from the interface. The agent can commit through the shell, with approval.
  • Cross-file answers need a language server. Python, TypeScript and JavaScript are installed for you; other languages need yours already installed.
  • Runs on your computer, or on a Linux computer you can SSH into (see Remote (SSH) projects above). Cloud coding and autocomplete aren't available yet.
  • No debugger or problems panel.
  • Checkpoints skip files over 5 MB and folders over 2 GB.

[Ask Irene about this]

Updated