worktree-start
Skill0 starsChanged 9 months agoMITView on GitHub
Creates a git worktree for focused implementation work. Sets up context file and opens VS Code. Use when starting work on a feature/topic in a separate folder/branch.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- hirokisakabe/issuekittheir own version, first seen May 31, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- hirokisakabe/issuekit★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adr-createSkill
- dev-log-rotateSkill
- discovery-startSkill
- gather-insightSkill
- git-commitSkill
- init-projectSkill
- insight-captureSkill
- jira-startSkill
- review-implementationSkill
- session-endSkill
- session-listSkill
- session-startSkill
- team-stream-startSkill
- work-stream-startSkill
- worktree-endSkill
- worktree-listSkill
- worktree-removeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 17 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Must be in the main repository (not already in a worktree)
- Very specific: line 29
Read .claude/project-config.md if it exists
- Distinctive: line 35
Use default paths listed above
- Distinctive: line 40
Run git worktree list to see current worktrees
- Distinctive: line 41
Verify we're in the main worktree (not a secondary one)
- Distinctive: line 42
If already in a worktree, warn user:
- Very specific: line 50
Check if development log exists at [dev-log-path] (from config)
- Distinctive: line 51
If yes, look for "Active Work" section and extract active topics
- Distinctive: line 57
Use AskUserQuestion to ask:
- Distinctive: line 62
If user selects "Other", ask for custom topic name
- Distinctive: line 74
Use existing branch: - Ask which branch to check out
- Distinctive: line 75
Detached HEAD: - Use current commit without creating branch
- Very specific: line 79
Check if [work-streams-path]/[topic-name].md exists (from config)
- Distinctive: line 88
Run the appropriate git command based on branch strategy:
- Distinctive: line 106
If worktree already exists: "Worktree already exists at that location.
- Distinctive: line 107
If branch already exists (for new branch): "Branch already exists.
- Very specific: line 111
Write .claude-worktree-context.md in the new worktree root:
- Very specific: line 159
Check if .claude/settings.local.json exists in main repo
- Very specific: line 161
Create .claude/ directory in worktree (if not exists): mkdir -p "../[worktree-name]/.claude"
- Distinctive: line 163
If no, skip (no action needed)
- Distinctive: line 211
Not a git repository: verify we're in main repo
- Distinctive: line 215
Don't fail completely
- Distinctive: line 220
Don't fail the skill
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Worktree Start Skill
Creates a git worktree with context file for focused implementation work. The worktree is a separate working directory with its own branch, allowing parallel work on different features.
When to Use
Activate this skill when:
- User wants to start implementation work in a separate folder
- User says "create worktree", "start worktree", or "set up worktree"
- User wants to work on a specific feature/topic in isolation
- User wants to separate planning (main repo) from implementation (worktree)
Prerequisites
- Must be in the main repository (not already in a worktree)
- Work stream/feature should be defined (recommended)
Instructions
Step 0: Read Project Config
- Read
.claude/project-config.mdif it exists - Parse
## Documentation Pathssection to get:- Development log path (default:
docs/development-log.md) - Work streams path (default:
docs/work-streams/)
- Development log path (default:
If no config exists:
- Use default paths listed above
- Continue with skill execution
Step 1: Verify We're in Main Repo
- Run
git worktree listto see current worktrees - Verify we're in the main worktree (not a secondary one)
- If already in a worktree, warn user:
You appear to be in a worktree already. Run this skill from the main repository to create new worktrees.
Step 2: Find Available Work Streams (Optional)
- Check if development log exists at
[dev-log-path](from config) - If yes, look for "Active Work" section and extract active topics
- Also glob
[work-streams-path]/*.md(from config) for all available work streams - Build list of options (if any exist)
Step 3: Ask User for Topic
Use AskUserQuestion to ask:
Question 1: "What topic/feature is this worktree for?"
- List active work streams as options (if any found)
- Include "Other (custom topic)" option
- If user selects "Other", ask for custom topic name
Step 4: Ask for Worktree Configuration
Question 2: "Worktree folder name?"
- Suggest: topic name in kebab-case
- Example: if topic is "User Authentication", suggest "user-authentication"
- User can customize if desired
Question 3: "Branch strategy?" Options:
- Create new branch (Recommended) - Creates branch with same name as folder
- Use existing branch - Ask which branch to check out
- Detached HEAD - Use current commit without creating branch
Step 5: Read Work Stream Document (if exists)
- Check if
[work-streams-path]/[topic-name].mdexists (from config) - If yes:
- Read the document
- Extract: Purpose, Goals, Next session tasks, Key files mentioned
- If no:
- Continue with minimal context (this is fine for ad-hoc work)
Step 6: Create Git Worktree
Run the appropriate git command based on branch strategy:
If creating new branch:
git worktree add "../[worktree-name]" -b "[branch-name]"If using existing branch:
git worktree add "../[worktree-name]" "[branch-name]"If detached HEAD:
git worktree add --detach "../[worktree-name]"Handle errors:
- If worktree already exists: "Worktree already exists at that location. Choose a different name?"
- If branch already exists (for new branch): "Branch already exists. Use existing branch instead?"
Step 7: Create Context File
Write .claude-worktree-context.md in the new worktree root:
# Worktree Context
**Topic**: [topic-name]
**Branch**: [branch-name]
**Created**: [YYYY-MM-DD]
**Source Repo**: [main repo folder name]
## Purpose
[Copied from work stream document, or user-provided description, or "Implementation work for [topic]"]
## Session Goals
[Next session goals from work stream, or "To be defined with /session-start"]
## Suggested Tasks
- [ ] [Task from work stream plan]
- [ ] [Task from work stream plan]
- [ ] [Additional tasks...]
[If no tasks defined: "Run /session-start to define session tasks"]
## Key Files
[Files/directories mentioned in work stream, or relevant directories for this work]
## Quick Start
1. This file is auto-read by `/session-start` skill
2. Run `/session-start` to create session log and todo list
3. Implement tasks
4. Run `/session-end` when done
5. Merge branch and remove worktree when work complete
## Links
- Work Stream: [work-streams-path]/[topic-name].md (if exists)
- Dev Log: [dev-log-path] (if exists)Step 8: Copy Claude Code Settings
Copy personal Claude Code settings to the new worktree so permissions persist:
- Check if
.claude/settings.local.jsonexists in main repo - If yes:
- Create
.claude/directory in worktree (if not exists):mkdir -p "../[worktree-name]/.claude" - Copy settings:
cp ".claude/settings.local.json" "../[worktree-name]/.claude/settings.local.json"
- Create
- If no, skip (no action needed)
This ensures the new Claude Code session inherits your personal permission settings.
Step 9: Open VS Code
Run:
code "../[worktree-name]"This opens VS Code in the new worktree folder.
Step 10: Display Confirmation
Show user:
Worktree created successfully!
Location: ../[worktree-name]
Branch: [branch-name]
Topic: [topic-name]
Context File: .claude-worktree-context.md
VS Code is opening in the worktree folder.
Next steps:
1. In the new VS Code window, open a terminal
2. Run `claude` to start Claude Code
3. Run `/session-start` - it will auto-detect the worktree context
4. Start implementing!
When done with the work:
- Commit your changes
- Use `/worktree-end` to merge and clean up (or `/worktree-remove` to just remove)
[If settings were copied: "Claude Code settings copied - permissions will be preserved."]Error Handling
If git worktree add fails:
- Parse error message
- Common issues:
- Path already exists: suggest different name
- Branch already exists: suggest using existing branch
- Not a git repository: verify we're in main repo
- Show helpful error message with recovery options
If work stream document doesn't exist:
- Don't fail completely
- Continue with minimal context
- Context file will have placeholder values
If VS Code fails to open:
- Don't fail the skill
- Show manual instructions: "VS Code didn't open. Navigate to: ../[worktree-name]"
- Worktree is still created successfully
If already in a worktree:
- Detect via
git worktree listoutput - Refuse to create nested worktree
- Direct user to main repo
Examples
Example 1: Basic Worktree Creation
User: "/worktree-start"
Skill Actions:
- Runs
git worktree list- confirms we're in main repo - Asks: "What topic/feature?" - User enters "user-authentication"
- Asks: "Worktree folder name?" - User accepts default
- Asks: "Branch strategy?" - User selects "Create new branch"
- Runs:
git worktree add "../user-authentication" -b "user-authentication" - Writes
.claude-worktree-context.mdwith details - Copies
.claude/settings.local.jsonto worktree - Runs:
code "../user-authentication" - Shows confirmation with next steps
Example 2: With Existing Work Stream
User: "/worktree-start"
Skill Actions:
- Finds active work streams in dev log
- Lists options: "api-refactor", "database-migration", "Other"
- User selects "api-refactor"
- Reads
[work-streams-path]/api-refactor.md- extracts purpose/goals - Creates worktree with rich context from work stream
- Opens VS Code
Example 3: Using Existing Branch
User: "/worktree-start"
Skill Actions:
- Asks: "What topic?" - User enters "bugfix-login"
- Asks: "Worktree folder name?" - User accepts "bugfix-login"
- Asks: "Branch strategy?" - User selects "Use existing branch"
- Runs
git branch --listto show available branches - Asks: "Which branch?" - User selects "feature/login-fix"
- Runs:
git worktree add "../bugfix-login" "feature/login-fix" - Writes context file
- Opens VS Code
Notes
- Worktrees are created in the parent folder (siblings of main repo)
- Each worktree has its own working directory but shares git history
- The context file
.claude-worktree-context.mdenables seamless session-start integration - Branch name defaults to folder name for consistency
- VS Code opening is best-effort; worktree is still created even if VS Code fails
- Claude Code settings (
.claude/settings.local.json) are copied to preserve personal permissions
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

