worktree-manager
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Manage parallel development across ALL projects using git worktrees with Claude Code agents. Each worktree is an isolated copy of the repo on a different branch, stored centrally at `~/tmp/worktrees/`. This enables multiple agents to work simultaneously without conflicts.
</objective>
<quick_start>
Create a single worktree with agent:
/worktree create feature/authClaude will:
- Allocate ports (8100-8101)
- Create worktree at
~/tmp/worktrees/[project]/feature-auth - Install dependencies
- Create WORKTREE_TASK.md for the agent
- Launch terminal with Claude Opus 4.5 agent </quick_start>
<success_criteria>
A worktree setup is successful when:
- Worktree created at
~/tmp/worktrees/[project]/[branch-slug] - Ports allocated and registered globally
- Dependencies installed
- Agent launched in terminal (Ghostty/iTerm2/tmux)
- Entry added to </success_criteria>
~/.claude/worktree-registry.json
<current_state>
Git repository:
!
git status --short --branch 2>/dev/nullExisting worktrees:
!
git worktree list 2>/dev/nullWorktree registry:
!
cat ~/.claude/worktree-registry.json 2>/dev/null | jq -r '.worktrees[] | "\(.project)/\(.branch) → \(.status)"' | head -10Available ports:
! allocated
</current_state>
cat ~/.claude/worktree-registry.json 2>/dev/null | jq '.portPool.allocated | length' || echo "0"<activation_triggers>
<objective>
借助git worktrees和Claude Code agents管理所有项目的并行开发。每个工作树是仓库在不同分支上的独立副本,集中存储在`~/tmp/worktrees/`目录下。这允许多个agents同时工作而不会产生冲突。
</objective>
<quick_start>
创建带agent的单个工作树:
/worktree create feature/authClaude将:
- 分配端口(8100-8101)
- 在路径下创建工作树
~/tmp/worktrees/[project]/feature-auth - 安装依赖
- 为agent创建WORKTREE_TASK.md文件
- 启动运行Claude Opus 4.5 agent的终端 </quick_start>
<success_criteria>
工作树设置成功的标志:
- 工作树已创建在路径下
~/tmp/worktrees/[project]/[branch-slug] - 端口已分配并全局注册
- 依赖已安装
- agent已在终端(Ghostty/iTerm2/tmux)中启动
- 条目已添加到</success_criteria>
~/.claude/worktree-registry.json
<current_state>
Git仓库状态:
!
git status --short --branch 2>/dev/null现有工作树:
!
git worktree list 2>/dev/null工作树注册表:
!
cat ~/.claude/worktree-registry.json 2>/dev/null | jq -r '.worktrees[] | "\(.project)/\(.branch) → \(.status)"' | head -10可用端口:
! 已分配
</current_state>
cat ~/.claude/worktree-registry.json 2>/dev/null | jq '.portPool.allocated | length' || echo "0"<activation_triggers>
When This Skill Activates
该Skill的激活场景
Trigger phrases:
- "spin up worktrees for X, Y, Z"
- "create 3 worktrees for features A, B, C"
- "new worktree for feature/auth"
- "what's the status of my worktrees?"
- "show all worktrees" / "show worktrees for this project"
- "clean up merged worktrees"
- "launch agent in worktree X"
触发语句:
- "为X、Y、Z创建工作树"
- "为功能A、B、C创建3个工作树"
- "为feature/auth创建新工作树"
- "我的工作树状态如何?"
- "显示所有工作树" / "显示当前项目的工作树"
- "清理已合并的工作树"
- "在工作树X中启动agent"
Invocation
调用方式
Command syntax:
- - Single worktree
/worktree create feature/auth - - Multiple worktrees
/worktree create feat1 feat2 feat3 - - Check all worktrees
/worktree status - - Filter by project
/worktree status --project myapp - - Remove worktree
/worktree cleanup feature/auth - - Launch agent in worktree
/worktree launch feature/auth
</activation_triggers>
<file_locations>
命令语法:
- - 创建单个工作树
/worktree create feature/auth - - 创建多个工作树
/worktree create feat1 feat2 feat3 - - 查看所有工作树状态
/worktree status - - 按项目过滤查看
/worktree status --project myapp - - 删除工作树
/worktree cleanup feature/auth - - 在工作树中启动agent
/worktree launch feature/auth
</activation_triggers>
<file_locations>
Key Files
关键文件
| File | Purpose |
|---|---|
| Global registry - tracks all worktrees across all projects |
| Skill config - terminal, shell, port range settings |
| Helper scripts - optional, can do everything manually |
| Worktree storage - all worktrees live here |
| Project config - CLAUDE.md, hooks, permissions, custom agents |
| Project config - optional custom settings |
| Auto-loaded task prompt - agent reads on startup |
</file_locations>
<core_concepts>
| 文件 | 用途 |
|---|---|
| 全局注册表 - 跟踪所有项目的所有工作树 |
| Skill配置文件 - 终端、Shell、端口范围设置 |
| 辅助脚本 - 可选,所有操作也可手动完成 |
| 工作树存储目录 - 所有工作树的存放位置 |
| 项目配置 - CLAUDE.md、钩子、权限、自定义agents |
| 项目配置 - 可选自定义设置 |
| 自动加载的任务提示文件 - agent启动时会读取 |
</file_locations>
<core_concepts>
Core Concepts
核心概念
Centralized Worktree Storage
集中式工作树存储
All worktrees live in
~/tmp/worktrees/<project-name>/<branch-slug>/~/tmp/worktrees/
├── obsidian-ai-agent/
│ ├── feature-auth/ # branch: feature/auth
│ ├── feature-payments/ # branch: feature/payments
│ └── fix-login-bug/ # branch: fix/login-bug
└── another-project/
└── feature-dark-mode/所有工作树都存放在目录下
~/tmp/worktrees/<project-name>/<branch-slug>/~/tmp/worktrees/
├── obsidian-ai-agent/
│ ├── feature-auth/ # 分支:feature/auth
│ ├── feature-payments/ # 分支:feature/payments
│ └── fix-login-bug/ # 分支:fix/login-bug
└── another-project/
└── feature-dark-mode/Branch Slug Convention
分支Slug命名规范
Branch names are slugified for filesystem safety:
- →
feature/authfeature-auth - →
fix/login-bugfix-login-bug
Slugify manually:
echo "feature/auth" | tr '/' '-'分支名称会被转换为Slug格式以确保文件系统安全:
- →
feature/authfeature-auth - →
fix/login-bugfix-login-bug
手动转换Slug:
echo "feature/auth" | tr '/' '-'Port Allocation
端口分配
- Global pool: 8100-8199 (100 ports total)
- Per worktree: 2 ports allocated (for API + frontend patterns)
- Globally unique: Ports tracked to avoid conflicts across projects
See: for detailed operations.
reference/port-allocation.md- 全局端口池:8100-8199(共100个端口)
- 每个工作树:分配2个端口(适用于API+前端的典型架构)
- 全局唯一:端口会被全局跟踪,避免跨项目冲突
详情参考: 中的详细操作说明
reference/port-allocation.mdRequired Defaults
必需默认设置
CRITICAL: These settings MUST be used when launching agents:
| Setting | Value | Reason |
|---|---|---|
| Terminal | Ghostty or iTerm2 | Auto-detected, configurable in config.json |
| Model | | Opus 4.5 alias (most capable) |
| Flags | | Required for autonomous file ops |
Launch command pattern:
bash
undefined重要提示:启动agents时必须使用以下设置:
| 设置项 | 值 | 原因 |
|---|---|---|
| 终端 | Ghostty或iTerm2 | 自动检测,可在config.json中配置 |
| 模型 | | Opus 4.5的别名(功能最强大) |
| 标志 | | 自主文件操作必需 |
启动命令模板:
bash
undefinedRecommended: agent inherits .claude/ config (CLAUDE.md, hooks, permissions)
推荐:agent继承.claude/配置(CLAUDE.md、钩子、权限)
claude --model opus --dangerously-skip-permissions
claude --model opus --dangerously-skip-permissions
Or with explicit permission allowlist (safer, from .claude/settings.json):
或使用显式权限白名单(更安全,来自.claude/settings.json):
claude --model opus --allowedTools "Bash(npm test),Bash(npm run build),Edit,Write,Read,Glob,Grep"
</core_concepts>
<config>claude --model opus --allowedTools "Bash(npm test),Bash(npm run build),Edit,Write,Read,Glob,Grep"
</core_concepts>
<config>Skill Config
Skill配置
Location:
~/.claude/skills/worktree-manager/config.jsonjson
{
"terminal": "ghostty",
"terminalPreference": "auto",
"enableNumberedTabs": true,
"shell": "zsh",
"defaultModel": "opus",
"claudeCommand": "claude --model opus --dangerously-skip-permissions",
"portPool": { "start": 8100, "end": 8199 },
"portsPerWorktree": 2,
"worktreeBase": "~/tmp/worktrees",
"defaultCopyDirs": [".claude"],
"envFilePriority": [".env.local", ".env", ".env.example"],
"autoCleanupOnMerge": true
}位置:
~/.claude/skills/worktree-manager/config.jsonjson
{
"terminal": "ghostty",
"terminalPreference": "auto",
"enableNumberedTabs": true,
"shell": "zsh",
"defaultModel": "opus",
"claudeCommand": "claude --model opus --dangerously-skip-permissions",
"portPool": { "start": 8100, "end": 8199 },
"portsPerWorktree": 2,
"worktreeBase": "~/tmp/worktrees",
"defaultCopyDirs": [".claude"],
"envFilePriority": [".env.local", ".env", ".env.example"],
"autoCleanupOnMerge": true
}.claude/ Directory Propagation
.claude/目录的传播
When creating worktrees, the entire directory is copied so agents inherit project-level config:
.claude/.claude/
├── CLAUDE.md # Project instructions (auto-loaded by Claude Code)
├── settings.json # Hooks and permissions
│ ├── hooks.PostToolUse # Auto-format on Write|Edit (e.g., "bun run format || true")
│ └── permissions.allow # Whitelisted bash commands for agents
├── agents/ # Custom subagent definitions
│ ├── build-validator.md # Validates builds pass
│ ├── code-architect.md # Plans implementation
│ ├── code-simplifier.md # Refactors for clarity
│ └── verify-app.md # End-to-end verification
└── PROJECT_CONTEXT.md # Session continuity (project-context-skill)Why this matters:
- CLAUDE.md: Agent reads project conventions, dev commands, tech stack
- Hooks: Auto-formatting runs after every Write/Edit, keeping code consistent across agents
- Permissions: Agents can run pre-approved commands without prompting (e.g., ,
npm test)bun run build - Custom agents: Agents can dispatch subagents (e.g., for end-to-end checks)
verify-app.md
Hook example (settings.json):
json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [{ "type": "command", "command": "bun run format || true" }]
}
]
}
}创建工作树时,整个目录会被复制,以便agents继承项目级配置:
.claude/.claude/
├── CLAUDE.md # 项目说明文档(Claude Code会自动加载)
├── settings.json # 钩子和权限设置
│ ├── hooks.PostToolUse # 在Write|Edit操作后自动格式化(例如:"bun run format || true")
│ └── permissions.allow # agents可执行的Bash命令白名单
├── agents/ # 自定义子agent定义
│ ├── build-validator.md # 验证构建是否通过
│ ├── code-architect.md # 规划实现方案
│ ├── code-simplifier.md # 重构以提升代码清晰度
│ └── verify-app.md # 端到端验证
└── PROJECT_CONTEXT.md # 会话连续性(project-context-skill)为什么这很重要:
- CLAUDE.md:agent会读取项目约定、开发命令、技术栈信息
- 钩子:每次Write/Edit操作后自动执行格式化,确保所有agents的代码一致性
- 权限:agents无需提示即可执行预批准的命令(例如:、
npm test)bun run build - 自定义agents:agents可以调度子agents(例如:用于端到端检查)
verify-app.md
钩子示例(settings.json):
json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [{ "type": "command", "command": "bun run format || true" }]
}
]
}
}Workflows
工作流程
Create Multiple Worktrees
创建多个工作树
User says: "Spin up 3 worktrees for feature/auth, feature/payments, and fix/login-bug"
You do (can parallelize with subagents):
For EACH branch (can run in parallel):
1. SETUP
PROJECT=$(basename $(git remote get-url origin 2>/dev/null | sed 's/\.git$//') || basename $(pwd))
REPO_ROOT=$(git rev-parse --show-toplevel)
BRANCH_SLUG=$(echo "feature/auth" | tr '/' '-')
WORKTREE_PATH=~/tmp/worktrees/$PROJECT/$BRANCH_SLUG
2. ALLOCATE PORTS
Find 2 unused ports from 8100-8199, add to registry
3. CREATE WORKTREE
mkdir -p ~/tmp/worktrees/$PROJECT
git worktree add $WORKTREE_PATH -b $BRANCH
4. COPY PROJECT CONFIG (.claude/ directory)
cp -r .claude $WORKTREE_PATH/ 2>/dev/null || true
Copy .env.local or .env as appropriate
5. CREATE WORKTREE_TASK.md
Create detailed task file for agent
6. INSTALL DEPENDENCIES
Detect package manager, run install command
7. VALIDATE (optional)
Start server, health check, stop
8. REGISTER IN GLOBAL REGISTRY
Update ~/.claude/worktree-registry.json with entry
9. LAUNCH AGENT
ghostty -e "cd $WORKTREE_PATH && claude --model opus --dangerously-skip-permissions"
AFTER ALL COMPLETE:
- Report summary table to user用户请求: "为feature/auth、feature/payments和fix/login-bug创建3个工作树"
执行操作(可通过子agents并行处理):
针对每个分支(可并行执行):
1. 准备工作
PROJECT=$(basename $(git remote get-url origin 2>/dev/null | sed 's/\.git$//') || basename $(pwd))
REPO_ROOT=$(git rev-parse --show-toplevel)
BRANCH_SLUG=$(echo "feature/auth" | tr '/' '-')
WORKTREE_PATH=~/tmp/worktrees/$PROJECT/$BRANCH_SLUG
2. 分配端口
从8100-8199中找到2个未使用的端口,添加到注册表
3. 创建工作树
mkdir -p ~/tmp/worktrees/$PROJECT
git worktree add $WORKTREE_PATH -b $BRANCH
4. 复制项目配置(.claude/目录)
cp -r .claude $WORKTREE_PATH/ 2>/dev/null || true
复制合适的.env.local或.env文件
5. 创建WORKTREE_TASK.md
为agent创建详细的任务文件
6. 安装依赖
检测包管理器,执行安装命令
7. 验证(可选)
启动服务器、健康检查、停止服务器
8. 注册到全局注册表
更新`~/.claude/worktree-registry.json`添加条目
9. 启动agent
ghostty -e "cd $WORKTREE_PATH && claude --model opus --dangerously-skip-permissions"
所有分支处理完成后:
- 向用户报告汇总表格Check Status
查看状态
With script:
bash
~/.claude/skills/worktree-manager/scripts/status.sh
~/.claude/skills/worktree-manager/scripts/status.sh --project my-projectManual:
bash
cat ~/.claude/worktree-registry.json | jq -r '.worktrees[] | "\(.project)\t\(.branch)\t\(.ports | join(","))\t\(.status)"'使用脚本:
bash
~/.claude/skills/worktree-manager/scripts/status.sh
~/.claude/skills/worktree-manager/scripts/status.sh --project my-project手动查看:
bash
cat ~/.claude/worktree-registry.json | jq -r '.worktrees[] | "\(.project)\t\(.branch)\t\(.ports | join(","))\t\(.status)"'Cleanup Worktree
清理工作树
See: for full cleanup procedure.
reference/cleanup-operations.mdQuick cleanup:
bash
~/.claude/skills/worktree-manager/scripts/cleanup.sh <project> <branch> --delete-branch详情参考: 中的完整清理流程
reference/cleanup-operations.md快速清理:
bash
~/.claude/skills/worktree-manager/scripts/cleanup.sh <project> <branch> --delete-branchReference Files
参考文件
For detailed operations, see:
| Topic | File |
|---|---|
| Registry operations | |
| Port allocation | |
| Agent launching | |
| System notifications | |
| Script reference | |
| Cleanup operations | |
| Troubleshooting | |
<safety_guidelines>
如需详细操作说明,请查看:
| 主题 | 文件 |
|---|---|
| 注册表操作 | |
| 端口分配 | |
| Agent启动 | |
| 系统通知 | |
| 脚本参考 | |
| 清理操作 | |
| 故障排除 | |
<safety_guidelines>
Safety Guidelines
安全指南
-
Before cleanup, check PR status:
- PR merged → safe to clean everything
- PR open → warn user, confirm before proceeding
- No PR → warn about unsubmitted work
-
Before deleting branches, confirm if:
- PR not merged
- No PR exists
- Worktree has uncommitted changes
-
Port conflicts: If port in use by non-worktree process, pick different port
-
Environment files: Never commitor
.envto git.env.local
</safety_guidelines>
<example_session>
-
清理前,检查PR状态:
- PR已合并 → 可安全清理所有内容
- PR未合并 → 向用户发出警告,确认后再继续
- 无PR → 警告用户存在未提交的工作
-
删除分支前,确认以下情况:
- PR未合并
- 没有对应的PR
- 工作树中有未提交的更改
-
端口冲突:如果端口被非工作树进程占用,选择其他端口
-
环境文件:绝不要将或
.env提交到git.env.local
</safety_guidelines>
<example_session>
Example Session
示例会话
User: "Spin up 2 worktrees for feature/dark-mode and fix/login-bug"
You:
- Detect project: (from git remote)
obsidian-ai-agent - Detect package manager: (found uv.lock)
uv - Allocate 4 ports:
8100 8101 8102 8103 - Create worktrees:
bash
git worktree add ~/tmp/worktrees/obsidian-ai-agent/feature-dark-mode -b feature/dark-mode git worktree add ~/tmp/worktrees/obsidian-ai-agent/fix-login-bug -b fix/login-bug - Copy .claude/ and .env to each
- Install deps:
(cd <path> && uv sync) - Register both in
~/.claude/worktree-registry.json - Launch agents:
bash
ghostty -e "cd ~/tmp/worktrees/.../feature-dark-mode && claude --model opus --dangerously-skip-permissions" - Report:
Created 2 worktrees with agents: | Branch | Ports | Path | Task | |--------|-------|------|------| | feature/dark-mode | 8100, 8101 | ~/tmp/worktrees/.../feature-dark-mode | Implement dark mode | | fix/login-bug | 8102, 8103 | ~/tmp/worktrees/.../fix-login-bug | Fix login redirect | Both agents running in Ghostty windows.
</example_session>
用户: "为feature/dark-mode和fix/login-bug创建2个工作树"
执行操作:
- 检测项目:(来自git远程仓库)
obsidian-ai-agent - 检测包管理器:(发现uv.lock文件)
uv - 分配4个端口:
8100 8101 8102 8103 - 创建工作树:
bash
git worktree add ~/tmp/worktrees/obsidian-ai-agent/feature-dark-mode -b feature/dark-mode git worktree add ~/tmp/worktrees/obsidian-ai-agent/fix-login-bug -b fix/login-bug - 复制.claude/和.env文件到每个工作树
- 安装依赖:
(cd <path> && uv sync) - 在中注册这两个工作树
~/.claude/worktree-registry.json - 启动agents:
bash
ghostty -e "cd ~/tmp/worktrees/.../feature-dark-mode && claude --model opus --dangerously-skip-permissions" - 向用户报告:
已创建2个带agents的工作树: | 分支 | 端口 | 路径 | 任务 | |--------|-------|------|------| | feature/dark-mode | 8100, 8101 | ~/tmp/worktrees/.../feature-dark-mode | 实现暗黑模式 | | fix/login-bug | 8102, 8103 | ~/tmp/worktrees/.../fix-login-bug | 修复登录重定向问题 | 两个agents均在Ghostty窗口中运行。
</example_session>
Boris Cherny Workflow Integration
Boris Cherny工作流集成
Based on Boris Cherny's (Claude Code creator) 13-step autonomous workflow.
基于Claude Code创造者Boris Cherny的13步自主工作流实现。
iTerm2 Notifications Setup
iTerm2通知设置
Enable system notifications when Claude needs input (Boris runs 5 numbered tabs):
Step 1: iTerm2 Preferences
- iTerm2 → Preferences → Profiles → Terminal
- Enable "Notification when idle"
- Set "After 30 seconds of silence, send notification"
Step 2: Shell Integration (Optional)
bash
undefined当Claude需要输入时启用系统通知(Boris使用5个编号标签页):
步骤1:iTerm2偏好设置
- 打开iTerm2 → 偏好设置 → 配置文件 → 终端
- 启用"空闲时发送通知"
- 设置"静默30秒后发送通知"
步骤2:Shell集成(可选)
bash
undefinedAdd to ~/.zshrc for manual attention requests
添加到~/.zshrc以手动请求关注
it2attention() { printf "\e]1337;RequestAttention=fireworks\a"; }
**Step 3: Tab Numbering**
The launch-agent.sh script automatically numbers iTerm2 tabs as `[1] project - branch`, `[2] project - branch`, etc. when using `--terminal iterm2`.it2attention() { printf "\e]1337;RequestAttention=fireworks\a"; }
**步骤3:标签页编号**
当使用`--terminal iterm2`时,launch-agent.sh脚本会自动将iTerm2标签页编号为`[1] project - branch`、`[2] project - branch`等格式。Web Session Handoff (Teleport)
Web会话移交(Teleport)
Hand off local session to claude.ai/code for longer tasks or mobile monitoring:
bash
undefined将本地会话移交到claude.ai/code以处理更长任务或通过移动端监控:
bash
undefinedIn terminal Claude session, run:
在终端Claude会话中运行:
/teleport
/teleport
Or use ampersand for background handoff:
或使用&在后台移交:
claude & teleport
**Workflow:**
1. Start work in terminal
2. When leaving desk, run `/teleport`
3. Continue from https://claude.ai/code
4. Or check in from Claude iOS app
5. Resume locally: `claude --resume <session-id>`claude & teleport
**工作流:**
1. 在终端开始工作
2. 离开工位时,运行`/teleport`
3. 在https://claude.ai/code继续工作
4. 或通过Claude iOS应用查看进度
5. 在本地恢复会话:`claude --resume <session-id>`Long-Running Autonomous Sessions (Ralph Loop)
长期自主会话(Ralph Loop)
For tasks that need extended autonomous work without intervention:
Step 1: Create worktree
spin up worktree for feature/big-refactorStep 2: Start ralph loop in worktree terminal
/ralph-loop "Implement complete auth system with tests" --max-iterations 10Step 3: Set completion promise (optional)
/ralph-loop "Refactor database layer" --completion-promise "All tests pass and no type errors"How Ralph Loop Works:
- Claude works on the task
- When it tries to exit, the SAME PROMPT is fed back
- Claude sees previous work in files and git history
- Iterates until completion promise is met or max iterations reached
- Use with for fully autonomous operation
--dangerously-skip-permissions
Verification Integration:
bash
/ralph-loop "Implement feature X" --completion-promise "verify-app returns OVERALL: PASS"适用于需要长时间自主工作无需干预的任务:
步骤1:创建工作树
为feature/big-refactor创建工作树步骤2:在工作树终端中启动Ralph Loop
/ralph-loop "实现完整的带测试的认证系统" --max-iterations 10步骤3:设置完成条件(可选)
/ralph-loop "重构数据库层" --completion-promise "所有测试通过且无类型错误"Ralph Loop工作原理:
- Claude处理任务
- 当它尝试退出时,会重新输入相同的提示
- Claude会查看文件和git历史中的之前工作成果
- 迭代直到满足完成条件或达到最大迭代次数
- 配合使用可实现完全自主操作
--dangerously-skip-permissions
验证集成:
bash
/ralph-loop "实现功能X" --completion-promise "verify-app返回OVERALL: PASS"Terminal Strategy
终端策略
| Use Case | Terminal | Why |
|---|---|---|
| Quick interactive work | Ghostty | Fast, clean UI |
| Monitored parallel sessions | iTerm2 | Numbered tabs + notifications |
| Long autonomous tasks | iTerm2 + ralph-loop | Background with alerts |
| CI/CD integration | tmux | Detached sessions |
| 使用场景 | 终端 | 原因 |
|---|---|---|
| 快速交互式工作 | Ghostty | 快速、简洁的UI |
| 受监控的并行会话 | iTerm2 | 编号标签页+通知 |
| 长期自主任务 | iTerm2 + ralph-loop | 后台运行并带提醒 |
| CI/CD集成 | tmux | 分离式会话 |
Daily Workflow Protocol
日常工作流规范
Morning:
bash
undefined早晨:
bash
undefined1. Check worktree status
1. 检查工作树状态
cat ~/.claude/worktree-registry.json | jq '.worktrees[] | select(.status == "active")'
cat ~/.claude/worktree-registry.json | jq '.worktrees[] | select(.status == "active")'
2. Review web sessions at https://claude.ai/code
3. Start primary session
3. 启动主会话
cd ~/tk_projects/<priority-project>
claude --model opus
**Parallel Work:**
```bashcd ~/tk_projects/<priority-project>
claude --model opus
**并行工作:**
```bashSpin up 3 worktrees with iTerm2 tabs
创建3个带iTerm2标签页的工作树
spin up worktrees for feature/a, feature/b, feature/c --terminal iterm2
为feature/a、feature/b、feature/c创建工作树 --terminal iterm2
Or use Ghostty for quick sessions
或使用Ghostty进行快速会话
spin up worktree for fix/quick-bug --terminal ghostty
**End of Day:**
```bash为fix/quick-bug创建工作树 --terminal ghostty
**下班前:**
```bashCheck merged PRs
查看已合并的PR
gh pr list --state merged --author @me --limit 10
gh pr list --state merged --author @me --limit 10
Cleanup merged worktrees
清理已合并的工作树
cleanup merged worktrees
undefined清理已合并的工作树
undefined