# `scout worktree`

Inspect or remove clean, merged Scout worktrees in one project.

- Group: Operation
- Page: https://openscout.app/cli/worktree
- Markdown: https://openscout.app/cli/worktree.md

Example:

```sh
scout worktree list
```

Illustrative response, simplified. Not live output and not an API contract; run the command with `--json` for structured output where it is supported.

```text
[Lists project worktrees and their retirement eligibility]
```

Help (`scout worktree --help`):

```text
Usage:
  scout worktree list [--project <path>] [--base <ref>] [--json]
  scout worktree gc [--project <path>] [--base <ref>] [--dry-run] [--json]

Inspect or remove Git worktrees directly under <project>/.scout-worktrees/.
The project defaults to the current directory. The base defaults to origin/main, then main, then HEAD.
GC keeps dirty, unmerged and locked worktrees. It also checks the local runtime for active sessions.
If the runtime is unavailable, verify that no agents are using the worktrees before running GC.
GC never forces removal or branch deletion. Ignored files do not count as changes.
Use gc --dry-run to preview removal without changing files or Git metadata.
Use scout worktrees for the runtime's idle retirement policy.
```

---

All commands: https://openscout.app/cli.md · Previous: https://openscout.app/cli/worktrees.md · Next: https://openscout.app/cli/browser.md
