Stop switching branches. Work on multiple branches simultaneously.
daft gives each Git branch its own directory. No more stashing, no more context switching, no more waiting for builds to restart.
my-project/
├── .git/ # Shared Git data
├── main/ # Stable branch
├── feature/auth/ # Your feature work
├── bugfix/login/ # Parallel bugfix
└── review/teammate-pr/ # Code review
# Install (macOS)
brew install avihut/tap/daft
# Clone a repo (creates my-project/main/)
git worktree-clone git@github.com:user/my-project.git
# Start a feature branch (creates my-project/feature/auth/)
git worktree-checkout-branch feature/authEach directory is a full working copy. Run different branches in different terminals. Your IDE state, node_modules, build artifacts - all isolated per branch.
Already have a repository? Convert it to the worktree workflow with one command:
cd my-existing-project
git worktree-flow-adoptThis restructures your repo:
my-project/ my-project/
├── .git/ ├── .git/ (bare repository)
├── src/ → └── main/ (worktree)
└── README.md ├── src/
└── README.md
Your uncommitted changes are preserved. If you change your mind:
git worktree-flow-eject # Converts back to traditional layoutTraditional Git workflow:
┌─────────────────────────────────────────────────────────┐
│ $ git stash │
│ $ git checkout feature-b │
│ $ npm install # wait... │
│ $ npm run build # wait... │
│ # context lost, IDE state gone │
│ $ git checkout feature-a │
│ $ git stash pop │
│ # where was I? │
└─────────────────────────────────────────────────────────┘
With daft:
Terminal 1 (feature-a/) Terminal 2 (feature-b/)
┌───────────────────────┐ ┌───────────────────────┐
│ $ npm run dev │ │ $ npm run dev │
│ Server on :3000 │ │ Server on :3001 │
│ # full context │ │ # full context │
└───────────────────────┘ └───────────────────────┘
↓ ↓
Both running simultaneously, isolated environments
brew install avihut/tap/daftirm https://github.com/avihut/daft/releases/latest/download/daft-installer.ps1 | iexDownload binaries from GitHub Releases or build from source:
git clone https://github.com/avihut/daft.git
cd daft && cargo build --releaseSee CONTRIBUTING.md for detailed installation and symlink setup.
Enable automatic cd into new worktrees:
# Add to ~/.bashrc or ~/.zshrc
eval "$(daft shell-init bash)"
# Or for fish (~/.config/fish/config.fish)
daft shell-init fish | source| Command | Description |
|---|---|
git worktree-clone <url> |
Clone a repo into the worktree structure |
git worktree-init <name> |
Initialize a new repo in the worktree structure |
git worktree-checkout <branch> |
Create worktree from existing branch |
git worktree-checkout-branch <branch> |
Create new branch + worktree |
git worktree-checkout-branch <branch> main |
Create branch from a specific base |
git worktree-prune |
Remove worktrees for deleted remote branches |
git worktree-carry |
Carry uncommitted changes to other worktrees |
git worktree-flow-adopt |
Convert traditional repo to worktree layout |
git worktree-flow-eject |
Convert back to traditional layout |
Run any command with --help for full options.
Enable short aliases like gwtco, gwtcb:
daft setup shortcuts enable git # gwtco, gwtcb, gwtprune, etc.
daft setup shortcuts list # See all available shortcutsAutomate worktree lifecycle events with a daft.yml configuration file:
| Hook | Trigger |
|---|---|
post-clone |
After repository clone |
worktree-post-create |
After worktree created |
worktree-pre-remove |
Before worktree removal |
Example - install dependencies and auto-allow direnv in new worktrees:
# daft.yml
hooks:
worktree-post-create:
jobs:
- name: install-deps
run: npm install
- name: direnv-allow
run: direnv allow .git daft hooks trustHooks require explicit trust for security. See the hooks guide for details.
daft ships an Agent Skill that teaches AI coding agents (Claude Code, Cursor, Windsurf, and others) the worktree workflow -- commands, hooks, environment tooling, and worktree-aware Git operations.
npx skills add avihut/daftSee the Agent Skill guide for manual installation options.
- Git 2.5+ (for worktree support)
- Rust 1.70+ (only for building from source)
See CONTRIBUTING.md for development setup and guidelines.
MIT License - see LICENSE for details.
Pro Tip: This workflow is powerful for frontend development, code reviews, hotfixes, and any project with complex build processes that benefit from isolation.
