Goal-first execution. Verification before trust.
Anchor is a skill-first control layer for Codex and Claude Code. It runs deterministic goal and verification flows, records what happened, and stops for explicit reasons instead of vague agent exits.
npx anchor-workflow installThat installs Anchor into:
- Codex:
~/.codex/skills/anchor-control - Claude Code:
~/.claude/skills/anchor-control - Claude commands:
~/.claude/commands/anchor/goal.md,~/.claude/commands/anchor/test.md
Anchor is built around two user-facing commands:
anchor goal
anchor testExample:
pnpm anchor goal "Implement the auth migration" --backend codex --cwd D:\repo --json
pnpm anchor test "current work" --cwd D:\repo --jsonIf you are calling the installed skill assets directly, use the cross-platform wrapper. Installs performed from an Anchor source checkout, or with --repo-root, record the runtime workspace automatically. Otherwise set ANCHOR_REPO_ROOT or make anchor available on PATH.
node ./scripts/anchor-control.mjs doctor --json
node ./scripts/anchor-control.mjs goal "Implement the auth migration" --json
node ./scripts/anchor-control.mjs test "current work" --jsonMost coding agents are good at trying things. They are much worse at:
- recognizing repeated failure patterns
- carrying structured memory across attempts
- separating backend self-report from trusted execution evidence
- leaving behind a durable execution record you can inspect later
Anchor handles that control layer.
- paired goal and verification entrypoints
- the same skill control model above Codex and Claude Code
- append-only task history in SQLite
- local artifacts for transcripts, patches, and command logs
- explicit terminal reasons and replayable state
flowchart LR
U["User Request"] --> W["anchor goal / anchor test"]
W --> R["Anchor Control Layer"]
R --> S["SQLite Event Log"]
R --> A["Local Artifact Store"]
R --> C["Codex Adapter"]
R --> L["Claude Adapter"]
At a high level, Anchor:
- turns a user request into a controlled goal or verification flow
- evaluates backend output and trusted verification evidence with explicit rules
- records state for replay, inspection, and failure analysis
By default, Anchor writes under .anchor/:
- SQLite database:
.anchor/anchor.db - artifacts:
.anchor/artifacts/
Artifacts are for traceability and inspection. Control decisions come from the event log and projections.
pnpm install
pnpm typecheck
pnpm test
pnpm anchor:doctor -- --json
pnpm anchor --help
pnpm anchor-workflow install