Your First Convoy¶
This tutorial walks you through creating your first convoy with AI agents working on real tasks.
What You'll Build¶
By the end of this tutorial, you'll have:
- Created a convoy (a group of related tasks)
- Added tasks to the convoy
- Spawned AI agents to work on the tasks
- Monitored their progress
Prerequisites¶
- Brat and Grite installed (Installation)
- An AI engine configured (e.g., Claude Code, Aider)
- A project repository to work on
Step 1: Initialize the Repository¶
If you haven't already:
Step 2: Create a Convoy¶
A convoy is a group of related tasks. Create one:
This returns a convoy ID like convoy-abc123.
Step 3: Add Tasks¶
Add tasks to your convoy:
# Add a task targeting specific files
brat task add \
--convoy convoy-abc123 \
--title "Fix null pointer in user service" \
--paths src/services/user.rs
# Add another task
brat task add \
--convoy convoy-abc123 \
--title "Handle error case in login flow" \
--paths src/auth/login.rs
Step 4: View Status¶
Check what you've created:
You'll see output like:
Convoys:
convoy-abc123 "Bug fixes" (2 tasks)
Tasks:
task-def456 "Fix null pointer in user service" [queued]
task-ghi789 "Handle error case in login flow" [queued]
Step 5: Spawn Agents¶
Run the Witness to start agents working on tasks:
The Witness:
- Creates isolated git worktrees for each task
- Spawns your configured AI engine
- Provides the task context to the agent
Step 6: Monitor Progress¶
Watch tasks as agents work on them:
View live logs from a session:
Step 7: Review Results¶
When a task completes, the agent's changes are on a task branch. Review them:
Step 8: Merge with Refinery¶
The Refinery manages the merge queue:
This applies your configured merge policy (rebase, squash, or merge).
Using the Mayor (Alternative)¶
Instead of manually creating convoys and tasks, use the Mayor:
# Start the Mayor
brat mayor start
# Ask it to analyze and create tasks
brat mayor ask "Analyze src/ and create tasks for any bugs you find"
# The Mayor will create a convoy and tasks automatically
brat status
Troubleshooting¶
No tasks being picked up¶
Check that tasks are in queued status:
Agent not starting¶
Verify your engine is configured in .brat/config.toml:
Session crashed¶
View session details:
The Deacon cleans up crashed sessions automatically:
Next Steps¶
- Managing Convoys - Advanced convoy operations
- Workflow Templates - Reusable workflow patterns
- Configuration - Customize engine settings