Skip to content

Improve task state syncing to Claude hooks#55

Merged
bborn merged 1 commit intomainfrom
task/126-review-task-state-syncing-to-claudehooks
Jan 9, 2026
Merged

Improve task state syncing to Claude hooks#55
bborn merged 1 commit intomainfrom
task/126-review-task-state-syncing-to-claudehooks

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented Jan 9, 2026

Summary

  • Add PreToolUse and PostToolUse hooks for accurate task state tracking
  • Fix Stop hook handling to properly transition states
  • Ensure task is "blocked" when Claude needs input, "processing" when actively working

Changes

Added hooks:

  • PreToolUse: Fires before tool execution - ensures task is "processing" when Claude starts using a tool
  • PostToolUse: Fires after tool completion - confirms task stays "processing" while Claude processes results

Fixed Stop hook:

  • end_turn: Properly transitions to "blocked" when waiting for user input
  • tool_use: No longer incorrectly transitions state (now handled by PreToolUse/PostToolUse)

Test plan

  • Code compiles successfully
  • Existing tests pass (go test ./internal/executor/... ./internal/db/...)
  • Manual testing with actual Claude Code sessions to verify state transitions

🤖 Generated with Claude Code

Add PreToolUse and PostToolUse hooks for more accurate task state tracking:
- PreToolUse: Ensures task is "processing" when Claude starts using a tool
- PostToolUse: Confirms task stays "processing" after tool completion

Fix Stop hook handling:
- end_turn: Properly transitions to "blocked" when waiting for user input
- tool_use: No longer incorrectly transitions state (handled by PreToolUse)

This ensures:
- Task is "blocked" when Claude needs user input
- Task is "processing" when Claude is actively working with tools

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bborn bborn merged commit b22918b into main Jan 9, 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