Task Workflow
Understanding the Claudear task lifecycle
Task Workflow
Claudear manages tasks through a state machine that mirrors your project management workflow. Understanding this lifecycle helps you work effectively with automated development.
State Machine
PENDING → IN_PROGRESS ⟷ BLOCKED → FAILED
↓
COMPLETED → IN_REVIEW → DONE
States
| State | Linear State | Notion Status | Description |
|---|---|---|---|
PENDING | Todo | ToDo | Task picked up, waiting to start |
IN_PROGRESS | In Progress | In Progress | Claude is actively working |
BLOCKED | In Progress | In Progress | Claude needs human input |
COMPLETED | In Progress | In Progress | Work done, pushing code |
IN_REVIEW | In Review | In Review | PR created, awaiting review |
DONE | Done | Done | Merged and cleaned up |
FAILED | (varies) | (varies) | Task failed (terminal) |
Lifecycle Flow
1. Task Pickup (PENDING)
When you move a task to "Todo":
Linear:
- Webhook receives the state change event instantly
Notion:
- Poller detects the status change (within poll interval)
Then:
- Claudear verifies it's a Todo state
- Task record created in SQLite
- Task enters
PENDINGstate
2. Starting Work (IN_PROGRESS)
Claudear then:
- Creates a git worktree at
.worktrees/{identifier} - Creates branch
claudear/{identifier}(e.g.,claudear/ENG-123orclaudear/N-ABC123-001) - Updates task status to "In Progress"
- Starts Claude Code session with the task prompt
3. Working
Claude Code:
- Analyzes the task title and description
- Explores the codebase
- Implements the solution
- Writes/updates tests
- Commits changes
Real-time updates:
- Linear: Updates via label changes
- Notion: Updates "Current Status" property
4. Blocked (BLOCKED)
If Claude encounters an issue:
- Outputs
BLOCKED: [reason] - Claudear detects the blocked state
- Posts a comment asking for help
- Polls for new comments
- When you reply, Claude resumes
5. Completion (COMPLETED → IN_REVIEW)
When Claude outputs TASK_COMPLETE:
- Pushes branch to origin
- Creates PR via
gh pr create - Posts PR link to task
- Moves task to "In Review"
6. Merging (DONE)
When you move the task to "Done":
- PR is merged (if not already)
- Worktree is cleaned up
- Branch is optionally deleted
- Task marked as
DONE
Multi-Provider Considerations
Task Isolation
Each provider instance (team/database) has its own:
- Repository path
- WorktreeManager
- GitHubClient
Tasks from different instances never interfere with each other.
Branch Naming
Branches use the task identifier:
| Provider | Example Branch |
|---|---|
| Linear | claudear/ENG-123 |
| Notion | claudear/N-ABC123-001 |
Shared Resources
These are shared across all provider instances:
- Claude Code runner pool
- SQLite task store
- Webhook server (if Linear enabled)
Timeouts
| Situation | Default | Configuration |
|---|---|---|
| Blocked timeout | 1 hour | BLOCKED_TIMEOUT |
| Task stall detection | 5 minutes | Built-in |
Error Handling
If a task fails:
- Error is logged
- Task gets a comment with the error
- Task enters
FAILEDstate - Worktree is preserved for debugging
To retry a failed task:
- Fix the underlying issue
- Move the task back to "Backlog"
- Move it to "Todo" again