Claude code hooks not setup correctly
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #2917 by @worktrunk-bot — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 25/100
Research direction
Start with hooks/hooks.json and trace how its Claude Code events drive the 🤖/💬 markers shown by wt list. Check the linked pull request (#2917) and the issue discussion before making changes, since work has already been proposed. Done means the markers distinguish active work from waiting as described, without treating a finished subagent as an idle main agent.
Written by the indexing model from the issue text.
Description
Sometimes the 🤖/💬 markers report incorrect status.
This is mostly Claude's own analysis, slightly edited:
The plugin (hooks/hooks.json) drives the 🤖/💬 markers in wt list entirely from three Claude Code events:
│ Claude Code event │ Action │ Fires when │
│ UserPromptSubmit │ set 🤖 (working) │ you submit a new prompt │
│ Notification │ set 💬 (waiting) │ a permission prompt shows, or the session is idle 60s │
│ SessionEnd │ clear │ session ends │
Root cause of the stuck 💬
Nothing ever flips the marker back to 🤖 except a brand-new user prompt. The state machine is one-way:
- Notification fires mid-work — most commonly a tool-permission prompt ("Claude needs permission to use Bash"), but also the 60s idle ping.
- That sets 💬.
- You approve, the agent resumes and keeps working through a long tool sequence…
- …but no event resets 🤖. UserPromptSubmit only fires on a new human prompt, not on permission approval or continued tool use.
So any session that hit a permission/notification prompt and then kept working shows 💬 ("waiting") while actually working — exactly your two sessions. It's a missing transition, not unreliable hooks.
The fix
Add two hooks
│ Event │ Action │ Why │
│ PostToolUse │ set 🤖 │ re-asserts "working" after every tool — corrects a stale 💬 the moment work resumes (e.g. after a permission grant) │
│ Stop │ set 💬 │ the accurate "waiting for input" signal — fires exactly when the turn ends │
Net behavior: 💬 correctly shows only while genuinely blocked (permission prompt wait, or turn finished). The instant a tool runs again, it returns to 🤖. I'd deliberately not hook SubagentStop (subagent finishing doesn't mean the main agent is idle).
- Dominant language
- Rust
- Stars
- 8.8k
- Forks
- 315
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 204
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from max-sixty/worktrunk
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
max-sixty/worktrunk#4727 · 7 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
max-sixty/worktrunk#4260 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
max-sixty/worktrunk#3847 · 1 comment ·
Maintainers usually reply within 1 day
-
`wt step` confusionOpen
Difficulty 5/5 Over a week Newbie friendliness 28/100
max-sixty/worktrunk#4728 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
max-sixty/worktrunk#4718 · 1 comment ·
Maintainers usually reply within 1 day
All issues in max-sixty/worktrunk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
n0-computer/iroh#4669 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rubys/roundhouse#1950 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
cloudflare/workers-rs#1130 ·
Maintainers usually reply within 11 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
vfarcic/dot-agent-deck#2160 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
RustCrypto/utils#1597 ·
Maintainers usually reply within 1 day