A coding agent that validates its own work.

Anvil applies every edit through a shadow workspace before touching your files. The language server has to sign off before anything commits to disk.

Read the writeupView on GitHub
anvil — test-repo-2
session e7a12143 · claude-sonnet-4-6
request: Rename the User type to Account across all files
 
[Orchestrator] Complex request, spawning planner
[Planner] Exploring codebase...
[ast_search] query_type=interfaces
  User [interface, lines 7-13]
[find_symbol] symbol=User
  19 references across 3 files
[Planner] Plan written
 
Approve plan? (y/n/revise): y
[Executor] Executing approved plan...
[write_file] path=db.ts
  shadow[1/3] db.ts · 2 type errors, retrying...
[write_file] path=db.ts (attempt 2)
  shadow[2/3] db.ts · committed
  shadow[1/3] auth.ts · committed
  shadow[1/3] types.ts · committed
 
[Anvil] Done: Renamed User to Account across types.ts, db.ts, auth.ts
claude-sonnet-4-6DONE22s

Validation

Edits are tested before they land.

Cursor implements shadow workspaces as a hidden VS Code window with full editor state. Anvil does it at the filesystem level. Every proposed edit goes to a temporary copy first, the language server runs diagnostics against it, and only a clean result commits to your actual file.

shadow[1/3] db.ts · validating...
2 type errors returned to executor
shadow[2/3] db.ts · self-correcting...
committed · pre-existing bug caught (all.size → all.length)

Retrieval

It navigates codebases, not files.

Most agents read every file and hope the context window contains what they need. Anvil uses tree-sitter for AST queries, an LSP client for symbol resolution, and ripgrep for text search. The planner explores iteratively and decides what to look for based on what it finds.

anvilai "@src/auth.ts has a session expiry bug, fix it" .
anvilai "@AppError needs an error code field" .
anvilai "@https://docs.stripe.com/api implement payment flow" .

Isolation

The planner cannot write. The executor cannot wander.

Every complex request is split into a Planner that explores with read-only tools and an Executor that writes only to the files the plan names. You approve the plan before anything is written.

Goal: Rename User interface to Account
Files to modify: types.ts, db.ts, auth.ts
Steps: 19 targeted changes across 3 files
Risks: function names are intentionally unchanged
Approve plan? (y/n/revise):

Get started

npm install -g anvil-agent
anvilai init
anvilai "your request here" .

Run anvilai doctor to verify your setup.