By rimoapp
Automatically creates git worktrees when Claude modifies files, enabling safe parallel work without git conflicts.
This plugin requires configuration values that are prompted when the plugin is enabled. Sensitive values are stored in your system keychain.
skip_directoriesComma-separated list of git repository root paths where auto-worktree should not activate (e.g. /path/to/notes,/path/to/scratch)
${user_config.skip_directories}pull_default_branchPull the latest default branch from origin on session start. Uses fast-forward only, so local changes are never overwritten. If the pull fails (offline, timeout, or diverged history), the plugin silently continues with the local state. (default: true)
${user_config.pull_default_branch}auto_return_to_defaultExecutes bash commands
Hook triggers when Bash tool is used
Modifies files
Hook triggers on file write and edit operations
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Automatically switch back to the default branch at session start if on a non-default branch with no uncommitted changes. When disabled, the working branch is left alone; the local default branch ref is still kept fresh by pull_default_branch. (default: true)
${user_config.auto_return_to_default}sync_gitignored_writesAutomatically copy gitignored files written in a worktree back to the main repository. Covers Write/Edit tool calls and Bash output redirects to gitignored paths. (default: true)
${user_config.sync_gitignored_writes}English | 日本語 | Español | Deutsch | 中文 | Русский | Português | 한국어
A Claude Code plugin that automatically redirects Claude into a git worktree before modifying files, enabling safe parallel work without git conflicts.
When multiple Claude Code sessions work on the same repository simultaneously, file modifications can conflict. Non-engineers who aren't familiar with git branching may lose work or encounter confusing merge conflicts.
During normal use, code changes happen in worktree branches. This is a guiding principle, not a hard enforcement on every command.
The plugin is designed to be minimally invasive:
Write/Edit to tracked files in the main repo are blocked — Claude is redirected to create a worktree firstBash commands are almost entirely allowed — only output redirects (>, >>) to tracked repo files are blockedcheckout, reset, merge, rebase, stash, etc.) are always allowed — the current main branch is not assumed to be correct, and users may need to fix or manage it/tmp, gitignored paths, or files outside the repo are always allowed (Plan Mode, memory, temp files all work)This plugin intercepts Write, Edit, and Bash tool calls via a PreToolUse hook. When Claude tries to write or edit a tracked file in the main repository, the plugin:
EnterWorktree toolEach Claude session gets its own isolated worktree and branch, so parallel sessions never conflict.
In Claude Code, run:
/plugin marketplace add rimoapp/claude-plugin-auto-worktree
/plugin install auto-worktree@rimoapp-plugins
Once installed, the plugin persists across sessions. You can enable/disable it anytime:
/plugin disable auto-worktree@rimoapp-plugins
/plugin enable auto-worktree@rimoapp-plugins
For development or testing:
claude --plugin-dir /path/to/claude-plugin-auto-worktree
User starts Claude in main repo
│
▼
SessionStart hook fires ─── On default branch? → Proactively tells Claude to use EnterWorktree
│
▼
Claude calls EnterWorktree → creates .claude/worktrees/<name>/
│
▼
All file modifications happen safely in the worktree
│
▼
Session ends → Stop hook prints summary (branch, uncommitted changes)
If Claude skips the proactive instruction, the PreToolUse hook acts as a safety net:
Claude tries to Write/Edit a file on default branch
│
▼
PreToolUse hook intercepts ──────── Already in a worktree? → Allow
│
▼
Blocks action (exit 2) + tells Claude to call EnterWorktree
Worktrees are created by Claude Code's built-in EnterWorktree tool inside the repository:
my-project/
├── .claude/
│ └── worktrees/
│ ├── humble-prancing-conway/ # Session 1
│ └── brave-dancing-turing/ # Session 2
├── src/
└── ...
Each worktree gets a branch named worktree-<session-name>.
The plugin only blocks Bash commands that use output redirects (>, >>) to write to tracked files inside the repository. Everything else is allowed:
git checkout, npm install, rm, touch, mv, etc.), redirects to /tmp, /dev/null, gitignored files, or paths outside the repoecho "data" > tracked-file.txt, cat input >> src/main.py, etc. (redirects to tracked repo files)The plugin supports user-configurable options via Claude Code's userConfig mechanism. After installing the plugin, you can set these options in your ~/.claude/settings.json under pluginConfigs:
npx claudepluginhub rimoapp/claude-plugins --plugin rimo-allAutomatically creates git worktrees when Claude modifies files, enabling safe parallel work without git conflicts.
Launch an interactive Claude Code session in another repository. Opens a new Terminal.app or iTerm2 tab, moves to the target repo, runs claude with an initial prompt, and reports the child session's result automatically when it finishes.
Git worktree management for parallel development workflows
Avoid merge conflicts across git worktrees for parallel AI coding agents
Git Worktree management for parallel agent execution - isolated working directories without Git conflicts
Agent isolation via git worktrees - gives each subagent its own checkout to prevent interference.
Manage isolated git worktree workspaces for multi-repo development
Automatic branch-specific CLAUDE.md memory management. Switches your Claude Code context when you change git branches.