Skip to content

Active /goal Stop hook overrides an explicit user redirect (interrupt + handoff request) #65416

Description

@kwandoletcher

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

  1. Set a goal: /goal complete tasks X, Y, Z. This installs a session-scoped Stop hook.
  2. 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).
  3. The agent commits and writes the handoff prompt.
  4. On the stop attempt, the still-active /goal Stop hook fires, states the tasks are "not complete," and instructs the agent to keep working without asking the user.
  5. 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, /goal feature (session-scoped Stop hook)
  • Model: Claude Opus

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions