PythonAdvancedApplied AI EngineerForward Deployed EngineerApplied AI Architect
Wren: a complete coding-agent harness
The C11 harness on the real Anthropic SDK: the full loop with every stop reason, a tool registry, sandboxed file and shell tools, permission modes and hooks, layered context with memory files, compaction, subagents, checkpoints and resume, traces with cost and replay, and injection defence, behind a `wren` CLI.
Locked
The code is part of the full course
The file map and notes are open to everyone. Get lifetime access to every template's source, the .zip download and all four tracks for a one-time $249.
Run it
shell
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt && pip install -e .
cp .env.example .env # add ANTHROPIC_API_KEY
wren "Make the failing test in tests/test_rates.py pass" --mode default --root path/to/repo
wren --resume <run_id> --root path/to/repo # after Ctrl-C or a crashTest it
shell
pytest -qOffline: no API key or network needed.
Taught in
- C11 What a Harness Is: The Seven Layers Around the Model
- C11 The Loop in Full: Every Stop Reason, Parallel Calls and the History Rules
- C11 Exercise: Wren's Core Loop
- C11 Tool Design and Execution: The Runtime Between the Model and the World
- C11 Exercise: Wren's Tool Registry
- C11 The Built-in Toolkit: File Editing, Bash, Search and Web Fetch
- C11 Exercise: Wren's File Edit Tool
- C11 Context Assembly: Layered Prompts, Memory Files, Skills and a Cache-Friendly Layout
- C11 Long Runs: Compaction, Context Editing and Memory
- C11 Exercise: Compaction That Never Drops the Task
- C11 Permissions and Hooks: Enforcing Policy in Code
- C11 Exercise: A Permission Engine and Hooks in the Loop
- C11 Planning, Subagents and Budgets
- C11 Exercise: A todo_write Planner and an Isolated Subagent
- C11 Durability: Checkpoints, Idempotency, Interrupt and Resume
- C11 Exercise: Checkpoint, Crash and Resume Without Repeating Writes
- C11 Observability and Replay: Traces, Cost and Debugging a Recorded Run
- C11 Exercise: Wren's Tracer, with Tokens, Dollars and Redaction
- C11 Security: Tool Results Are Untrusted
- C11 Exercise: Injection Defence, with Untrusted Wrapping, a Trifecta Block and an Output Scanner
- C11 Deploying a Harness for a Customer: Build or Buy, Tenancy, Rollout, SLOs and Cost