{"id":32499348,"url":"https://github.com/davedev42/claude-worktree","last_synced_at":"2026-02-16T08:12:45.865Z","repository":{"id":320153511,"uuid":"1080946075","full_name":"DaveDev42/claude-worktree","owner":"DaveDev42","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-22T09:12:56.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-22T09:14:32.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DaveDev42.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-22T05:03:37.000Z","updated_at":"2025-10-22T09:12:49.000Z","dependencies_parsed_at":"2025-10-22T09:14:35.873Z","dependency_job_id":"89279035-e947-416d-8cf2-4edfd264be4e","html_url":"https://github.com/DaveDev42/claude-worktree","commit_stats":null,"previous_names":["davedev42/claude-worktree"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/DaveDev42/claude-worktree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveDev42%2Fclaude-worktree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveDev42%2Fclaude-worktree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveDev42%2Fclaude-worktree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveDev42%2Fclaude-worktree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DaveDev42","download_url":"https://codeload.github.com/DaveDev42/claude-worktree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveDev42%2Fclaude-worktree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281295811,"owners_count":26476759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-27T15:51:50.734Z","updated_at":"2026-02-06T07:17:41.001Z","avatar_url":"https://github.com/DaveDev42.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Worktree\n\n\u003e Work on multiple git branches simultaneously with isolated AI coding sessions\n\n[![Tests](https://github.com/DaveDev42/claude-worktree/workflows/Tests/badge.svg)](https://github.com/DaveDev42/claude-worktree/actions)\n[![PyPI version](https://badge.fury.io/py/claude-worktree.svg)](https://pypi.org/project/claude-worktree/)\n[![Python versions](https://img.shields.io/pypi/pyversions/claude-worktree.svg)](https://pypi.org/project/claude-worktree/)\n[![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\n## What is this?\n\n**claude-worktree** (command: `cw`) helps you work on multiple features at the same time by creating separate directories for each branch. No more switching branches, stashing changes, or losing context.\n\nEach feature gets:\n- ✅ Its own directory (git worktree)\n- ✅ Its own AI coding session (Claude Code, Codex, Happy, or custom)\n- ✅ Zero interference with other work\n\nPerfect for developers who want to:\n- Work on multiple features in parallel\n- Keep AI conversation context for each feature\n- Never lose work when switching tasks\n- Cleanly merge features without conflicts\n\n## Why Use This?\n\n### No More Branch Switching Chaos\n\n**Before claude-worktree:**\n```bash\n# Working on feature-api\ngit add .\ngit stash  # Save current work\ngit checkout main\ngit checkout -b fix-urgent-bug\n# Fix bug, commit\ngit checkout feature-api\ngit stash pop  # Hope nothing conflicts\n# Where was I?\n```\n\n**With claude-worktree:**\n```bash\ncw new fix-urgent-bug\n# Fix bug in separate directory\ncw merge fix-urgent-bug --push\n# Return to feature-api - it's untouched\n```\n\nEach feature stays isolated, AI context is preserved, and switching is instant.\n\n### Lightning-Fast Workflow with Shell Completion\n\nTab completion makes everything faster:\n\n```bash\ncw \u003cTAB\u003e              # All commands appear\ncw new --\u003cTAB\u003e        # All options for 'new' command\ncw resume \u003cTAB\u003e       # Your branch names\ncw-cd \u003cTAB\u003e           # Jump to any worktree instantly\n```\n\nNo more typing long commands or remembering branch names - just type and press Tab.\n\n## Quick Start\n\n### Install\n\n```bash\n# Using uv (recommended)\nuv tool install claude-worktree\n\n# Or using pip\npip install claude-worktree\n```\n\n### Basic Usage\n\n```bash\n# 1. Create a new feature worktree\ncw new fix-login-bug\n\n# This creates:\n# - A new branch: fix-login-bug\n# - A new directory: ../myproject-fix-login-bug/\n# - Launches Claude Code in that directory\n\n# 2. Work on your feature\n# (AI helps you, you commit changes, etc.)\n\n# 3. When done, create a PR\ncw pr\n\n# Or merge directly (for solo projects)\ncw merge --push\n```\n\nThat's it! You've just created an isolated workspace with AI assistance, worked on your feature, and merged it back.\n\n## Key Features\n\n### Essential Commands\n\n| Command | What it does |\n|---------|-------------|\n| `cw new \u003cname\u003e` | Create new feature worktree + launch AI |\n| `cw new \u003cname\u003e --term i-t` | Create worktree, launch AI in iTerm tab |\n| `cw list` | Show all your worktrees |\n| `cw resume [branch]` | Resume AI session in a worktree |\n| `cw pr` | Create GitHub pull request |\n| `cw merge` | Merge to base branch and cleanup |\n| `cw delete \u003cname\u003e` | Remove a worktree |\n\n### Shell Completion \u0026 Navigation\n\n**Enable tab completion for faster workflow:**\n\n```bash\n# Install completion (bash/zsh/fish/PowerShell)\ncw --install-completion\n\n# Restart your shell, then enjoy:\ncw \u003cTAB\u003e          # Shows available commands\ncw new --\u003cTAB\u003e    # Shows available options\ncw resume \u003cTAB\u003e   # Shows branch names\n```\n\n**Windows PowerShell users:**\n```powershell\n# Install completion for PowerShell\ncw --install-completion powershell\n\n# Restart PowerShell, then use tab completion:\ncw \u003cTAB\u003e          # Shows available commands\ncw resume \u003cTAB\u003e   # Shows branch names\n```\n\n**Quick navigation between worktrees:**\n\n```bash\n# Interactive setup (recommended):\ncw shell-setup\n\n# Or install manually:\n# bash/zsh: Add to ~/.bashrc or ~/.zshrc\nsource \u003c(cw _shell-function bash)\n\n# fish: Add to ~/.config/fish/config.fish\ncw _shell-function fish | source\n\n# PowerShell: Add to $PROFILE\ncw _shell-function powershell | Invoke-Expression\n\n# Then use:\ncw-cd feature-api    # Jump to any worktree instantly\ncw-cd \u003cTAB\u003e          # Tab completion works!\n```\n\n## Example Workflow\n\n### Scenario: Working on multiple features\n\n```bash\n# Start 3 features at once\ncw new feature-api\ncw new fix-bug-123\ncw new refactor-db\n\n# Check what you have\ncw list\n#  BRANCH           STATUS    PATH\n#  main             clean     .\n#  feature-api      active    ../myproject-feature-api\n#  fix-bug-123      modified  ../myproject-fix-bug-123\n#  refactor-db      clean     ../myproject-refactor-db\n\n# Resume work on a specific feature\ncw resume fix-bug-123\n\n# Complete features as they're done\ncw pr feature-api        # Create PR\ncw merge fix-bug-123 --push  # Direct merge\n```\n\n### Scenario: Team collaboration\n\n```bash\n# Create feature and share\ncw new team-feature\ngit push -u origin team-feature\n\n# Stay in sync with team\ncw sync team-feature\n\n# Compare before merging\ncw diff main team-feature --summary\n\n# Create PR for review\ncw pr --title \"Add awesome feature\"\n```\n\n## Configuration\n\n### AI Tool Selection\n\nBy default, `cw` launches Claude Code. You can easily change this:\n\n```bash\n# Use a preset\ncw config use-preset claude         # Claude Code (default)\ncw config use-preset happy          # Happy (mobile Claude)\ncw config use-preset codex          # OpenAI Codex\ncw config use-preset no-op          # Skip AI launch\n\n# Or set custom tool\ncw config set ai-tool \"your-ai-tool\"\n\n# List available presets\ncw config list-presets\n```\n\n### Auto-Copy Files\n\nAutomatically copy project-specific files (like `.env`) to new worktrees:\n\n```bash\n# Add files to copy list\ncw config copy-files add .env\ncw config copy-files add .env.local\ncw config copy-files add config/local.json\n\n# List configured files\ncw config copy-files list\n\n# Remove a file from the list\ncw config copy-files remove .env\n```\n\n**Note:** Dependencies like `node_modules` and `.venv` are automatically symlinked (not copied) to save disk space.\n\nFor detailed configuration options (Happy setup, auto-updates, export/import, etc.), see **[Configuration Guide](docs/configuration.md)**.\n\n## More Features\n\n**Maintenance \u0026 Cleanup:** `cw clean`, `cw sync`, `cw doctor`\n**Analysis:** `cw tree`, `cw stats`, `cw diff`\n**Backup \u0026 Restore:** `cw backup create/restore`\n**Stash Management:** `cw stash save/apply`\n\nSee **[Advanced Features Guide](docs/advanced-features.md)** for details.\n\n## Command Reference\n\nFor the complete command reference with all options, see **[Commands Documentation](docs/commands.md)** or run:\n\n```bash\ncw --help\ncw \u003ccommand\u003e --help\n```\n\n## Requirements\n\n- **Git**: 2.31+ (for worktree support)\n- **Python**: 3.11+\n- **AI Tool** (optional): Claude Code, Codex, Happy, or custom\n\n## Installation Methods\n\n\u003cdetails\u003e\n\u003csummary\u003eUsing uv (recommended)\u003c/summary\u003e\n\n```bash\nuv tool install claude-worktree\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUsing pip\u003c/summary\u003e\n\n```bash\npip install claude-worktree\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFrom source\u003c/summary\u003e\n\n```bash\ngit clone https://github.com/DaveDev42/claude-worktree.git\ncd claude-worktree\nuv pip install -e .\n```\n\u003c/details\u003e\n\n## Troubleshooting\n\n\u003cdetails\u003e\n\u003csummary\u003e\"Not a git repository\"\u003c/summary\u003e\n\nRun commands from within a git repository.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\"AI tool not detected\"\u003c/summary\u003e\n\nInstall your AI tool or skip AI launch:\n```bash\ncw config use-preset no-op\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\"Rebase failed\"\u003c/summary\u003e\n\nResolve conflicts manually:\n```bash\ncd \u003cworktree-path\u003e\ngit rebase \u003cbase-branch\u003e\n# Fix conflicts\ngit rebase --continue\ncw pr  # or cw merge --push\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eShell completion not working\u003c/summary\u003e\n\n```bash\ncw --install-completion\n# Restart shell\n```\n\u003c/details\u003e\n\nFor more troubleshooting help, see **[TROUBLESHOOTING.md](TROUBLESHOOTING.md)**.\n\n## Documentation\n\n### User Guides\n- **[Commands Reference](docs/commands.md)** - Complete command reference with all options\n- **[Configuration Guide](docs/configuration.md)** - AI tools, presets, shell completion, export/import\n- **[Advanced Features](docs/advanced-features.md)** - Backup/restore, sync, cleanup, CI/CD\n- **[Troubleshooting](TROUBLESHOOTING.md)** - Common issues and solutions\n\n### Links\n- **[GitHub Issues](https://github.com/DaveDev42/claude-worktree/issues)** - Report bugs or request features\n- **[PyPI](https://pypi.org/project/claude-worktree/)** - Package page\n- **[Changelog](https://github.com/DaveDev42/claude-worktree/releases)** - Release history\n\n## Contributing\n\nContributions welcome! For development setup:\n\n```bash\ngit clone https://github.com/DaveDev42/claude-worktree.git\ncd claude-worktree\nuv pip install -e \".[dev]\"\n\n# Run tests\nuv run --extra dev pytest\n\n# Run linting\nruff check src/ tests/\nmypy src/claude_worktree\n```\n\n**For maintainers:** Use the automated release script to create new releases:\n\n```bash\n# Create a patch release (0.10.20 → 0.10.21)\nuv run python scripts/release.py\n\n# Create a minor release (0.10.20 → 0.11.0)\nuv run python scripts/release.py --minor\n\n# Create a major release (0.11.0 → 1.0.0)\nuv run python scripts/release.py --major\n```\n\n**CHANGELOG management:** The changelog is automatically generated from GitHub Releases. When a release PR is merged:\n1. GitHub automatically creates a Release with notes (PR-based)\n2. Workflow updates `CHANGELOG.md` from Releases\n3. Changes are committed to main\n\nTo manually update the changelog:\n```bash\npython scripts/changelog_sync.py\n```\n\nSee [CLAUDE.md](CLAUDE.md) for detailed development and release workflows.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\nBuilt with [Typer](https://typer.tiangolo.com/) and [Rich](https://rich.readthedocs.io/) for a great CLI experience.\n\n---\n\n**Made for developers who love AI-assisted coding and clean git workflows** 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavedev42%2Fclaude-worktree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavedev42%2Fclaude-worktree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavedev42%2Fclaude-worktree/lists"}