discover_claude_sessions
Scan Claude Code project directories to identify active sessions, decode paths, and optionally register them as subprojects for multi-repo intelligence.
Instructions
Scan ~/.claude/projects for projects Claude Code has touched on this machine, decode each directory name back to its absolute path, and report which ones still exist plus session-file count and last activity. With add_as_subprojects=true, every existing project is registered as a subproject in one call — useful for spinning up multi-repo intelligence after a fresh clone.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scan_root | No | Override the scan root (default: ~/.claude/projects) | |
| exclude_current | No | Exclude the current project from results (default: true) | |
| only_existing | No | Drop entries whose decoded path no longer exists on disk (default: true) | |
| limit | No | Max sessions to return, most recently active first (default: 50) | |
| add_as_subprojects | No | Register every discovered project as a subproject in one shot (default: false) |