concurrency-controlUse when a model emits multiple tool calls in a single turn and the harness must execute them in parallel safely, or when subagents/forks run concurrently and share state. Apply when designing the concurrency model for tool dispatch. Covers parallel tool execution, ordering guarantees, cancellation
hook-systemUse when an agent harness needs user- or admin-configurable interception points — before/after tool calls, on prompt submit, on stop, on session start. Apply when designing the event/hook architecture that lets operators inject policy, logging, or transformation without modifying core harness code.
memory-compactionUse when an agent's conversation or working memory grows past the model's context window, or when long sessions accumulate stale tool output, repeated reads, and verbose traces that crowd out signal. Apply when designing how a harness summarizes, prunes, tiers (hot/warm/cold), or evicts history with
model-routingUse when an agent harness has access to multiple models (Opus/Sonnet/Haiku, or cross-vendor) and must pick the right one per turn based on capability, cost, latency, or load. Apply when designing the routing layer that sits in front of model invocation. Complements graceful-degradation (which covers
permission-gatesUse when an agent harness must classify tool calls by risk and decide which require human approval, which run automatically, and which are denied outright. Apply when building the permission/policy layer that sits between the model's tool-call output and execution. Covers risk classification (read/w
prompt-cachingUse when an agent harness makes repeated calls with large shared prefixes (system prompt, tool schemas, prior turns) and inference cost or latency matters. Apply when designing cache breakpoint placement, TTL selection, and turn structure to maximize hit rate. Covers Anthropic prompt cache mechanics
rate-limitingUse when an agent harness must respect upstream model/tool rate limits, manage quotas across concurrent sessions, and handle 429s without dropping work. Apply when designing the queue/throttle layer in front of model and tool calls. Covers token-bucket vs leaky-bucket, per-key vs global quotas, back
session-persistenceUse when an agent harness must survive process restarts, resume interrupted work, fork a session for parallel exploration, or replay a transcript for debugging. Apply when sessions span hours/days, when crash recovery matters, or when humans need to audit/replay agent runs. Covers checkpoint format,
streaming-ioUse when an agent harness must stream model output to the user in real time, dispatch tool calls mid-stream, or support cancellation before generation completes. Apply when building the IO layer that mediates between the model's token stream and the user/UI. Covers SSE/streaming protocols, partial J
subagent-orchestrationUse when a single agent loop is insufficient and work must be delegated to subagents — for context isolation, parallel exploration, specialized capability, or scope reduction. Apply when designing how a parent agent spawns, briefs, monitors, and merges results from child agents. Covers fork-vs-fresh
telemetry-tracingUse when an agent harness needs operational visibility — token spend per turn/session, latency breakdown, tool-call success rates, and the ability to replay/debug a specific run. Apply when designing the observability layer for production agents. Covers span trees (turn → tool-call → subagent), toke
tool-sandboxingUse when LLM-invoked tools execute code, touch the filesystem, or make network calls — and you need to bound their blast radius. Apply when designing the isolation boundary for tool execution in an agent harness. Covers filesystem jails, network egress controls, exec sandboxes (containers, gVisor, f
workspace-stateUse when an agent operates on a filesystem workspace and the harness must track which files have been read, edited, or moved — so tool calls can detect stale reads, prevent conflicting writes, and enforce read-before-edit invariants. Apply when designing the workspace/cwd state model. Covers file-st