TaskCreated and TaskCompleted Hooks - Claude Code
Fire on task lifecycle events.
TaskCreated and TaskCompleted hooks plug into the session's task-list events - when Claude adds work to do or checks something off.
What it does
TaskCreated fires when Claude writes a new task to the list. TaskCompleted fires when one is finished. Hooks can log task activity, sync the list to an external issue tracker, trigger notifications, or gate on approvals before a task is considered done.
When to use it
- Syncing the task list to Linear, GitHub Projects, or Jira.
- Alerting a reviewer when a sensitive task completes.
- Generating a daily digest of work Claude actually finished.
- Enforcing team conventions around task granularity.
Gotchas
- Don't block TaskCompleted with a heavy external sync - it delays every turn.
- If you sync to an external system, handle dedup. Task IDs can change across sessions.
- Very short tasks create a lot of events. Consider batching.
Official docs: https://code.claude.com/docs/en/hooks.md#taskcreated
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Was this helpful?




