This guide explains what the Claude adapter is good at, where it is intentionally limited, and how to use it without treating it like a magical mystery box.
ClaudeCodeAdapter is the deployment adapter that turns loop runtime components into a Claude-compatible execution surface:
- Complexity-based activation
- Context externalization (messages/files/tool outputs/working memory)
- REPL-backed execution and structured output
- Memory query/store integration
- Mode-aware routing and cost accounting metadata
If orchestrator is the engine, the adapter is the transmission.
- Complex prompt triage
Input: A prompt that is broad, cross-file, security/architecture heavy, or explicitly thorough.
Expected behavior:
- Adapter activates RLM path.
- Complexity signals are attached to response metadata.
- Mode can auto-escalate (
fast->thorough) when strong signals are present.
- Context-rich execution without prompt bloat
Input: Messages + files + tool outputs + working memory.
Expected behavior:
- Context is externalized into REPL variables.
- Root prompt remains concise.
- Response shows context/memory usage metadata.
- Memory-assisted analysis
Input: Query plus prior facts/experience in memory store.
Expected behavior:
- Adapter performs bounded memory search.
- Results influence the execution summary.
- Metadata records memory query count and usage flags.
- Observe: ingest request context and memory hits
- Orient: classify complexity, extract active signals
- Decide: activate/skip RLM and choose execution mode
- Act: run REPL flow, emit answer + cost/trace metadata
Reference tests:
test_execute_e2e_incident_triage_ooda_flowtest_execute_e2e_fast_path_skip_with_context_noise
The adapter can:
- Produce deterministic activate/skip decisions for common query classes
- Preserve structured metadata about why it did what it did
- Integrate memory and context into execution without dumping raw context into one giant prompt
The adapter does not:
- Guarantee perfect complexity classification on every phrasing
- Replace policy gates or evidence capture
- Infer external truth it has not been given (still subject to model/runtime limits)
- Run infinite orchestration loops just because the prompt is dramatic
- Activation is heuristic
- Pattern-based scoring is transparent and fast.
- It can still miss edge phrasing. Use
force_activationwhen precision matters more than cost.
- Mode escalation is signal-driven
- Strong signals (
architecture_analysis,user_thorough, exhaustive search) push toward deeper modes. - If the user asks for speed (
quick,brief,only), fast-path behavior is favored.
- Memory search is bounded
- Adapter uses limited memory fetch size by design.
- If critical evidence is missing from memory, execution quality drops to whatever context still contains.
- Cost accounting is operational, not billing-grade finance
- Metadata is meant for engineering control and regression detection.
- It is not an invoice.
Run:
make claude-adapter-gateThis executes VG-CLAUDE-ADAPTER-E2E-001, which requires:
- Scenario tests pass
- At least 2 scenario tests execute (filter-drift guardrail)
Because "0 tests ran" is not a confidence strategy.
Escalate when:
- Incident triage is high-stakes and ambiguity is costly
- You need deeper proofs/contracts than adapter runtime summaries
- Consumer compatibility claims are changing (run full compatibility gates)
See also:
/Users/rand/src/loop/docs/internals/ooda-and-execution.md/Users/rand/src/loop/docs/developer-guide/quality-gates.md/Users/rand/src/loop/docs/troubleshooting/common-issues.md