Skip to content

fix: only manage Claude task status after task has started#94

Merged
bborn merged 1 commit intomainfrom
task/177-idle-claudes-status-handling
Jan 10, 2026
Merged

fix: only manage Claude task status after task has started#94
bborn merged 1 commit intomainfrom
task/177-idle-claudes-status-handling

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented Jan 10, 2026

Summary

  • Add StartedAt check to all Claude hook handlers to ensure status transitions only occur for tasks that have actually started executing
  • This prevents incorrect status changes for tasks that are new or in backlog/queued states
  • Fixes issue where idle Claude sessions could incorrectly update status on tasks that haven't started yet

Test plan

  • Added 8 new tests covering all hook handlers:
    • NotificationHook ignores unstarted tasks
    • NotificationHook changes status for started tasks
    • StopHook ignores unstarted tasks
    • StopHook changes status for started tasks
    • PreToolUseHook ignores unstarted tasks
    • PreToolUseHook resumes started tasks
    • PostToolUseHook ignores unstarted tasks
    • StopHook with tool_use does not change status
  • All existing tests pass

🤖 Generated with Claude Code

Add StartedAt check to all Claude hook handlers to ensure status
transitions only occur for tasks that have actually started executing.
This prevents status changes for tasks that are new or in backlog/queued.

Changes:
- handleNotificationHook: Check StartedAt before processing→blocked
- handleStopHook: Check StartedAt before end_turn→blocked
- handlePreToolUseHook: Check StartedAt before blocked→processing
- handlePostToolUseHook: Check StartedAt before blocked→processing

Also adds comprehensive tests for the hook status handling logic.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bborn bborn merged commit 1fc68b2 into main Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant