git-parsec
Git worktree lifecycle manager for parallel AI agent workflows
parsec manages isolated git worktrees tied to tickets (Jira, GitHub Issues), enabling multiple AI agents or developers to work on the same repository in parallel without lock conflicts.

The Problem
Git uses a single working directory with a single index.lock. When multiple AI agents (or developers) try to work on the same repo simultaneously:
git add/commitoperations collide on.git/index.lock- Context switching between tasks requires stashing or committing WIP
- Worktrees exist but have poor lifecycle management
- No connection between tickets and working directories
The Solution
# Create isolated workspaces for two tickets
# See all active workspaces
# Check if any workspaces touch the same files
# Complete: push, create PR, and clean up in one step
# Remove all remaining workspaces
)
Features
- Ticket-driven workspaces -- Create worktrees named after Jira/GitHub Issues tickets
- Zero-conflict parallelism -- Each workspace has its own index, no lock contention
- Conflict detection -- Warns when multiple workspaces modify the same files
- One-step shipping --
parsec shippushes, creates a GitHub PR or GitLab MR, and cleans up - Adopt existing branches -- Import branches already in progress with
parsec adopt - Operation history and undo --
parsec logshows what happened,parsec undoreverts it - Agent-friendly output --
--jsonflag on every command for machine consumption - Status dashboard -- See all parallel work at a glance
- Auto-cleanup -- Remove worktrees for merged branches automatically
- GitHub and GitLab -- PR and MR creation for both platforms
Installation
Or build from source:
# Binary at ./target/release/parsec
Quick Start
# 1. (Optional) Run interactive setup
# 2. Start work on a ticket
# 3. Switch into the workspace
# 4. Work, commit as normal...
&&
# 5. Start a second ticket in parallel
# 6. Check for file conflicts across workspaces
# 7. Ship when done
# 8. See what happened
Commands
parsec start <ticket>
Create an isolated worktree for a ticket. Fetches the ticket title from your configured tracker (Jira, GitHub Issues) or accepts a manual title.
parsec start <ticket> [--base <branch>] [--title "text"]
| Option | Description |
|---|---|
-b, --base <branch> |
Base branch to create from (default: main/master) |
--title "text" |
Set ticket title manually, skip tracker lookup |
# With Jira integration (title auto-fetched)
# With manual title
# From a specific base branch
parsec adopt <ticket>
Import an existing branch into parsec management. Useful when you started work before using parsec, or when taking over someone else's branch.
parsec adopt <ticket> [--branch <name>] [--title "text"]
| Option | Description |
|---|---|
-b, --branch <name> |
Branch to adopt (default: <prefix><ticket>) |
--title "text" |
Set ticket title manually |
# Adopt a branch matching the default prefix
# Adopt a branch with a different name
parsec list
List all active parsec-managed worktrees.
parsec list
}
parsec status [ticket]
Show detailed status of a workspace. Shows all workspaces if no ticket is specified.
parsec status [ticket]
parsec ship <ticket>
Push the branch, create a PR (GitHub) or MR (GitLab), and clean up the worktree. The forge is auto-detected from the remote URL.
parsec ship <ticket> [--draft] [--no-pr]
| Option | Description |
|---|---|
--draft |
Create the PR/MR as a draft |
--no-pr |
Push only, skip PR/MR creation |
# Push + PR + cleanup
# Draft PR
# Push only, no PR
Token required: set PARSEC_GITHUB_TOKEN (or GITHUB_TOKEN, GH_TOKEN) for GitHub, or PARSEC_GITLAB_TOKEN (or GITLAB_TOKEN) for GitLab.
parsec clean
Remove worktrees whose branches have been merged. Use --all to remove everything.
parsec clean [--all] [--dry-run]
| Option | Description |
|---|---|
--all |
Remove all worktrees, including unmerged |
--dry-run |
Preview what would be removed |
# Preview first
)
# Remove merged worktrees
)
# Remove everything
)
parsec conflicts
Detect files modified in more than one active worktree. Workspaces with no changes are skipped.
parsec conflicts
# No conflicts
# Conflicts found
parsec switch <ticket>
Print the absolute path to a ticket's worktree. Designed for cd $(parsec switch ...).
parsec switch <ticket>
# Use with cd
parsec log [ticket]
Show the history of parsec operations. Each mutating command (start, adopt, ship, clean, undo) is recorded with a timestamp.
parsec log [ticket] [-n, --last N]
| Option | Description |
|---|---|
[ticket] |
Filter to a specific ticket |
-n, --last N |
Show last N entries (default: 20) |
# Filter by ticket
# Last 3 entries only
parsec undo
Undo the last parsec operation.
- Undo
startoradopt: removes the worktree and deletes the branch - Undo
shiporclean: re-creates the worktree from the branch (if still available locally or on remote)
parsec undo [--dry-run]
| Option | Description |
|---|---|
--dry-run |
Preview what would be undone |
# Preview
# Execute
# Nothing to undo
parsec config
# Interactive setup wizard
# Show current configuration
# Output shell integration script
Global Flags
These flags work on every command:
| Flag | Description |
|---|---|
--json |
Machine-readable JSON output |
-q, --quiet |
Suppress non-essential output |
--repo <path> |
Target a different repository |
Shell Integration
parsec switch prints a path but cannot cd for you. The shell integration wraps parsec switch so it changes your directory automatically:
# Add to ~/.zshrc
# Or for bash, add to ~/.bashrc
After sourcing, parsec switch <ticket> will cd into the worktree directly:
# Now you're in /home/user/myapp.PROJ-1234
Configuration
Config file: ~/.config/parsec/config.toml
[]
# "sibling" (default) creates worktrees next to repo: ../repo.ticket/
# "internal" creates inside repo: .parsec/workspaces/ticket/
= "sibling"
= ".parsec/workspaces"
= "feature/"
[]
# "jira" | "github" | "gitlab" | "none"
= "jira"
[]
= "https://yourcompany.atlassian.net"
# Auth: PARSEC_JIRA_TOKEN or JIRA_PAT env var
[]
= "https://gitlab.com"
# Auth: PARSEC_GITLAB_TOKEN env var
[]
= true # Create PR/MR on ship
= true # Remove worktree after ship
= false # Create PRs as drafts
[]
# Commands to run in new worktrees after creation
= ["npm install"]
Environment Variables
| Variable | Description |
|---|---|
PARSEC_JIRA_TOKEN |
Jira API token (or personal access token) |
JIRA_PAT |
Alternative Jira token variable |
JIRA_BASE_URL |
Jira URL (overrides config) |
PARSEC_GITHUB_TOKEN |
GitHub token for PR creation |
GITHUB_TOKEN |
Fallback GitHub token |
GH_TOKEN |
Fallback GitHub token |
PARSEC_GITLAB_TOKEN |
GitLab token for MR creation |
GITLAB_TOKEN |
Fallback GitLab token |
Token priority: PARSEC_*_TOKEN > platform-specific variables.
Comparison with Alternatives
| Feature | parsec | GitButler | worktrunk | git worktree | git-town |
|---|---|---|---|---|---|
| Ticket tracker integration | Jira + GitHub Issues | No | No | No | No |
| Physical isolation | Yes (worktrees) | No (virtual branches) | Yes | Yes | No |
| Conflict detection | Cross-worktree | N/A | No | No | No |
| One-step ship (push+PR+clean) | Yes | No | No | No | Yes |
| GitHub + GitLab | Both | Both | No | No | No |
| Operation history + undo | Yes | Yes | No | No | No |
| JSON output | Yes | Yes | Yes | No | No |
| Auto-cleanup merged | Yes | No | Yes | Manual | No |
| GUI | CLI only | Desktop + TUI | CLI | CLI | CLI |
| Zero config start | Yes | No | Yes | No | No |
License
MIT