list_worktrees_prompt — Claude Code command: overview and setup
list_worktrees_prompt inspects git worktrees under the trees/ folder, detects active process ports, and outputs a runtime status report.
no license ★ 1,573 updated 2026-02-08
.claude/commands/list_worktrees_prompt.mdWhat list_worktrees_prompt does
The prompt executes git worktree list and filters entries residing inside the trees/ folder. For each workspace, it reads .env files located in apps/server/ and apps/client/ to gather port assignments such as SERVER_PORT and VITE_PORT alongside database and WebSocket settings.
Process states are evaluated by querying lsof against designated ports, which captures process IDs for running services. The prompt also verifies if node_modules folders are present, helping catch missing packages before startup.
The routine explicitly expects workspaces inside trees/ containing apps/server and apps/client directories; projects with a different layout will trigger missing configuration warnings.
What it helps with
- track active and stopped branches stored in
trees/ - inspect occupied server and client ports across worktrees
- detect missing
node_modulesfolders before starting services - generate ready-to-run terminal commands for process control
Example prompts for the agent
- /list_worktrees_prompt
- List all git worktrees in
trees/and check their running ports - Audit active worktrees and verify client dependencies
How to install list_worktrees_prompt
Manually: put the files in place
.claude/commands/list_worktrees_prompt.mdCall it with /list_worktrees_prompt. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/list_worktrees_prompt.mdCall it with /prompts:list_worktrees_prompt. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/list_worktrees_prompt.prompt.mdManually: put the files in place
.gemini/commands/list_worktrees_prompt.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about list_worktrees_prompt
How to install list_worktrees_prompt in Claude Code?
Place the prompt file at .claude/commands/list_worktrees_prompt.md within your project repository.
What does list_worktrees_prompt do?
It lists git worktrees located in trees/, reads port configurations from .env files, detects running PIDs with lsof, and summarizes the overall state.
What project architecture is required?
It expects git worktrees positioned in trees/<branch-name> with separated apps/server and apps/client directories.