Examples
The examples/
module contains small, runnable harnesses. Each isolates one
pattern; each has its own README; most accept -scripted and run a
deterministic fake client so you can watch the machinery without an
API key.
| Example | What it demonstrates |
|---|---|
quickstart |
Canonical compiled source for the minimal Anthropic runner and typed weather tool used in the root README and getting-started guide. It needs a key and network only when run. |
healthcheck |
A world-verifying goal: the agent probes a fake server farm until every endpoint reports healthy. Schema + fan-out guardrails police the calls. |
releasegate |
Pre/post guardrails around a release process: the agent may only publish after every required check is green, and the goal confirms the publish actually happened. |
hnupvote |
Live browser automation under pursue: a real Chrome session where the oracle is verified world state and a login wall forces the re-drive path. |
computer_use |
Live observe → model → act loop using typed computer-use tools. Requires Chrome, network access, and an LLM. |
spawn_worker |
Hierarchical decomposition: a coordinator launches researcher / reviewer / coder tasks with agent_spawn, continues independently, and collects results explicitly under work-mode gates and a depth cap. |
stuck_recovery |
The decompose guardrail’s graduated response — pass, advisory, fatal — as an agent repeats a failing search, then recovers by delegating. |
long_conversation |
Compactor integration: a pressure-gated compactor keeps a long exploration inside the context window without orphaning tool calls. |
shared_infra |
No-LLM tour of code understanding, retrieval indexing/search, workflow graph execution, checkpoint saving, and a deterministic HITL review decision. |
hitl_resume |
Real checkpoint/review/resume boundary: save state, approve/deny/edit through HITL, reload, and invoke an explicit continuation. |
local_mcp |
Local stdio MCP subprocess: initialize, discover and call a tool, then disconnect cleanly. |
dynamic_tools |
Dynamic tool lifecycle: register from disk, invoke, reload, unregister, and reject a built-in name collision. |
skill_catalog |
Discover SKILL.md guides, load the versioned store, and select applicable skill content. |
notify_drain |
Live notification subscription plus deterministic offline drain after unsubscribe. |
sandboxed_shell |
Actual Linux Landlock enforcement: workspace writes succeed while an ungranted outside write is denied. |
deterministic_trace |
Runner lifecycle callbacks persisted as JSONL and read back without a provider. |
Running them
Section titled “Running them”# deterministic, no LLMgo run -C examples ./healthcheck -scripted
# shared infra tour, no LLM or external servicesgo run -C examples ./shared_infra
# live provider — flags are uniform across agent examplesgo run -C examples ./healthcheck -provider anthropic -model claude-sonnet-4-6go run -C examples ./releasegate -provider llamacppProvider selection goes through the same
backends registry as
everything else: -provider names a builtin, keys come from the
standard env vars, -base-url (or LLAMACPP_BASE_URL etc.)
overrides endpoints.
Reading order
Section titled “Reading order”Start with quickstart for the smallest compiled composition or shared_infra for
the non-LLM infrastructure pieces, then healthcheck — it’s the smallest complete
loop with a real goal. Then releasegate for guardrails as policy, and
stuck_recovery for what graduated advisories look like in
practice. hnupvote is the one to read when you want to see pursue
driving something genuinely flaky (a browser) to a verified outcome.
Each example’s README walks through its harness construction;
examples/patterns.md in the repo collects the recurring shapes —
scripted clients, fake filesystems, oracle design — you’ll reuse in
your own harnesses.