Overview
Jean automates Git worktree management, allowing you to work on multiple branches simultaneously without switching contexts. Each worktree gets its own directory, sessions, and terminal instances.Key Capabilities
Worktree Creation
Jean creates worktrees with a streamlined workflow: Automatic Setup:- Generates random workspace names (e.g., “fuzzy-tiger”)
- Creates matching Git branch
- Sets up directory structure
- Runs optional setup scripts
- Creates initial base session
- Manual Creation - New branch from base
- From GitHub Issue - Automatically investigates issue and creates context
- From Pull Request - Checks out PR branch as worktree
- From Workflow Failure - Investigates failed CI run
Worktree Types
Worktree Sessions - Feature branches:Background Operations
Worktree creation and deletion happen asynchronously: Creation Flow:- User initiates worktree creation
- Pending worktree created with
status: 'pending' - Background task runs:
- Pull base branch (if auto-pull enabled)
- Create Git worktree
- Run setup script (if configured)
- Emit completion event
- Status updates to
readyorerror
src/types/projects.ts):
Setup Scripts
Automate environment setup when creating worktrees: Configuration:- Stored in project settings (
setup_scriptfield) - Runs after Git worktree creation
- Output captured and stored
- Success/failure tracked
Archiving & Restoration
Safely archive worktrees without permanent deletion: Archive behavior:- Worktree marked with
archived_attimestamp - Hidden from main view, visible in Archive modal
- Git directory and all files remain intact
- Sessions and data preserved
- Can be restored at any time
- When PR is merged (if
auto_archive_on_pr_mergedenabled) - Triggered by GitHub webhook or polling detection
- Configurable in Settings → Worktrees
- Open Archive modal (Cmd/Ctrl + Shift + A)
- Click “Restore” on archived worktree
- Worktree returns to active view
- All sessions and state preserved
- Archives are cleaned up based on retention policy
- Default: 7 days (configurable in Settings)
- Can manually delete from Archive modal
- Irreversible - removes Git directory and all data
Path Conflict Resolution
Jean handles scenarios where worktree paths already exist: Conflict detection:- Restore archived worktree - If path matches archived one
- Use suggested name - Automatically incremented (e.g.,
fuzzy-tiger-2) - Cancel - Abort worktree creation
Branch Conflict Resolution
Similar handling for existing branch names:How to Use
Creating a Worktree
From project view:- Click ”+” next to project name
- Select “New Worktree”
- Worktree creates in background
- Status indicator shows progress
- Opens automatically when ready
- Open GitHub integration panel
- Browse issues list
- Click “Investigate” on any issue
- Jean creates worktree and loads issue context
- AI analyzes issue and proposes solution
- Find PR in GitHub integration
- Click “Checkout PR”
- Creates worktree on PR’s branch
- Loads PR context, reviews, and comments
Managing Worktrees
View all worktrees:- Listed under each project in sidebar
- Shows status badges (CI, PR, uncommitted changes)
- Color-coded labels
- Last opened timestamp
- Click any worktree in sidebar
- Recent worktrees appear at top
- Each has independent sessions and state
- Right-click for context menu
- Open in terminal
- Open in editor (Zed, VS Code, Cursor, etc.)
- View in Finder
- Archive or delete
Archiving Workflow
Manual archiving:- Right-click worktree → Archive
- Confirmation dialog appears (if enabled)
- Worktree moves to archive
- Badge shows archived status
- Press Cmd/Ctrl + Shift + A
- Archives listed by project
- Search and filter options
- Shows age and retention countdown
- Find archived worktree
- Click “Restore”
- Returns to active worktrees
- All data intact and ready to use
Cleanup & Deletion
Permanent deletion:- Right-click → Delete (or from Archive modal)
- Confirmation dialog with warning
- Runs teardown script if configured
- Removes Git worktree
- Deletes directory and all files
- Removes from Jean database
- Archived worktrees deleted after retention period
- Runs daily cleanup check
- Logs cleanup actions
- No recovery possible after deletion
Configuration Options
Settings → Worktrees
Worktree Behavior:auto_pull_base_branch: Pull base before creating worktree (default: true)auto_archive_on_pr_merged: Archive when PR merges (default: true)archive_retention_days: Days before permanent deletion (default: 7)removal_behavior: “archive” or “delete” on close (default: delete)
confirm_session_close: Show confirmation before closing (default: true)
Per-Project Settings
Worktrees Location:- Custom base directory
- Browse to select location
- Reset to default (~/jean)
- Bash script to run on creation
- Can use project-specific commands
- Output displayed in UI
Best Practices
Worktree Naming
Random names are intentional:- Avoid ambiguous names like “feature” or “fix”
- Memorable animal/adjective combinations
- Easy to reference in conversation
- Branch names match worktree names
- Reduces cognitive load
- Prevents naming conflicts
- Focuses on work, not naming things
Setup Scripts
Keep scripts idempotent:- Don’t install global tools
- Assume Git and language runtimes present
- Keep execution time under 2 minutes
Archive Management
Choose retention period based on workflow:- 7 days: Fast-moving teams, many PRs
- 14 days: Standard development cycles
- 30 days: Slow review process, external dependencies
- Never: Manual cleanup only (use with caution)
- Archive: Safe default, can undo mistakes
- Delete: Saves disk space, requires more care
Disk Space Management
Monitor worktree growth:- Each worktree is a full Git checkout
- Build artifacts (
node_modules,target/, etc.) multiply storage - Clean up unused worktrees regularly
- Use custom locations to spread across drives
- Small project (5 MB repo): ~50 MB per worktree
- Medium project (50 MB repo): ~500 MB per worktree
- Large project (500 MB repo + deps): ~5 GB per worktree
Conflict Resolution
When paths conflict:- Check if it’s an archived worktree first
- Restore if you want to continue that work
- Use suggested name for new work
- Clean up archives if running out of names
- Likely a remote branch already exists
- Use suggested name for new branch
- Or delete remote branch if no longer needed
- Pull requests preserve issue context automatically