-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
P2Medium priority - Backlog, when time permitsMedium priority - Backlog, when time permitseffort/lowSingle file or function, one responsibility, isolated changeSingle file or function, one responsibility, isolated changefeatureNew functionality (planned)New functionality (planned)fleetFleet/brain (Honryū) coordinationFleet/brain (Honryū) coordination
Description
Context
Currently when a worker agent stops, the shell hook forwards a [DONE] message to the honryu brain, which then decides whether the task was actually completed or needs more work. This adds latency and brain cognitive load.
Opportunity
Claude Code now supports type: "prompt" hooks — a single-turn LLM call that returns {ok: true/false, reason}. On Stop events, if ok: false, Claude continues working instead of stopping, with the reason fed back as context.
{
"Stop": [{
"hooks": [{
"type": "prompt",
"prompt": "The agent was assigned the following task:\n\n$TASK_CONTENT\n\nThe agent's last message was: $ARGUMENTS\n\nDid the agent fully complete the task? Return {\"ok\": false, \"reason\": \"what remains\"} if not done.",
"timeout": 30,
"statusMessage": "Verifying task completion..."
}]
}]
}Benefits
- Catches incomplete work before it reaches honryu brain
- Reduces brain workload (only truly completed tasks get forwarded)
- Agents self-correct without human intervention
- Uses
stop_hook_activeguard to prevent infinite loops (Claude Code sets this on re-entry)
Considerations
- The prompt hook has access to
last_assistant_messagein the input JSON — useful for evaluation stop_hook_active: trueis set when Claude is already continuing due to a Stop hook — must check this to avoid infinite loops- Cost: each Stop event triggers an LLM call (Haiku-level, ~30s timeout)
- Could also use
type: "agent"for deeper verification (50 turns, can Read/Grep files) - Need to inject the dropbox task content into the prompt somehow (env var or file read)
Files involved
crates/kild-core/src/sessions/integrations/claude.rs— settings patchingcrates/kild-core/src/sessions/dropbox.rs— dropbox protocol (task content)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Medium priority - Backlog, when time permitsMedium priority - Backlog, when time permitseffort/lowSingle file or function, one responsibility, isolated changeSingle file or function, one responsibility, isolated changefeatureNew functionality (planned)New functionality (planned)fleetFleet/brain (Honryū) coordinationFleet/brain (Honryū) coordination