01Seven steps, one engine.
Every task in Forge goes through the same pipeline, from a copy of your project to a diff that passed: snapshot, parse, graph, select, call, verify, review.
02Copy the project into a sandbox volume.
The task gets its own copy of your project in a Docker volume. Your real folder is never mounted, and secrets, .git and node_modules are left out. Everything after this point, from parsing to the test run, works on that copy.
03Every file becomes a syntax tree.
Tree-sitter turns each file into a concrete syntax tree. The engine walks it and records every definition, from functions and classes to types, constants and imports, with its exact byte range.
- Incremental
- A file is parsed again only when its BLAKE3 hash or grammar version changes.
- Consistent
- Updates are published as whole generations, so a query never sees half an old index and half a new one.
- Bounded
- Up to 20,000 files per workspace, 4 parses in parallel, 1 MiB and 2 s per file. Anything skipped is reported.
- Honest
- Files with syntax errors keep the symbols that were found and are marked as such.
Five languages today
| Language | Extensions |
|---|---|
| Rust | .rs |
| TypeScript | .ts .mts .cts |
| TSX | .tsx |
| JavaScript | .js .mjs .cjs .jsx |
| Python | .py .pyi |
Other languages get lexical search, and a sandboxed test run when the sandbox has their toolchain.
04Every symbol, linked to what it touches.
Language servers, rust-analyzer and typescript-language-server, run in containers with no network on a copy of your files and answer definitions, references and incoming calls. The index adds what contains what.
Every edge says how it is known
- RESOLVEDanswered by the language server: definition, references, incoming calls
- SYNTACTICfrom the syntax index: a symbol contains another
- HEURISTICsame name, word match, relative import, a test that names the file
- UNRESOLVEDnothing found, or a package import outside the project
A reference is never presented as proof that a call happens at runtime, and no confidence percentage is made up.
- Never stale
- Answers are tied to the document version and a digest of the files; if either changed, the answer is thrown away.
- Bounded queries
- Neighbourhoods go 3 levels deep, 200 nodes, 12 edges per node, so a busy helper can’t eat the budget.
- Fallback
- No server? Same-name definitions and word matches stand in, labelled HEURISTIC.
05Only what the task needs, with the reasons written down.
The context engine starts from what you named and where tests fail, follows the graph a short way and scores every candidate with written reasons. Those reasons go into the prompt too.
- Seeds
- Paths and names in your request or the test output, and error locations from tracebacks and stack traces.
- Whole or signature
- A definition goes in whole or as a labelled
[signature], never as half a body. - Budget
- 10% of the model’s context window, between 4,000 and 20,000 tokens. What doesn’t fit is listed as “Not included (context budget)”, not dropped silently.
- On by default
- The pre-registered benchmark found it no worse than the baseline on any held-out task, so it is the default.
06Pay once for the part that doesn’t change.
Tools, system prompt and task context form a stable prefix, with no timestamps and nothing random. One cache marker sits on it; a second moves to the newest message every turn, so each turn reads the one before.
- Provider-specific
- Markers go only where they were measured to work: Anthropic models via OpenRouter. Other APIs never get the field.
- Same content
- Marking doesn’t change a word of the prompt. A cache miss costs money, never correctness.
- Counted properly
- Cache reads and writes are tracked apart; cost is the provider’s own figure.
Cost of one request, measured
| Request | Read | Write | Cost |
|---|---|---|---|
| No marker, same request twice | 0 | 0 | $0.0146 |
| Marked, cold | 0 | 4,927 | $0.0248 |
| Marked, warm: the same request | 4,927 | 0 | $0.0012 |
| Later content changed, prefix same | 1,767 | 3,160 | $0.0163 |
| Prefix changed: a full miss | 0 | 4,934 | $0.0248 |
| Breakpoint on a tool result, then continue | 5,982 | 0 | $0.0014 |
Tokens read from and written to the cache; US dollars, lower is better. Measured live, 26 September 2026 · anthropic/claude-opus-5.5 via OpenRouter · ADR 0010.
07Tests decide, before you see anything.
Checks are run by the engine, not suggested by the model. Results are compared test by test with a baseline taken before the change, so a regression is named, and an old unrelated failure isn’t blamed on it.
Related tests
Test files that changed, or that name the changed module, run first as a fast check. If they fail, repair starts without waiting for the full suite.
The whole suite
Your project’s own test command. It is always the final check; the targeted run never replaces it.
Independent acceptance
If the change edited or deleted a test file, the original tests are put back and the suite runs again. Edited tests that pass while the originals fail give UNVERIFIED, never success.
Four outcomes, and only one is a pass
- PASSEDThe full suite ran in the sandbox and passed.
- FAILEDShown with its output. The agent gets the failing tests by name, for up to two repair turns in a task and eight in a Build run.
- UNVERIFIEDSomething passed, but not in a way that proves the change: edited tests, or old failures unrelated to it.
- UNAVAILABLENo test command or no sandbox runtime. Reported as such, never as passing.
A container with nothing to lose
The sandbox is a Docker container on your Mac, created per operation and recorded in a ledger so it can be recovered after a crash. If no runtime is installed, Forge says so; it never falls back to your shell.
Sandbox container · default profile
- Network
- none
- User
- 1000:1000, not root
- Root file system
- read-only · /tmp 64 MiB, noexec
- Capabilities
- all dropped · no-new-privileges
- Limits
- 2 GiB memory · 2 CPUs · 256 processes
- Time
- 10 min by default, 30 min at most
- Your folder
- never mounted; the task works on a copy
08A diff that passed, and how it got there.
You get the change, the test result and the context manifest: what the model saw and why. You pick the model for every conversation, and it is bound when the task starts.
- No silent fallback
- If the model is missing or can’t use tools, the task isn’t created.
- No model swaps
- A streamed answer from a different model than the one bound is rejected.
- Bounded loop
- A task: up to 40 turns, 16 tool calls per turn and 2 repair turns. A Build run: up to 2,000 turns, 8 repairs and an 8-hour deadline. Extra calls are reported, not run.
09What leaves your Mac, and what stays.
Leaves your Mac
- Your message and the context segments listed in the manifest
- Tool results the agent needs for the next turn
- Sent from the Rust core to the model you picked, over HTTPS
Stays on your Mac
- Your project folder, unless you choose the cloud runtime; locally the sandbox works on a copy in a local volume
- Your own provider key, if you add one, in the macOS Keychain; the interface never sees it
- The syntax index and symbol graph, in a local SQLite database
More on the sandbox, approvals and keys on Security.