PR Creation¶
Claudio streamlines the process of creating pull requests from your backend instances' work.
Overview¶
When an instance completes its task, you can create a PR with: - AI-generated title and description - Automatic rebasing on the target branch - Reviewer assignment based on files changed - Custom labels and templates
Creating PRs¶
From the TUI¶
- Select the completed instance
- Press
xto stop - Choose "Create PR" when prompted
Or if auto_pr_on_stop is enabled, the PR is created automatically.
From the CLI¶
# Create PR for specific instance
claudio pr <instance-id>
# Create PR with options
claudio pr <instance-id> --draft
claudio pr <instance-id> --no-ai
Automatic PR Creation¶
Enable auto-PR on stop:
Now pressing x in the TUI automatically creates a PR.
The PR Workflow¶
When you create a PR, Claudio:
- Checks for changes - Verifies there are commits to push
- Rebases (if enabled) - Updates branch with latest main
- Pushes - Pushes the branch to remote
- Generates content (if enabled) - Uses the configured backend to create title/description
- Creates PR - Opens the PR via
ghCLI - Assigns reviewers - Based on config and files changed
- Adds labels - Applies configured labels
AI-Generated Content¶
When use_ai: true (default), the backend generates:
Title¶
A concise, descriptive title based on the changes:
Description¶
A structured summary including: - What was changed - Why it was changed - How to test
Example:
## Summary
Implements OAuth2 authentication flow using Google as the identity provider.
## Changes
- Added `src/auth/oauth.ts` - OAuth client configuration
- Added `src/routes/auth.ts` - Login/callback endpoints
- Updated `src/config.ts` - Added OAuth environment variables
- Added tests for auth flow
## Test Plan
1. Set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET
2. Navigate to /auth/login
3. Complete Google sign-in
4. Verify redirect back to app with session
Disabling AI¶
Without AI, you'll be prompted to enter the title and description manually.
Rebasing¶
By default, Claudio rebases your branch on main before creating the PR.
Why Rebase?¶
- Ensures your changes apply cleanly to latest main
- Reduces merge conflicts after PR creation
- Creates a cleaner commit history
Handling Rebase Conflicts¶
If conflicts occur during rebase:
- Claudio reports the conflict
- Navigate to the worktree:
.claudio/worktrees/<id>/ - Resolve conflicts manually
- Run
claudio pr <id>again
Disabling Auto-Rebase¶
Or per-PR:
Reviewer Assignment¶
Default Reviewers¶
Always assign certain reviewers:
Path-Based Reviewers¶
Assign reviewers based on which files changed:
pr:
reviewers:
by_path:
"src/api/**": [backend-team]
"src/frontend/**": [frontend-team]
"*.sql": [dba]
"Dockerfile": [devops]
"**/security/**": [security-team]
How Matching Works¶
- Get list of files changed in PR
- Match each file against glob patterns
- Collect all matching reviewers
- Deduplicate and add to PR
Labels¶
Add labels to all PRs:
Custom Templates¶
Use Go's text/template for custom PR bodies:
pr:
template: |
## Summary
{{.Summary}}
## Task
> {{.Task}}
## Files Changed
{{.Changes}}
## Testing Instructions
{{.Testing}}
---
Branch: `{{.Branch}}`
Available Variables¶
| Variable | Description |
|---|---|
{{.Summary}} | AI-generated summary of changes |
{{.Changes}} | Formatted list of changed files |
{{.Testing}} | AI-generated test plan |
{{.Branch}} | Branch name |
{{.Task}} | Original task description |
Template Functions¶
Standard Go template functions are available:
Draft PRs¶
Create PRs as drafts for work-in-progress:
Or per-PR:
CLI Options¶
claudio pr [instance-id] [flags]
Flags:
--draft Create as draft PR
--no-ai Skip AI-generated content
--no-rebase Skip rebasing on main
-h, --help Help for pr
Troubleshooting¶
"No changes to push"¶
The branch has no commits beyond main: - Check if the backend made changes: claudio status - View the diff: Press d in TUI - The instance may not have completed its work
"gh: command not found"¶
Install GitHub CLI:
"Rebase conflict"¶
- Go to worktree:
cd .claudio/worktrees/<id> - Check status:
git status - Resolve conflicts in listed files
- Complete rebase:
git rebase --continue - Try PR again:
claudio pr <id>
"Authentication failed"¶
Ensure gh is authenticated:
"Branch already exists on remote"¶
The branch was previously pushed:
# Force push (careful!)
claudio pr <id> --force
# Or delete remote branch first
git push origin --delete <branch-name>
claudio pr <id>
Best Practices¶
Write Clear Tasks¶
Good task descriptions lead to better PRs:
# Good - specific and clear
claudio add "Add rate limiting to /api/users endpoint with 100 req/min limit"
# Less helpful - vague
claudio add "Fix API performance"
Review Before PR¶
- Check diff with
din TUI - Review AI-generated content
- Edit if needed before creating PR
Use Draft PRs for WIP¶
Change to non-draft when ready for review.
Coordinate Overlapping Work¶
If instances touched the same files: 1. Check conflict view with c 2. Create PRs in order 3. Each subsequent PR rebases on updated main