Claude Worktree Hooks — Git skill for Claude Code
Claude Code hooks for fully functional git worktrees — symlinks node_modules, env files, .vercel, and Claude settings automatically.
How to install Claude Worktree Hooks
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open isoapp/claude-worktree-hooks and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Worktree Hooks does
Claude Code hooks for fully functional git worktrees — symlinks node_modules, env files, .vercel, and Claude settings automatically.
Alternatives in Git
- 使用 Git Worktrees — 创建孤立的 Git worktrees,带有智能目录选择与安全验证 115.1k ★
- Git Worktree Setup — Create isolated git worktrees with instant feedback and background Rust verification 25.5k ★
- Worktree Parallel Init — Create multiple git worktrees for parallel development: $ARGUMENTS 23.4k ★
README
Claude Code Worktree Hooks
Makes Claude Code worktrees work out of the box — symlinks `node_modules`, `.env` files, `.vercel/`, and Claude settings so you don't have to reinstall anything or deal with missing config.
What it does
When Claude Code creates a worktree, the hook automatically:
- Symlinks
node_modulesfrom the main repo (instant, no reinstall, no extra disk) - Symlinks all
.env.*files (root + nested packages) so secrets carry over - Symlinks
.vercel/so Vercel env management works - Symlinks
.claude/settings.local.jsonso your personal Claude config carries over - Runs
proto installto install the right Node/pnpm versions - Falls back to
pnpm installonly if nonode_modulesexist yet
Worktrees are stored in `~/.superset/worktrees//`.
Setup
1. One-time machine setup
# Install jq if you don't have it
brew install jq
# Create the worktrees directory
mkdir -p ~/.superset/worktrees
2. Add to your repo
From the root of any repo you want worktree support in:
# Create the hooks directory
mkdir -p .claude/hooks
# Copy the hook scripts
cp path/to/claude-worktree-hooks/hooks/worktree-create.sh .claude/hooks/
cp path/to/claude-worktree-hooks/hooks/worktree-remove.sh .claude/hooks/
# Make them executable
chmod +x .claude/hooks/*.sh
3. Configure Claude Code
If your repo **doesn't have** `.claude/settings.json` yet:
cp path/to/claude-worktree-hooks/settings.json .claude/settings.json
If your repo **already has** `.claude/settings.json`, add the hooks key to it:
{
"hooks": {
"WorktreeCreate": [
{
"hooks": [
{
"type": "command",
"command": ".claude/hooks/worktree-create.sh"
}
]
}
],
"WorktreeRemove": [
{
"hooks": [
{
"type": "command",
"command": ".claude/hooks/worktree-remove.sh"
}
]
}
]
}
}
4.
Related Skills
Setup Remote Editor
Make a worktree's branch link open in VS Code over Remote-SSH (writes env.CC_STATUSLINE_DIR_URL into user or p
Cclayer
Sync Claude Code config across machines: CLAUDE.md, skills, hooks, settings.json, plugins and MCP servers. Lay
Coasts
Coasts (Containerized Hosts) is an open-source, MIT-licensed CLI tool that provides localhost service isolatio
Flywheel Doctor
One-shot diagnostic of every flywheel dependency. Reports MCP connectivity, Agent Mail, br/bv/ntm/cm, node, gi
TypeScript Quality Hooks
by bartolli - Quality check hook for Node.js TypeScript projects with TypeScript compilation. ESLint auto-fixi
Worktree Add
Add a new git worktree from branch name or issue URL, copy settings, install deps, and open in current IDE
Related Agents
Light Security ClaudeSettingsAudit
Audit Claude Code config files (settings.json, settings.local.json, .mcp.json) for unsafe or malicious content
Noor
Engine engineer. Owns the main process: sessions on the Claude Agent SDK, hooks, approvals, git worktrees, scr
Purpose
You are a git worktree creation specialist. Your sole responsibility is to create a properly configured worktr