/goal hook fires "Goal Achieved" while TaskList tasks still pending/in_progress
Summary
The session-scoped /goal Stop hook fires a "Goal Achieved" notification mid-execution, even when the agent still has tracked tasks in pending / in_progress status via TaskCreate / TaskList. This produces user-visible confusion: the UI says the goal is achieved, but the agent reports the work isn't done.
Repro
- Start a long multi-step implementation in a single session.
/goal write plan, implement plan- Agent writes an 11-task plan via
writing-plansskill and starts executing throughsubagent-driven-development. - Tasks 1–8 land as commits. Tasks 9 (parity sweep), 10 (backtest validation), 11 (final verification + handoff) still tracked as
pending/in_progress. - UI surfaces "Goal Achieved" while the agent is still mid-execution.
- User asks "is this done?" — agent (correctly) answers "no, 3 tasks remain."
Expected
Either:
- The
/goalhook consultsTaskListand only fires when nopending/in_progressitems remain, OR - The notification text is clarified to indicate it's an advisory match against the natural-language condition, not a definitive completion check.
Actual
The hook appears to evaluate the natural-language goal condition against some loose heuristic (presence of plan + most impl commits) without consulting the structured task tracker. Result: false-positive "achieved" while tracked work remains.
Environment
- Claude Code CLI
- Model: claude-opus-4-7
- Long-running background session with 30+ subagent dispatches
- Goal text:
write plan, implement plan
Why it matters
Users rely on hook notifications as a signal of completion. A premature "achieved" undermines that signal and forces users to manually cross-check TaskList to know what's actually done.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗