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 - Keep branches fresh --
parsec syncrebases or merges the latest base branch into any worktree - 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. When called without a ticket, shows an interactive picker. Designed for cd $(parsec switch ...).
parsec switch [ticket]
# Direct switch
# Interactive picker (no argument)
# 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 sync [ticket]
Fetch the latest base branch and rebase (or merge) the worktree on top. Detects the current worktree automatically when no ticket is given.
parsec sync [ticket] [--all] [--strategy rebase|merge]
| Option | Description |
|---|---|
--all |
Sync all active worktrees |
--strategy |
rebase (default) or merge |
# Sync current worktree
)
# Sync a specific worktree
# Sync all worktrees at once
# Use merge instead of rebase
parsec open <ticket>
Open the associated PR/MR or ticket tracker page in your default browser. If the ticket has been shipped, opens the PR by default; otherwise opens the tracker page.
parsec open <ticket> [--pr] [--ticket-page]
| Option | Description |
|---|---|
--pr |
Force open the PR/MR page |
--ticket-page |
Force open the ticket tracker page |
# Open PR if shipped, otherwise ticket page
# Force open the Jira ticket
# Force open the PR
parsec pr-status [ticket]
Check the CI and review status of shipped PRs. Shows CI check results, review approvals, and merge state in a color-coded table.
parsec pr-status [ticket]
# Check a specific ticket's PR
# Check all shipped PRs
# JSON output
Requires: PARSEC_GITHUB_TOKEN (or GITHUB_TOKEN, GH_TOKEN)
parsec config
# Interactive setup wizard
# Show current configuration
# Output shell integration script
# Generate shell completions
# Install man page
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
Shell Completions
Generate tab-completion scripts for your shell:
# Zsh — add to ~/.zshrc
# Bash — add to ~/.bashrc
# Fish — add to ~/.config/fish/config.fish
|
# Other shells
Man Page
Install the man page so man parsec works:
# Man page installed to /usr/local/share/man/man1/parsec.1
# Custom directory
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