xiaohongshu
xiaohongshu
claude-worktree-manager
Create and manage Claude-specific worktrees with automated setup and cleanup. Use this skill (via Skill tool or direct script) when asked to "create a worktree", "new worktree", "worktree for feature/staging", "setup isolated environment", or "cleanup old worktrees". Script path is auto-detected ...
Full skill instructions
Automated worktree management for Claude Code development sessions with smart naming, auto-setup, and cleanup.
There are two ways to create worktrees:
Use the Skill tool to invoke this skill - the script path is detected automatically:
// Using Skill tool with args parameter (Recommended)
Skill(skill: 'claude-worktree-manager', args: 'create feature-name --model opus')
Skill(skill: 'claude-worktree-manager', args: 'create feature-name --isolated --model sonnet')
// All bash script flags work the same via args
Skill(skill: 'claude-worktree-manager', args: 'list')
Skill(skill: 'claude-worktree-manager', args: 'cleanup --days 14')
The skill handles all path resolution using git rev-parse --show-toplevel, so you only need to provide the worktree name and optional flags. All bash script flags (--model, --isolated, --days) work exactly the same when passed via the args parameter.
If you're running the script manually, provide the full path from any directory:
.claude/skills/claude-worktree-manager/scripts/worktree.sh create feature-name --model opus
Or use the full absolute path:
/path/to/repo/.claude/skills/claude-worktree-manager/scripts/worktree.sh create feature-name --model opus
To clarify the correct syntax for each invocation method:
| Task | Skill Tool | Direct Script |
|---|---|---|
| Create standard worktree | Skill(skill: 'claude-worktree-manager', args: 'create my-feature') | .claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature |
| With model flag | Skill(skill: 'claude-worktree-manager', args: 'create my-feature --model opus') | .claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature --model opus |
| With isolated database | Skill(skill: 'claude-worktree-manager', args: 'create schema-test --isolated') | .claude/skills/claude-worktree-manager/scripts/worktree.sh create schema-test --isolated |
| Both flags combined | Skill(skill: 'claude-worktree-manager', args: 'create complex --isolated --model opus') | .claude/skills/claude-worktree-manager/scripts/worktree.sh create complex --isolated --model opus |
| With plan file | Skill(skill: 'claude-worktree-manager', args: 'create webhooks --plan docs/plans/2026-02-01-webhooks.md') | .claude/skills/claude-worktree-manager/scripts/worktree.sh create webhooks --plan docs/plans/2026-02-01-webhooks.md |
| List worktrees | Skill(skill: 'claude-worktree-manager', args: 'list') | .claude/skills/claude-worktree-manager/scripts/worktree.sh list |
| Cleanup old worktrees | Skill(skill: 'claude-worktree-manager', args: 'cleanup --days 7') | .claude/skills/claude-worktree-manager/scripts/worktree.sh cleanup --days 7 |
Key Differences:
args parameterFor non-trivial features, use the discovery-first workflow with the /discover skill before creating a worktree:
┌─────────────────────────────────────────────────────────────┐
│ MAIN BRANCH │
│ │
│ 1. /discover <feature-description> │
│ ├── Agent asks clarifying questions (one at a time) │
│ ├── Proposes 2-3 approaches │
│ ├── Validates design in sections │
│ └── Creates docs/plans/YYYY-MM-DD-<feature>.md │
│ │
│ 2. Agent offers to create worktree with --plan │
│ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ WORKTREE (created with --plan) │
│ │
│ 3. Worktree agent reads plan and executes tasks │
│ ├── Two-stage review (spec compliance + code quality) │
│ ├── Mandatory verification before completion claims │
│ └── Batch checkpoints for human feedback │
│ │
└─────────────────────────────────────────────────────────────┘
# Step 1: Run discovery in main branch
User: /discover add webhook support for integrations
Agent: [Explores codebase]
Agent: [AskUserQuestion - one question at a time]
"What events should trigger webhooks?"
□ Integration lifecycle (connected, disconnected)
□ Agent actions (tool calls, completions)
□ All events
User: "Integration lifecycle"
Agent: [More questions, design validation...]
Agent: [Writes plan to docs/plans/2026-02-01-webhooks.md]
Agent: "Plan complete. Ready to create worktree?"
User: "Yes"
# Step 2: Create worktree with plan
Agent: Skill(skill: 'claude-worktree-manager',
args: 'create webhooks --plan docs/plans/2026-02-01-webhooks.md')
The --plan flag accepts a path to an implementation plan file:
--plan docs/plans/2026-02-01-feature-name.md
What it does:
Auto-generated goal format:
Implement the plan at docs/plans/2026-02-01-webhooks.md
Read the plan first, then execute tasks in order. For 4+ independent tasks,
consider using parallel subagents. Use two-stage review (spec compliance then
code quality). Mandatory: every completion claim must include verification output.
# Plan + specific model for complex work
Skill(skill: 'claude-worktree-manager',
args: 'create webhooks --plan docs/plans/2026-02-01-webhooks.md --model opus')
# Plan + isolated database for schema changes
Skill(skill: 'claude-worktree-manager',
args: 'create migrations --plan docs/plans/2026-02-01-db-changes.md --isolated')
# Plan + goal (additional context appended)
Skill(skill: 'claude-worktree-manager',
args: 'create webhooks --plan docs/plans/2026-02-01-webhooks.md --goal "Focus on error handling first"')
| Scenario | Use |
|---|---|
| Feature with discovery/planning | --plan docs/plans/... |
| Quick bug fix | --goal "Fix the login redirect bug" |
| Simple task with clear instructions | --goal "Add logging to the auth service" |
| Complex multi-task feature | --plan (created by /discover) |
/discover - Creates the plan through structured dialogueplan-executor - Guides worktree agent on executing plans with verificationAfter creating a worktree with --model, verify the configuration was set correctly:
# Navigate to your worktree
cd /path/to/worktree
# Run verification script
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh
# Or verify from anywhere by passing the path
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh /path/to/worktree
Expected output when successful:
[INFO] Verifying Claude model configuration in: /path/to/worktree
[SUCCESS] .claude/settings.local.json found
[SUCCESS] Model configuration found: opus
[SUCCESS] Model is valid: opus
The validation script will:
.claude/settings.local.json existsSee the Model Flag Configuration - Edge Cases & Troubleshooting section below for fixing common issues.
Before starting Claude in a worktree with --model flag, you MUST run the verification script.
The model configuration uses jq (preferred) or sed (fallback) to update JSON files. These tools can fail silently on some systems, resulting in Claude using the wrong model.
| Symptom | Likely Cause | Quick Fix |
|---|---|---|
| Claude uses wrong model | Verification skipped | Run verify-worktree-model.sh before starting Claude |
[WARN] jq not found in output | jq not installed | Install jq: brew install jq (macOS) or apt install jq (Linux) |
| Model key missing in JSON | sed fallback failed | Manually add "model": "opus" to settings.local.json |
| JSON file is corrupted | sed pattern mismatch | Delete settings.local.json, copy from main repo, add model manually |
[SUCCESS] shown but wrong model used | Multiple model keys | Check for duplicate "model" entries in JSON |
The script has a default model configured: sonnet
--modelDEFAULT_MODEL in the script--model opus or --model haiku⚠️ Important: Setting DEFAULT_MODEL does NOT make verification optional!
Even with a default model configured, you MUST still run verify-worktree-model.sh after creating a worktree. The default model goes through the same jq/sed configuration process that can fail silently.
Scenario 1: Using default model (sonnet)
# 1. Create worktree (automatically uses DEFAULT_MODEL=sonnet)
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature | tail -1)
# Output: [INFO] Using default model: sonnet
# 2. REQUIRED: Verify the default model was set correctly
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh "$WORKTREE_PATH"
# Expected: [SUCCESS] Model is valid: sonnet
# 3. Only start Claude AFTER verification succeeds
cd "$WORKTREE_PATH" && claude 'Your goal'
Scenario 2: Using custom model (opus)
# 1. Create worktree with explicit model (overrides DEFAULT_MODEL)
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create complex-task --model opus | tail -1)
# Output: [INFO] Setting default model to: opus
# 2. REQUIRED: Verify the custom model was set correctly
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh "$WORKTREE_PATH"
# Expected: [SUCCESS] Model is valid: opus
# 3. Only start Claude AFTER verification succeeds
cd "$WORKTREE_PATH" && claude 'Your complex goal'
Verification output for default model worktrees:
[INFO] Verifying Claude model configuration in: /path/to/worktree
[SUCCESS] .claude/settings.local.json found
[SUCCESS] Model configuration found: sonnet
[SUCCESS] Model is valid: sonnet
When the user asks to create a worktree for a feature or environment, derive a short, descriptive kebab-case name from their request:
Naming examples:
staging-envdark-modefix-auth-bugupdate-apiThen run:
# Standard (uses shared dev database)
.claude/skills/claude-worktree-manager/scripts/worktree.sh create <derived-name>
# With specific model (e.g., opus, sonnet, haiku)
.claude/skills/claude-worktree-manager/scripts/worktree.sh create <derived-name> --model opus
# Isolated (creates dedicated database with seeding)
.claude/skills/claude-worktree-manager/scripts/worktree.sh create <derived-name> --isolated
# Isolated with model
.claude/skills/claude-worktree-manager/scripts/worktree.sh create <derived-name> --isolated --model sonnet
What happens:
worktree/<name>-<timestamp> from main~/claude-worktrees/<project-name>/<name>-<timestamp>.env from main repo.claude/settings.local.json from main repo (API keys, preferences)pnpm install in background--model: Sets default Claude model in .claude/settings.local.json--isolated: Creates dedicated database and seeds it with test dataWhen creating worktrees with the --model flag, you MUST verify the configuration before starting Claude:
# 1. Create worktree with model
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature --model opus | tail -1)
# 2. REQUIRED: Verify the model was set correctly
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh "$WORKTREE_PATH"
# Must show: [SUCCESS] Model is valid: opus
# 3. Check pnpm install progress (optional)
tail -f "$WORKTREE_PATH/.pnpm-install.log"
# 4. Only start Claude AFTER verification succeeds
cd "$WORKTREE_PATH"
claude 'Your goal here'
Why is verification required?
jq/sed fallback can fail silently: The script uses jq (preferred) or sed (fallback) to update JSON. On some systems, sed may fail without error.
macOS vs Linux sed differences: macOS uses BSD sed which requires -i '' while Linux uses GNU sed with -i. The script handles this, but edge cases exist.
JSON syntax can break: Malformed JSON in settings.local.json can cause the update to fail.
Claude uses wrong model without verification: If you start Claude before verifying, it will use the default model instead of your requested model, wasting time and potentially money.
If verification fails: See the "Model Flag Configuration - Edge Cases & Troubleshooting" section below for manual fixes.
Use the --isolated flag when:
For normal feature development, skip --isolated to use the shared database.
When you invoke this skill using the Skill tool (e.g., Skill(claude-worktree-manager)), the skill automatically:
git rev-parse --show-toplevel.claude/skills/claude-worktree-manager/scripts/worktree.shYou don't need to specify absolute paths or worry about the script location. The skill handles all path resolution automatically. Just use simple worktree names and optional flags:
# Via Skill tool - automatic path resolution
Skill(claude-worktree-manager) create my-feature --model sonnet
# Via direct script - requires full path from any directory
/path/to/repo/.claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature --model sonnet
Use the --model flag to set the default Claude model for the worktree:
.claude/skills/claude-worktree-manager/scripts/worktree.sh create <name> --model <model-name>
Available models: opus, sonnet, haiku
When specified, the model is configured in the worktree's .claude/settings.local.json so that all Claude Code sessions in that worktree use the selected model by default. This is useful for:
Important: Return the worktree path to the user so they can open a new Claude Code session in that directory.
The script automatically opens a new Ghostty tab when running in Ghostty terminal. Use the --goal flag to set a task description:
# Creates worktree and opens Ghostty tab with Claude
.claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature --goal "Add dark mode toggle"
The script will:
$TERM_PROGRAM = ghostty)ghostty-tabGoal Prompt Guidelines:
Examples:
.claude/skills/claude-worktree-manager/scripts/worktree.sh create fix-auth --goal "Fix authentication redirect bug"
.claude/skills/claude-worktree-manager/scripts/worktree.sh create oauth --goal "Add OAuth2 support with Google and GitHub"
.claude/skills/claude-worktree-manager/scripts/worktree.sh create refactor --goal "Refactor to multi-tenant architecture"
The script has configurable variables at the top. To customize, edit the script directly:
# Edit the script
nano .claude/skills/claude-worktree-manager/scripts/worktree.sh
Configuration variables:
| Variable | Default | Description |
|---|---|---|
DEFAULT_MAX_AGE_DAYS | 7 | Days before worktrees are considered stale for cleanup |
WORKTREE_BASE | $HOME/claude-worktrees | Base directory for all worktrees |
DEFAULT_MODEL | sonnet | Model saved to worktree's .claude/settings.local.json |
CLAUDE_CMD | cc | Command to run Claude (use your shell alias) |
GHOSTTY_TAB | $HOME/.local/bin/ghostty-tab | Path to ghostty-tab binary |
Recommended: Configure your shell alias instead
Rather than editing script variables, configure your Claude alias in ~/.zshrc:
# Claude Code alias with default model
alias cc="claude --dangerously-skip-permissions --model sonnet"
This way, all Claude sessions (not just worktrees) use your preferred defaults.
Plan Mode: When you provide a --goal, the script automatically wraps it as:
enter plan mode to work on: <your goal>
This instructs Claude to enter plan mode and begin planning the task.
Important: The ghostty-tab command is at ~/.local/bin/ghostty-tab and uses AppleScript to open a new Ghostty tab. It accepts:
-d <path> - Directory to cd into--no-enter - Type the command but don't press enter (lets user review before executing)"<command>" - Command to type/run after cd.claude/skills/claude-worktree-manager/scripts/worktree.sh list
Shows all active worktrees for the current project with their branches.
# Cleanup worktrees older than 7 days (default)
.claude/skills/claude-worktree-manager/scripts/worktree.sh cleanup
# Custom age threshold
.claude/skills/claude-worktree-manager/scripts/worktree.sh cleanup --days 14
The script intelligently checks if a branch with your name already exists on origin:
Scenario 1: Branch exists on origin
.claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature
If origin/my-feature exists, the script will:
origin/my-featureScenario 2: Branch doesn't exist on origin
.claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature
If origin/my-feature doesn't exist, the script will:
worktree/my-feature-<timestamp>This means you can use simple names (like restructure-prompts) and the script will automatically handle both new work and continuing existing branches.
User says: "I want to create a new worktree for developing a staging environment"
Analyze the request and derive a concise kebab-case name:
staging-env# Run the script and capture the worktree path (last line of output)
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create staging-env | tail -1)
echo "Created: $WORKTREE_PATH"
After creating the worktree, check if running in Ghostty and automatically open a new tab:
# Check if in Ghostty and open new tab with Claude (--no-enter lets user review first)
if [ "$TERM_PROGRAM" = "ghostty" ]; then
ghostty-tab -d "$WORKTREE_PATH" --no-enter "claude 'Set up and configure the staging environment'"
fi
The script outputs the worktree path. Return it to the user:
Worktree created at: ~/claude-worktrees/orienter/staging-env-1736639420
✓ Opened new Ghostty tab with Claude command ready (press Enter to start)
Goal: Set up and configure the staging environment
Note: pnpm install is running in the background. Check progress with:
tail -f ~/claude-worktrees/orienter/staging-env-1736639420/.pnpm-install.log
If NOT in Ghostty, show manual instructions:
Worktree created at: ~/claude-worktrees/orienter/staging-env-1736639420
You can now open a new Claude Code session in this directory:
cd ~/claude-worktrees/orienter/staging-env-1736639420
Note: pnpm install is running in the background. Check progress with:
tail -f ~/claude-worktrees/orienter/staging-env-1736639420/.pnpm-install.log
The worktree creation starts pnpm install in the background using nohup. This means:
.pnpm-install.logCheck if installation is complete:
# Check if still running
ps aux | grep pnpm
# Watch the log
tail -f <worktree-path>/.pnpm-install.log
When using --isolated, the script automatically:
data/worktree_<timestamp>.db.env with the new SQLITE_DB_PATHDatabase seeding starts after pnpm install completes. Check progress:
tail -f <worktree-path>/.db-seed.log
If you need to seed an existing worktree:
# Seed with shared database (from .env)
./scripts/seed-worktree-db.sh
# Create isolated database and seed
ISOLATED=true ./scripts/seed-worktree-db.sh
The script automatically handles configuration files:
Automatically Available (via git):
.claude/skills/ - All skills are available in worktrees.claude/settings.json - Committed Claude settingsAutomatically Copied:
.env - Environment variables for the application.claude/settings.local.json - Local Claude settings (API keys, preferences)This ensures your worktree has the same development environment as the main repo.
After creating the worktree, users can reference the worktree-operations skill for:
pnpm run buildpnpm testpnpm run devpnpm run typecheckThe worktree-operations skill covers all pnpm/turbo commands for working in the monorepo.
~/claude-worktrees/
└── <project-name>/
├── feature-a-1736639420/
├── staging-env-1736639421/
└── fix-bug-1736639422/
Each project gets its own subdirectory under ~/claude-worktrees/.
./worktree.sh cleanupThe .env file is copied to worktrees automatically. Ensure proper formatting to avoid shell parsing errors:
Values with special characters MUST be quoted:
# ✅ Correct - quoted values
SQLITE_DB_PATH="./data/orient.db"
STANDUP_CRON="30 9 * * 1-5"
STANDUP_CHANNEL="#orienter-standups"
# ❌ Wrong - unquoted special chars cause shell errors
STANDUP_CRON=30 9 * * 1-5 # Shell expands * as glob
STANDUP_CHANNEL=#orienter-standups # Shell treats # as comment
For database seeding to work, ensure SQLITE_DB_PATH is set:
SQLITE_DB_PATH="./data/orient.db"
If you see errors like command not found when sourcing .env:
* * *)#The --model flag updates .claude/settings.local.json to set the default Claude model for your worktree. This section documents potential edge cases and how to handle them.
The script requires one of the following tools to update JSON:
Most systems have sed built-in. To install jq:
# macOS
brew install jq
# Ubuntu/Debian
sudo apt-get install jq
# Or use your system package manager
The script attempts to update .claude/settings.local.json with your selected model:
Step 1: Check for jq
if command -v jq &> /dev/null; then
# Use jq (preferred, safe JSON manipulation)
else
# Fall back to sed (text substitution, can fail silently)
fi
Step 2a: With jq (preferred)
jq ".model = \"opus\"" settings.local.json > settings.local.json.tmp
mv settings.local.json.tmp settings.local.json
Step 2b: With sed (fallback)
# macOS (BSD sed)
sed -i '' "s/\"model\": \"[^\"]*\"/\"model\": \"opus\"/g" file.json
# Linux (GNU sed)
sed -i "s/\"model\": \"[^\"]*\"/\"model\": \"opus\"/g" file.json
| Aspect | macOS (BSD sed) | Linux (GNU sed) |
|---|---|---|
| In-place edit | sed -i '' | sed -i |
| Extended regex | sed -E | sed -r or sed -E |
| Backup suffix | sed -i '.bak' | sed -i'.bak' (no space) |
The script handles these differences automatically, but edge cases can still occur.
✅ Valid JSON after successful configuration:
{
"model": "opus",
"permissions": {
"allow": ["Bash(git:*)"]
}
}
❌ Broken JSON - sed added model incorrectly:
{{"model": "opus",
"permissions": {
"allow": ["Bash(git:*)"]
}
}
❌ Broken JSON - duplicate model keys:
{
"model": "opus",
"model": "sonnet",
"permissions": { ... }
}
❌ Missing model - sed pattern didn't match:
{
"permissions": {
"allow": ["Bash(git:*)"]
}
}
If Claude doesn't use the configured model:
Step 1: Verify the model was set
# Go to your worktree and verify
cd /path/to/worktree
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh
# Or from anywhere (pass worktree path)
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh /path/to/worktree
Step 2: Check settings.local.json contents
cat /path/to/worktree/.claude/settings.local.json | grep -i model
You should see:
{
"model": "opus",
"permissions": { ... }
}
Step 3: If model is missing, add it manually
If the model key is missing, add it to the top level of .claude/settings.local.json:
# Edit the file manually
nano /path/to/worktree/.claude/settings.local.json
The file should look like:
{
"model": "opus",
"permissions": {
"allow": [ ... ]
}
}
Why: The script fell back to sed, which is less reliable. jq is recommended.
Fix: Install jq and re-create the worktree with the --model flag
# Install jq
brew install jq # or sudo apt-get install jq
# Re-create worktree with model flag
.claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature --model opus
Why: The model might be formatted incorrectly or Claude Code might not be reading it.
Fix: Verify the JSON is valid and properly formatted:
# Verify JSON syntax is valid
jq . /path/to/worktree/.claude/settings.local.json
# Should output valid JSON without errors
If JSON is invalid, edit the file to fix syntax errors (missing quotes, commas, etc).
Why: This can happen on systems with different sed versions or in edge cases.
Fix: Use jq or manually edit the file
# Option 1: Install jq and re-create worktree
brew install jq
.claude/skills/claude-worktree-manager/scripts/worktree.sh create my-feature --model opus
# Option 2: Manually add the model to the file
nano /path/to/worktree/.claude/settings.local.json
# Add "model": "opus", at the top level
Why: The Ghostty tab might be starting Claude in a different context or with different settings.
Fix: Verify the model is set and start Claude from within the worktree:
# Navigate to worktree
cd /path/to/worktree
# Verify model
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh
# Start Claude directly
claude 'Your goal prompt here'
# Claude will load settings from the current worktree directory
Use the validation script to verify worktree model configuration:
# From the worktree directory
cd /path/to/worktree
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh
# Or from anywhere
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh /path/to/worktree
Output examples:
✅ Correct:
[INFO] Verifying Claude model configuration in: /path/to/worktree
[SUCCESS] .claude/settings.local.json found
[SUCCESS] Model configuration found: opus
[SUCCESS] Model is valid: opus
❌ Missing model:
[INFO] Verifying Claude model configuration in: /path/to/worktree
[SUCCESS] .claude/settings.local.json found
[WARN] No model configuration found in settings.local.json
If automatic configuration fails, manually edit .claude/settings.local.json:
# Navigate to worktree
cd /path/to/worktree
# Open settings file
nano .claude/settings.local.json
Add the model key at the top level:
{
"model": "opus",
"permissions": {
"allow": [ ... ]
}
}
Valid model values:
"opus" - Claude Opus 4.5 (most capable)"sonnet" - Claude Sonnet (balanced)"haiku" - Claude Haiku (fastest/cheapest)After saving, verify with the validation script:
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh
Check the log:
cat <worktree-path>/.pnpm-install.log
Re-run manually if needed:
cd <worktree-path>
pnpm install
Copy manually:
cp <main-repo>/.env <worktree-path>/.env
Check the log:
cat <worktree-path>/.db-seed.log
Common issues:
data/ directorynpm run db:migrate firstCheck git status and ensure:
User: "Create a worktree for adding OAuth support"
# 1. Create the worktree and capture path
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create oauth-support | tail -1)
# 2. If in Ghostty, open new tab with Claude
if [ "$TERM_PROGRAM" = "ghostty" ]; then
ghostty-tab -d "$WORKTREE_PATH" --no-enter "claude 'Add OAuth support with Google and GitHub providers'"
fi
User: "Create a worktree for complex refactoring using Opus"
# 1. Create the worktree with Opus model and capture path
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create complex-refactor --model opus | tail -1)
# 2. Verify the model was set correctly
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh "$WORKTREE_PATH"
# Expected output: [SUCCESS] Model is valid: opus
# 3. If in Ghostty, open new tab with Claude
if [ "$TERM_PROGRAM" = "ghostty" ]; then
ghostty-tab -d "$WORKTREE_PATH" --no-enter "claude 'Refactor the project to support multi-tenant architecture'"
fi
User: "Create a worktree for quick bug fixes using Haiku"
# 1. Create the worktree with Haiku model
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create quick-fixes --model haiku | tail -1)
# 2. Verify the model was set correctly
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh "$WORKTREE_PATH"
# 3. Start working in the worktree
cd "$WORKTREE_PATH"
claude 'Fix critical bugs'
User: "Create an Opus worktree with isolated database for migration testing"
# 1. Create worktree with both flags
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create schema-testing --isolated --model opus | tail -1)
# 2. Verify model configuration (database seeding runs in parallel)
.claude/skills/claude-worktree-manager/scripts/verify-worktree-model.sh "$WORKTREE_PATH"
# Output should show: [SUCCESS] Model is valid: opus
# 3. Check database seeding progress (runs after pnpm install)
tail -f "$WORKTREE_PATH/.db-seed.log"
# 4. Once ready, navigate to worktree and start Claude
cd "$WORKTREE_PATH"
claude 'Test database migrations'
User: "I need a worktree to fix the login redirect issue"
# 1. Create the worktree and capture path
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create fix-login-redirect | tail -1)
# 2. If in Ghostty, open new tab with Claude
if [ "$TERM_PROGRAM" = "ghostty" ]; then
ghostty-tab -d "$WORKTREE_PATH" --no-enter "claude 'Fix the login redirect issue'"
fi
User: "Create a new worktree for refactoring the project to make it multi-tenant"
# 1. Create the worktree and capture path
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create multi-tenant-refactor | tail -1)
# 2. If in Ghostty, open new tab with Claude
if [ "$TERM_PROGRAM" = "ghostty" ]; then
ghostty-tab -d "$WORKTREE_PATH" --no-enter "claude 'Refactor the project to support multi-tenant architecture'"
fi
User: "I need a worktree to test new database migrations"
# 1. Create the worktree with isolated DB and capture path
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create test-migrations --isolated | tail -1)
# 2. If in Ghostty, open new tab with Claude
if [ "$TERM_PROGRAM" = "ghostty" ]; then
ghostty-tab -d "$WORKTREE_PATH" --no-enter "claude 'Test new database migrations in isolated environment'"
fi
User: "Create a worktree for adding new agent tables"
# 1. Create the worktree with isolated DB and capture path
WORKTREE_PATH=$(.claude/skills/claude-worktree-manager/scripts/worktree.sh create add-agent-tables --isolated | tail -1)
# 2. If in Ghostty, open new tab with Claude
if [ "$TERM_PROGRAM" = "ghostty" ]; then
ghostty-tab -d "$WORKTREE_PATH" --no-enter "claude 'Add new agent tables to the database schema'"
fi
User: "Show me all my worktrees"
.claude/skills/claude-worktree-manager/scripts/worktree.sh list
User: "Clean up worktrees older than 3 days"
.claude/skills/claude-worktree-manager/scripts/worktree.sh cleanup --days 3
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience