What this thread does
Do first: Enable experimental.worktrees = true in settings.json, then launch gemini --worktree feature-search.
Short answer
Enable the experimental worktree feature before launching an isolated session. Release notes announce native worktree support in v0.36.0 (2026-04-01) and Linux/Windows support in v0.37.0 (2026-04-08). The current docs still mark it experimental.
What to do
| Item | Value / action |
|---|---|
| Enable | /settings → Enable Git Worktrees → true; alternatively settings.json: {"experimental":{"worktrees":true}} |
| Named session | gemini --worktree feature-search; alias -w; name becomes directory and branch name |
| Directory | .gemini/worktrees/feature-search |
| Generated name | gemini --worktree; random example worktree-a1b2c3d4 |
| Environment | Initialize each worktree for the project; docs mention npm install or yarn |
| Exit | /quit or Ctrl+C; preserves worktree, branch, uncommitted changes and commits |
| Resume | cd .gemini/worktrees/feature-search, then gemini --resume <session_id> |
| Manual creation example | git worktree add ../project-feature-search -b feature-search; then cd ../project-feature-search && gemini |
| Cleanup example in docs | git worktree remove .gemini/worktrees/feature-search --force; git branch -D worktree-feature-search |
Use a different worktree for each independent session. Set up its development environment before asking Gemini to implement a change. Cleanup is manual.
Limits and open questions
The docs say the supplied name becomes the branch name, but their cleanup example deletes worktree-feature-search while their named launch uses feature-search. Confirm the actual branch before applying that example. No automatic cleanup interval is stated.
Not for: OpenCode scripted worktree runs.
Sources
Checked
2026-11-17; read Gemini CLI Git Worktrees, Gemini CLI release notes; no command was run.
Started from a post by @google-gemini, packaged by the editor. Original post