Download

RuntimeThe Rust coreUnder every Forge task

It reads your code before the model does.

Runtime is the Rust engine under every Forge task. It parses your project, links every symbol, sends the model only what a change needs and runs your tests in a sandbox before it shows you a diff.

Parse, link, select. Files become syntax trees, definitions become symbols, symbols become a graph with labelled evidence and only what the task needs is lit. Illustrative; the labels are the engine’s own.
  1. contexttree-sitter map · 3 files read
  2. sandboxnetwork none · root read-only
  3. editsrc/store.ts +15 −4
  4. verify31 of 31 tests
  5. cache$0.0012, not $0.0248
  6. review3 files · waits for you

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

Languages with parsing, symbols and the graph
LanguageExtensions
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.

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

Cost of one request with and without cache markers, in US dollars
RequestReadWriteCost
No marker, same request twice00$0.0146
Marked, cold04,927$0.0248
Marked, warm: the same request4,9270$0.0012
Later content changed, prefix same1,7673,160$0.0163
Prefix changed: a full miss04,934$0.0248
Breakpoint on a tool result, then continue5,9820$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.

  1. 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.

  2. The whole suite

    Your project’s own test command. It is always the final check; the targeted run never replaces it.

  3. 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.

Forge, a demo task finished on Claude Opus 5.5: 31 of 31 tests and 3 files ready for review
The review step in Forge, a screenshot of the real app with demo data: 3 files prepared and waiting behind Apply.
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.

10Measured

Measured, not promised.

Forge against Claude Code on the same model, Claude Opus 5.5: real GitHub issues from SWE-bench and small programming tasks, judged by tests neither agent saw, every run public. One run per GitHub issue and two per small task, on one Mac; Forge’s cost is what OpenRouter charged, Claude Code’s the cost it reports at list prices. Method.

See every run

11Decisions

Written down before it was built.

There are 34 architecture decision records so far. Each one says what we chose, what we turned down and why. These are the ones behind this engine.

All decisions

  1. ADR 0001Platform, toolchain and the process boundary
  2. ADR 0005Sandbox, operation ledger and recovery
  3. ADR 0009The Structural Context Engine
  4. ADR 0010Provider cache and long conversations
  5. ADR 0011Verifier, impact analysis and repair
  6. ADR 0013Reliability, security and the P12 benchmark

Questions

Does Forge understand my code, or just search it?

Both, and it tells you which. Tree-sitter gives exact syntax for five languages; language servers answer definitions, references and calls. Every graph edge is labelled RESOLVED, SYNTACTIC, HEURISTIC or UNRESOLVED, and no confidence percentage is made up.

What if my language isn’t in the list?

Lexical search still works, and the sandboxed test run works when the sandbox has that language’s toolchain. Parsing, symbols and the graph are available for Rust, TypeScript, TSX, JavaScript and Python today.

Will the model ever get half a function?

No. A definition goes in whole, or as a signature that is explicitly labelled [signature]. The middle of a body is never cut. Whatever doesn’t fit the budget is listed as “Not included (context budget)”, in the prompt and in the manifest.

Is prompt caching on for every model?

Cache markers are placed only where they were measured to work: Anthropic models via OpenRouter. They are never pasted into other APIs. Caching doesn’t change the content of the prompt; the same text goes out either way.

Do tests run on my machine?

They run in a Docker container on your Mac with no network, a read-only root, no capabilities and fixed limits. Your real project folder and home directory are never mounted. If no container runtime is available, Forge says the sandbox is unavailable instead of falling back to your shell.

Can the model silently switch?

No. Before a task starts the engine checks the model exists and supports tools; otherwise the task is not created. If a streamed response reports a different model than the one bound, the response is rejected.

Open every benchmark run, or give Forge a task and see the tests it ran before it shows you the change.

Download for macOSEvery run