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.

What is parsec?
parsec is a command-line tool (CLI) that automates the full lifecycle of git worktrees: create an isolated workspace from a ticket ID, work in parallel without lock conflicts, then push + create PR + clean up in one command. It integrates with Jira, GitHub Issues, and GitLab Issues for automatic ticket title lookup, and supports GitHub and GitLab for PR/MR creation.
Unlike plain git worktree, parsec tracks workspace state, detects file conflicts across worktrees, provides operation history with undo, supports stacked PRs, and offers CI status monitoring — all from a single CLI.
Key use cases:
- Run multiple AI coding agents on the same repo simultaneously (no
index.lockconflicts) - Work on several tickets in parallel as a developer without stashing or switching branches
- Ship complete features (push + PR + cleanup) with one command
- Monitor CI, merge PRs, and manage stacked dependencies from the terminal
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 - Attach to existing branches -- Start a workspace from an existing local or remote branch with
--branch - 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
- Stacked PRs -- Create dependent PR chains with
--onand sync the entire stack - Sprint board view -- See the active sprint as a Kanban board with
parsec board
Why AI-Native?
Traditional AI agents waste tokens calling raw APIs. Each Jira or GitHub API call costs dozens of tokens for auth setup, pagination, and response parsing. parsec packages git + tracker operations into single commands with structured output.
Before: Raw API Calls
# Agent needs: sprint tickets + status + worktree info + PR status
# Step 1: Authenticate with Jira API
# Step 2: Find active sprint (GET /rest/agile/1.0/board/{id}/sprint?state=active)
# Step 3: Fetch sprint issues (GET /rest/agile/1.0/sprint/{id}/issue)
# Step 4: For each ticket, check local worktrees (git worktree list, parse output)
# Step 5: For each ticket, check PR status (GitHub API)
# → 5+ API calls, 100+ tokens, custom parsing logic
After: One parsec Command
# → Sprint + status-grouped tickets + worktree/PR flags in one structured JSON
Key Benefits for AI Agents
| Capability | What it means |
|---|---|
--json on every command |
Structured output AI can parse instantly |
parsec start |
git worktree + Jira fetch + state management in one call |
parsec board --json |
Sprint + tickets + worktree/PR status in one call |
parsec ship |
Push + PR creation + cleanup in one call |
| Env var defaults | Zero-arg commands after one-time setup |
| Conflict detection | AI agents can check before parallel edits |
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"] [--on <parent-ticket>] [--branch <name>]
| Option | Description |
|---|---|
-b, --base <branch> |
Base branch to create from (default: main/master) |
--title "text" |
Set ticket title manually, skip tracker lookup |
--on <ticket> |
Stack on another ticket's branch (for dependent PRs) |
--branch <name> |
Use an existing branch instead of creating a new one |
# With Jira integration (title auto-fetched)
# With manual title
# From a specific base branch
# Attach to an existing branch (local or remote)
# Attach to a remote-only branch (auto-fetches and tracks)
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 ticket [ticket]
View ticket details from the configured tracker. Auto-detects the ticket from the current worktree if no argument is given.
parsec ticket [ticket]
# Auto-detect from current worktree
# Explicit ticket
# JSON output
}
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] [--base <branch>]
| Option | Description |
|---|---|
--draft |
Create the PR/MR as a draft |
--no-pr |
Push only, skip PR/MR creation |
--base <branch> |
Target base branch for PR (overrides config default_base and worktree base) |
# 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 ci [ticket] [--watch] [--all]
Check CI/CD pipeline status for a ticket's PR. Shows individual check runs with status, duration, and an overall summary.
parsec ci [ticket] [--watch] [--all]
| Option | Description |
|---|---|
ticket |
Ticket identifier (auto-detects current worktree if omitted) |
--watch |
Poll CI every 5s until all checks complete |
--all |
Show CI for all shipped PRs |
# Auto-detect from current worktree
# Check a specific ticket
# Watch mode — refreshes every 5s until done
# All shipped PRs
# JSON output
Requires: PARSEC_GITHUB_TOKEN (or GITHUB_TOKEN, GH_TOKEN)
parsec merge [ticket] [--rebase] [--no-wait] [--no-delete-branch]
Merge a ticket's PR directly from the terminal. Waits for CI to pass before merging, then cleans up the local worktree.
parsec merge [ticket] [--rebase] [--no-wait] [--no-delete-branch]
| Option | Description |
|---|---|
ticket |
Ticket identifier (auto-detects current worktree if omitted) |
--rebase |
Use rebase merge instead of squash (default: squash) |
--no-wait |
Skip CI check before merging |
--no-delete-branch |
Keep remote branch after merge |
# Squash merge (default)
# Rebase merge
# Skip CI wait
# JSON output
Requires: PARSEC_GITHUB_TOKEN (or GITHUB_TOKEN, GH_TOKEN)
parsec diff [ticket] [--stat] [--name-only]
View changes in a worktree compared to its base branch. Uses merge-base for accurate comparison.
parsec diff [ticket] [--stat] [--name-only]
| Option | Description |
|---|---|
ticket |
Ticket identifier (auto-detects current worktree if omitted) |
--stat |
Show file-level summary only |
--name-only |
List changed file names only |
# Full diff for current worktree
# File summary
# Just file names
# JSON output (changed files list)
parsec stack [--sync]
View and manage stacked PR dependencies. Worktrees created with --on form a dependency chain.
parsec stack [--sync]
| Option | Description |
|---|---|
--sync |
Rebase the entire stack chain |
# Create a stack
# View the dependency graph
# Sync the entire stack
# Ship creates PRs with correct base branches
parsec board
Show the active sprint as a vertical board view. Fetches tickets from Jira grouped by status column, with worktree and PR indicators.
parsec board [--project <KEY>] [--board-id <ID>] [--assignee <name>] [--all]
| Option | Description |
|---|---|
-p, --project <KEY> |
Jira project key (default from env/config) |
--board-id <ID> |
Jira board ID (auto-detected from project) |
--assignee <name> |
Filter by assignee (default from env/config) |
--all |
Show all tickets (ignore assignee filter) |
# Show your tickets (with PARSEC_JIRA_ASSIGNEE configured)
)
)
# Show all team tickets
# JSON output for AI agents
}}}
Defaults can be set via environment variables or config file (see below).
parsec config
# Interactive setup wizard
# Show current configuration
# default_base = "develop" # Target branch for PRs (default: worktree base)
# 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
# project = "CL" # Default project for board
# board_id = 123 # Default board ID
# assignee = "eric.signal" # Default assignee filter
[]
= "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"]
[]
# on_start = "In Progress" # Transition when `parsec start` runs
# on_ship = "In Review" # Transition when `parsec ship` runs
# on_merge = "Done" # Transition when `parsec merge` runs
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 |
PARSEC_JIRA_PROJECT |
Default Jira project key for board |
PARSEC_JIRA_BOARD_ID |
Default Jira board ID for board |
PARSEC_JIRA_ASSIGNEE |
Default assignee filter for board |
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 (worktrees) | 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 | GitHub | No | GitHub, GitLab, Gitea, Bitbucket |
| Operation history + undo | Yes | Yes | No | No | Yes (undo) |
| JSON output | Yes | Yes | No | No | No |
| CI monitoring | Yes (--watch) | No | No | No | No |
| Stacked PRs | Yes | Yes | No | No | Yes |
| Auto-cleanup merged | Yes | No | No | Manual | No |
| Post-create hooks | Yes | No | Yes | No | No |
| AI token efficiency | Single-command ops | N/A | N/A | N/A | N/A |
| GUI | CLI only | Desktop + TUI | CLI | CLI | CLI |
| Zero config start | Yes | No | Yes | No | No |
License
MIT