Stop hooks with type: "agent" don't appear to fire

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Mar 27, 2026 · closed Mar 30, 2026

I configured a Stop hook with type: "agent" in settings.json to run a session-end review workflow. The config is accepted without error, but the agent doesn't seem to execute when the session ends (v2.1.85).

{
  "type": "agent",
  "prompt": "Review this session and store important findings.",
  "timeout": 120
}

Is type: "agent" supported for Stop hooks? The docs mention it but I can't get it to fire. Command-type Stop hooks work fine.

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/39184
  2. https://github.com/anthropics/claude-code/issues/26474
  3. https://github.com/anthropics/claude-code/issues/33125

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

yurukusa · 6 months ago

Use command-type instead of agent-type for Stop hooks — agent-type isn't supported for Stop events:

echo "Stop hook fired" >&2
exit 0
YonasValentin · 6 months ago

Closing as duplicate of #39184 — agent-type hooks error on all event types. Upvoted that issue instead.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.