Active /goal Stop hook overrides an explicit user redirect (interrupt + handoff request)
Summary
A session goal set via /goal installs a Stop hook that continued forcing the agent to do the task work itself after the user interrupted the goal turn and explicitly redirected the agent to hand the work off to a different agent. This defeated the purpose of the handoff and caused the agent to run substantial work in a long, near-context-limit session (higher hallucination risk) against the user's explicit instruction.
Steps to reproduce
- Set a goal:
/goal complete tasks X, Y, Z. This installs a session-scoped Stop hook. - Interrupt that turn and give a new explicit instruction: "commit the current work and write a handoff prompt for another agent to finish tasks X, Y, Z" (the user's stated reason for handing off was being near the context limit).
- The agent commits and writes the handoff prompt.
- On the stop attempt, the still-active
/goalStop hook fires, states the tasks are "not complete," and instructs the agent to keep working without asking the user. - The agent then performs the tasks itself — exactly what the user redirected it not to do.
Expected behavior
A recent, explicit user instruction — especially one that interrupts the goal turn and asks for a handoff — should take precedence over a still-active automated Stop hook. At minimum, when the agent detects the conflict it should stop and surface that the goal hook is still active (prompting /goal clear), rather than silently continuing the goal work.
Actual behavior
The agent acknowledged the conflict in its reasoning but followed the Stop hook over the user's explicit redirect, continuing to execute the tasks.
Impact
- Defeats the safety purpose of a handoff (avoiding context-limit / hallucination risk).
- Significant wasted tokens.
- Erodes user trust: an interrupt + an explicit "this is for another agent" was not honored.
Suggested fixes
- Treat a user interrupt of the goal turn (or an explicit handoff/stop request) as implicitly clearing or suspending the goal hook.
- When a Stop-hook condition conflicts with the latest explicit user instruction, have the agent stop and ask rather than auto-continue.
Environment
- Claude Code,
/goalfeature (session-scoped Stop hook) - Model: Claude Opus
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗