Tasks
Tasks are the core unit of work in claustre. Each task represents a piece of work that Claude will execute in an isolated session. Tasks are configured with a prompt, a mode, delivery settings, and optional subtasks.
Creating a Task
From the TUI
Press n to open the task creation form. The form has seven
fields, navigated with Tab:
| Field | Type | Default | Description |
|---|---|---|---|
| Prompt | text | — | The full prompt Claude receives. This is the task description — what you want Claude to do. Multi-line, word-wrapped. Required for supervised and autonomous tasks; optional for exploration. |
| Mode | toggle | supervised |
How Claude runs the task. Toggle with
←/→ arrows. See
Task Modes below.
|
| Base | text | (default) |
PR target branch. The worktree is created from this branch, and PRs
target it. When empty, uses the project's default branch (usually
main). See Base and Branch.
|
| Branch | text | (auto) |
Git branch name for the worktree. When empty, claustre auto-generates
task/<slug>-<uuid>. Set this to reuse an
existing branch. See Base and Branch.
|
| Push | toggle | pr |
Delivery method. Toggle with
←/→ arrows. See
Push Mode.
|
| Loop | toggle | off | Review loop toggle. When on, claustre automatically monitors and implements PR review comments. See Review Loop. |
| Subtasks | list | (none) |
Ordered list of sub-steps. Press Enter to add,
d to delete, j/k to navigate.
See Subtasks.
|
Press Enter to create the task (status: pending).
Press Esc to save as draft for later editing.
From the CLI
claustre add-task my-app "Add login endpoint" \
-d "Create a POST /login endpoint with JWT auth" \
-m autonomous
The CLI supports -d (description/prompt) and -m
(mode). Other parameters (base, branch, push mode, review loop, subtasks)
are only configurable from the TUI form.
Task Modes
Supervised (default)
-
Claustre launches
claude '<prompt>'directly in an embedded PTY - The user drives the interaction — Claude responds, you review and guide
- One task at a time per session
- If the task has subtasks, Claude receives the first pending subtask's description as the prompt
Autonomous
-
Claustre launches
claustre feed-next --session-id Xin an embedded PTY -
feed-nextruns Claude as a blocking subprocess, then loops to chain the next pending autonomous task in the same project - Claude works through tasks sequentially without user intervention
- The prompt includes an autonomous suffix instructing Claude not to ask questions and to make its best judgment
- Rate limits are checked before starting each task
Exploration
-
Launches
claudeinteractively with no prompt - Intended for open-ended research and investigation — no specific deliverable required
- The user interacts freely with Claude in the embedded terminal
Base and Branch
Base and Branch are independent parameters that control different aspects of the git workflow:
| Parameter | Controls | Default | Example |
|---|---|---|---|
| Base | Which branch the worktree is created from, and which branch PRs target | Project's default branch (e.g. main) | release/v2.0, develop |
| Branch | The name of the new git branch for the worktree | Auto-generated: task/<slug>-<uuid> | fix/urgent-bug, feat/new-api |
When to set Base: Use this for hotfix or release workflows
where you need to branch from and PR against a non-default branch. For
example, setting base to release/v2.0 creates the worktree from
that release branch and tells Claude to target it for the PR.
When to set Branch: Use this to continue work on an existing
branch or to use a specific naming convention. When left empty, claustre
generates a branch name like task/add-user-auth-a1b2c3d4.
Example: A hotfix targeting a release branch:
- Base:
release/v2.0— worktree starts from this branch, PR targets it - Branch:
fix/urgent-bug— the new branch name - Result:
git worktree add -b fix/urgent-bug <path> origin/release/v2.0
Push Mode
Push mode controls how Claude delivers completed work:
| Mode | Behavior | Completion |
|---|---|---|
pr (default) |
Claude commits, pushes, and creates a pull request against the base
branch using gh pr create |
Stop hook detects PR → task moves to in_review.
Task completes when PR is merged (auto-detected) or user presses
r.
|
push | Claude commits and pushes directly (no PR creation) |
Task moves to done immediately after Claude finishes.
Faster workflow for trusted or automated changes.
|
Review Loop
When the Loop toggle is set to on, claustre
automatically monitors and implements PR review comments after the task
transitions to in_review:
-
A
claustre review-loopprocess spawns in a new pane in the session tab - It polls the PR for new review comments at a configurable interval (default: 120s)
- Claude evaluates each comment adversarially — accepting bug fixes, logic errors, security issues, and missing edge cases while rejecting nitpicks and style preferences
- Implements accepted changes, commits, and pushes
- Prints a summary table of accepted/rejected comments
- Repeats until the task is marked done or rate limits are hit
Review Loop Configuration
Customize the review loop in ~/.claustre/config.toml:
[review_loop]
poll_interval_secs = 60 # default: 120
# prompt = "Custom prompt" # replaces the built-in review prompt | Key | Default | Description |
|---|---|---|
poll_interval_secs | 120 | Seconds between PR comment checks |
prompt | (built-in) | Custom prompt for Claude when processing review comments. When omitted, uses the built-in prompt that evaluates comments adversarially. |
Subtasks
Tasks can be broken into ordered subtasks. Subtasks let you structure complex work into discrete steps that Claude works through sequentially.
Managing Subtasks
Subtasks can be added during task creation (field 7 in the form) or managed
later by pressing s on a selected task:
| Key | Action |
|---|---|
Enter | Add a new subtask or edit the selected one |
d | Delete the selected subtask |
j / k | Navigate up/down the subtask list |
Esc | Close the subtask panel |
How Subtasks Affect Prompts
In autonomous mode, feed-next includes all
subtasks as an ordered list in a single prompt:
# Task Title
Task description here...
## Steps
1. **Subtask 1 title**: Subtask 1 description
2. **Subtask 2 title**: Subtask 2 description
3. **Subtask 3 title**: Subtask 3 description
[autonomous instructions + completion instructions] Claude works through all steps in a single session.
In supervised mode, claustre launches Claude with the first pending subtask's description. The user works through subtasks one at a time.
Task Status Lifecycle
draft ──[edit]──> pending ──[launch]──> working ──[PR detected]──> in_review ──[PR merged]──> done
↑↓ │ │
interrupted conflict / ci_failed
↑ │
└──[user resumes]──┘ | Transition | Trigger | Where |
|---|---|---|
| draft → pending | User edits the task and presses Enter | TUI form |
| pending → working |
User presses l (launch), or feed-next picks
up next task
| session::create_session(),
main::run_feed_next() |
| working → in_review |
Stop hook detects a PR via gh pr view | main.rs SessionUpdate handler
|
| working ↔ interrupted | Claustre restarted while task was active; resumes when Stop hook fires | TUI restart detection, Stop hook |
| in_review → working | UserPromptSubmit hook detects user activity | main.rs SessionUpdate handler
|
| in_review → conflict |
PR merge poller detects merge conflicts via gh pr view | tui/app.rs poll |
| in_review → ci_failed | PR merge poller detects failed CI checks | tui/app.rs poll |
| in_review → done |
PR merge poller detects merge (auto), or user presses
r (manual)
| tui/app.rs |
| working → done |
Push mode: feed-next marks task done after Claude exits
| main::run_feed_next() |
| working → error | External/manual (no automatic trigger yet) | — |
Task Completion Flow
PR mode (default)
- Claude commits all changes and pushes the branch
-
Claude creates a pull request against the base branch using
gh pr create -
The Stop hook detects the PR and calls
claustre session-update --pr-url <URL> -
Claustre transitions the task to
in_reviewand sends a notification -
If review loop is enabled, a
claustre review-loopprocess spawns to handle review comments -
For autonomous tasks,
feed-nextauto-queues the next pending task
Push mode
- Claude commits all changes and pushes the branch
-
feed-nextdetects that Claude has finished and marks the taskdoneimmediately - No PR is created and no review phase occurs
PR Merge Auto-Completion
Every 15 seconds, the TUI checks all in_review tasks with a
pr_url. When a merge is detected via
gh pr view, the session is torn down and the task marked
done.
End-to-End Usage Guide
- Setup — Install claustre, run
claustre init, optionally add a globalCLAUDE.md - Register a project —
claustre add-project my-app /path/to/my-appor pressain the TUI - Launch dashboard —
claustre - Create tasks — Press
n, fill in the prompt, set the mode, and configure base/branch/push/loop as needed - Launch — Focus the task queue, select a pending
task, press
l - Monitor — The dashboard shows real-time status with indicators
- Review — When a PR opens, press
oto view it in the browser,rto mark the task done - Rate limits — The TUI pauses autonomous tasks when limits are hit and auto-resumes when the window clears
- Kill / teardown — Press
kto kill and reset a task,dto delete it - History and stats —
claustre stats <project>orclaustre export <project>
Autonomous Workflow Example
# Add a batch of autonomous tasks
claustre add-task my-app "Add user model" -d "Create User struct with..." -m autonomous
claustre add-task my-app "Add auth middleware" -d "Create JWT middleware..." -m autonomous
claustre add-task my-app "Add login endpoint" -d "Create POST /login..." -m autonomous
# Launch the first task from the TUI (press 'l')
# Claude will work through them sequentially, opening a PR for each
# You get a notification when each completes
# Press 'o' to review each PR, then 'r' to mark done Hotfix Workflow Example
# In the TUI, press 'n' to create a task:
# Prompt: "Fix the null pointer in UserService.get()"
# Mode: autonomous
# Base: release/v2.0 ← PR targets the release branch
# Branch: fix/null-pointer ← specific branch name
# Push: pr
# Loop: on ← auto-implement review comments