# list_worktrees_prompt

list_worktrees_prompt inspects git worktrees under the trees/ folder, detects active process ports, and outputs a runtime status report.

- command · `type=command` · Claude Code, Cursor, Codex, GitHub Copilot, Gemini CLI · ★ 1573 repo stars
- Author: disler
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/disler/claude-code-hooks-multi-agent-observability/tree/HEAD/.claude/commands/list_worktrees_prompt.md
- Updated: 2026-02-08
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/list-worktrees-prompt

## What it 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.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/list_worktrees_prompt.md` — Call it with /list_worktrees_prompt. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/list_worktrees_prompt.md` — Call it with /prompts:list_worktrees_prompt. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/list_worktrees_prompt.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/list_worktrees_prompt.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/disler/claude-code-hooks-multi-agent-observability/tree/HEAD/.claude/commands/list_worktrees_prompt.md

## When to use it
- track active and stopped branches stored in `trees/`
- inspect occupied server and client ports across worktrees
- detect missing `node_modules` folders before starting services
- generate ready-to-run terminal commands for process control

## Example prompts
- /list_worktrees_prompt
- List all git worktrees in `trees/` and check their running ports
- Audit active worktrees and verify client dependencies

## Similar
- [clean-worktrees](https://affpapa.org/en/nevibecode/commands/clean-worktrees.md) — command · ★ 6529 repo stars
- [git-worktrees](https://affpapa.org/en/nevibecode/skills/git-worktrees.md) — skill · 1200 installs
- [create-worktrees](https://affpapa.org/en/nevibecode/plugins/create-worktrees.md) — plugin · ★ 2858 repo stars
- [using-git-worktrees](https://affpapa.org/en/nevibecode/skills/using-git-worktrees.md) — skill · 217153 installs
- [branch-finish](https://affpapa.org/en/nevibecode/skills/branch-finish.md) — skill · 2600 installs
- [git-worktree-manager](https://affpapa.org/en/nevibecode/skills/git-worktree-manager.md) — skill · 581 installs

From the same set: [disler/claude-code-hooks-multi-agent-observability](https://affpapa.org/en/nevibecode/by/disler/claude-code-hooks-multi-agent-observability.md) — 20 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
