Problem
The coding Agent chat has TWO explicit buttons — Send (always relays to Claude Code, expensive + side-effecting) and Status (always answers from context, cheap, read-only). That split is clunky: users shouldn't have to pre-classify their own message.
Approach (researched best practice)
Collapse to ONE chat backed by a single cheap co-pilot LLM running a tool-calling loop with three tools:
answer_from_context — default; it already holds the terminal + recent history.
search_history(query) — vector/semantic search over coding_timeline, on-demand (only when the question reaches past the in-window history). Not always-on context.
drive_claude(instruction) — the expensive, side-effecting delegation to Claude Code (the existing /message path); its "result" streams back into the same thread.
The LLM decides per message. No code words, no separate intent-classifier (only justified at hundreds of tools). This is the orchestrator-worker pattern Anthropic recommends for coding.
Prompt disposition: context-first, delegate on action — anything that changes files / runs commands / needs live repo state → drive_claude; otherwise describe from context.
Scope
- Backend: turn
/explain (or a new /agent) into a tool-calling loop (reuse BYOK Claude + the tool-loop machinery from the apply pipeline); add drive_claude (→ /coding/act) and search_history (→ coding_timeline + vectors) tools.
- Frontend: fold Send + Status into one input; keep a thin
/run or @claude override to force delegation.
Guard against
- Under-delegation (cheap LLM answers a question it should have delegated) → hard prompt rule on action intent.
- Over-delegation (wastes Claude on a status question) → make context-answer first-class.
- Loop thrash → cap rounds + dedup identical tool calls (reuse existing 3-round cap).
Acceptance
- One chat input. Typing "what's it doing?" answers from context; "add a test" drives Claude.
@claude <x> always delegates. No double LLM cost on pure status questions.
Problem
The coding Agent chat has TWO explicit buttons — Send (always relays to Claude Code, expensive + side-effecting) and Status (always answers from context, cheap, read-only). That split is clunky: users shouldn't have to pre-classify their own message.
Approach (researched best practice)
Collapse to ONE chat backed by a single cheap co-pilot LLM running a tool-calling loop with three tools:
answer_from_context— default; it already holds the terminal + recent history.search_history(query)— vector/semantic search overcoding_timeline, on-demand (only when the question reaches past the in-window history). Not always-on context.drive_claude(instruction)— the expensive, side-effecting delegation to Claude Code (the existing/messagepath); its "result" streams back into the same thread.The LLM decides per message. No code words, no separate intent-classifier (only justified at hundreds of tools). This is the orchestrator-worker pattern Anthropic recommends for coding.
Prompt disposition: context-first, delegate on action — anything that changes files / runs commands / needs live repo state →
drive_claude; otherwise describe from context.Scope
/explain(or a new/agent) into a tool-calling loop (reuse BYOK Claude + the tool-loop machinery from the apply pipeline); adddrive_claude(→/coding/act) andsearch_history(→coding_timeline+ vectors) tools./runor@claudeoverride to force delegation.Guard against
Acceptance
@claude <x>always delegates. No double LLM cost on pure status questions.