Skip to content

Quickstart

anchor reads API keys from the environment. With either of these set, it picks a default model:

Variable Default model
ANTHROPIC_API_KEY claude-sonnet-5
XAI_API_KEY grok-4.5
Terminal window
export ANTHROPIC_API_KEY=sk-ant-...

Or run anchor setup to choose a provider, save its key and pick a model from a list. It also sets up LiteLLM and other OpenAI-compatible servers. anchor offers it on first start when no key is set. For more, see Configuration.

Run anchor from the directory you want it to work in. That directory is its sandbox: it can read anything inside it freely, and asks before reading outside it.

Terminal window
cd my-project
anchor
anchor · claude-sonnet-5 · /home/you/my-project
/help for commands, Ctrl+D to exit
›
› the add function in calc.py is wrong, fix it
↳ read_file calc.py
? Edit calc.py
@@ -1,2 +1,2 @@
def add(a, b):
- return a - b
+ return a + b
Allow? [y]es [n]o [a]lways: all file writes in the workspace › yes
✎ calc.py +1 -1
Fixed: `add` was subtracting instead of adding.

Every write shows you the diff first. Press:

  • y to allow this one action,
  • a to allow this kind of action from now on: file writes for the rest of the session, a command’s programs or an MCP tool saved for this directory,
  • n or Esc to decline. The model is told you declined and not to retry.

Other keys are ignored, so a keystroke meant for the prompt never answers.

Reads inside the directory and read-only shell commands like ls, grep or git diff run without asking.

Tell anchor how to check the work, and it keeps going until the check passes:

› /until python3 -m unittest -q
› make all the tests pass
...
✗ check failed (round 1 of 5): python3 -m unittest -q
...
✓ check passed: python3 -m unittest -q

See Working until a check passes.

  • /undo reverts the files changed in the last turn.
  • Ctrl+C cancels a running turn. Pressed twice at the prompt, or Ctrl+D, exits.
  • anchor --resume picks up the latest session in this directory.
  • @src/app.py in a message attaches the file; Tab completes the path as you type.
  • Ctrl+O shows the last tool’s whole output, or a diff in full.
  • Ctrl+F finds text in the conversation, and Ctrl+R finds an earlier message.
  • /copy copies the last reply; /copy code copies a code block from it.
  • /help lists every command and key. Using the REPL has the details.

anchor adds AGENTS.md in the working directory to its system prompt. Use it for build commands, conventions, and anything the model should know about the project:

AGENTS.md
- Build with `dotnet build`, test with `dotnet test`.
- Keep public APIs documented with XML comments.