Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By pleaseai Verified Orgv1.0.0MITIn 1 marketplace
Keeps Claude Code in a git worktree from reading or editing the parent project's files, via hooks at session start and on file tool calls. Says it is best-effort, not a security boundary.
Trending plugins
7-day copy clicks
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Git worktree isolation for Claude Code: context injection and parent project access prevention.
When Claude Code runs inside a git worktree, it can accidentally read or modify files from the parent project directory. This plugin prevents that by:
Session starts
│
▼
SessionStart: worktree-context.ts
├── Not a worktree → no-op
└── Worktree detected → inject additionalContext
"Use: /path/to/worktree Do NOT access: /path/to/parent"
│
▼
Claude Code tool call (Read/Edit/Grep/…)
│
▼
PreToolUse: deny-parent-access.ts
├── Path is safe → pass through
└── Path is under parent project → deny
The hook uses two strategies:
| Strategy | Condition | How |
|---|---|---|
| Primary | Path contains /.claude/worktrees/ | String match (Claude Code's EnterWorktree convention) |
| Fallback | Arbitrary git worktree add paths | git rev-parse --show-toplevel vs --git-common-dir |
| Tool | Protected |
|---|---|
| Read | Yes |
| Edit / Write / MultiEdit | Yes |
| Grep / Glob | Yes |
| Bash | No (best-effort only) |
Note: The hook provides best-effort isolation. It is not a complete security boundary. Bash commands are not intercepted.
Start the interactive claude shell:
claude
Within the shell, add the marketplace and install the plugin:
/plugin marketplace add pleaseai/claude-code-plugins
/plugin install worktree@pleaseai
Alternatively, install directly from the command line (with optional --scope: user | project | local):
claude plugin marketplace add pleaseai/claude-code-plugins --scope project
claude plugin install worktree@pleaseai --scope project
cd plugins/worktree
bun test
# SessionStart — worktree detected
echo '{"cwd":"/path/to/project/.claude/worktrees/my-branch"}' | bun run hooks/worktree-context.ts
# PreToolUse — path denied (parent project access)
echo '{
"tool_name": "Read",
"tool_input": {"file_path": "/path/to/project/src/secret.ts"},
"cwd": "/path/to/project/.claude/worktrees/my-branch"
}' | bun run hooks/deny-parent-access.ts
# PreToolUse — path allowed (worktree path)
echo '{
"tool_name": "Read",
"tool_input": {"file_path": "/path/to/project/.claude/worktrees/my-branch/src/safe.ts"},
"cwd": "/path/to/project/.claude/worktrees/my-branch"
}' | bun run hooks/deny-parent-access.ts
MIT
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub pleaseai/claude-code-plugins --plugin worktreePlugins from other owners that cover similar ground