Worktree commands create isolated git branches for AI sessions, keeping changes separate from your main branch until you’re ready to merge.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/remorses/kimaki/llms.txt
Use this file to discover all available pages before exploring further.
What are Worktrees?
Git worktrees let you have multiple branches checked out simultaneously in different directories. Kimaki uses this to:- Isolate changes: Each worktree session works on its own branch
- Keep main clean: Your main branch stays untouched during experimentation
- Easy cleanup: Delete the worktree if you don’t like the changes
/new-worktree
Create a git worktree and start a session in it.Parameters
name(optional) - Worktree name (derived from thread name if omitted)
Usage
From a text channel (creates new thread):Worktree Naming
Kimaki formats worktree names automatically:- Converts to lowercase
- Replaces spaces with hyphens
- Removes special characters
- Adds
opencode/kimaki-prefix
Behavior
opencode/kimaki-feature-auth../.kimaki-worktrees/opencode-kimaki-feature-auth🌳 Worktree: opencode/kimaki-feature-auth
📁 `/path/to/worktree`
🌿 Branch: `opencode/kimaki-feature-auth`
Transferring Uncommitted Changes
When running/new-worktree in an existing thread, Kimaki detects uncommitted changes:
Diff Capture: Kimaki captures both staged and unstaged changes using
git diff HEAD before creating the worktree.Error Cases
/merge-worktree
Merge worktree commits into the default branch using a squash-rebase workflow.Parameters
None.Usage
Merge Pipeline
Kimaki uses a worktrunk-style merge process:Merge failed: uncommitted changes in the worktree.
Commit changes first, then run `/merge-worktree` again.
A rebase conflict occurred while merging this worktree into the default branch.
Please resolve the rebase conflicts:
1. Check `git status` to see which files have conflicts
2. Edit the conflicted files to resolve the merge markers
3. Stage resolved files with `git add`
4. Continue the rebase with `git rebase --continue`
5. After the rebase completes successfully, tell me so I can run `/merge-worktree` again
Conflict Resolution Flow
When conflicts occur:- Kimaki queues or sends a prompt asking the AI to resolve conflicts
- The AI inspects
git status, edits conflicted files, and runsgit rebase --continue - After the rebase succeeds, the AI tells you
- You run
/merge-worktreeagain to complete the push
Automatic Queueing: If a session is actively streaming when
/merge-worktree detects conflicts, the conflict resolution prompt is queued automatically.Worktree Workflows
Feature development
Feature development
Use worktrees for new features:
Experimental changes
Experimental changes
Try risky changes without affecting main:
Parallel development
Parallel development
Work on multiple features simultaneously:
Worktree Storage
Worktrees are created in a sibling directory:Database Tracking
Kimaki tracks worktrees in SQLite:pending- Worktree creation in progressready- Worktree created successfullyerror- Creation failed (seeerror_message)
Best Practices
One Worktree Per Feature: Keep worktree sessions focused on a single feature or fix. Merge frequently to avoid long-lived branches.
Submodule Support: Kimaki automatically initializes submodules in worktrees. The process may take a few seconds for repos with many submodules.