claude agents: add workspace scoping to filter sessions by directory
Status Fixed / completed
Maintainer reply ✓ Yes — bogini
Activity 6 comments · opened May 11, 2026 · closed May 12, 2026
💡 Likely answer: A maintainer (bogini, collaborator)
responded on this thread — see the highlighted reply below.
Summary
claude agents shows all background sessions globally. There's no way to scope the view to sessions started from a specific workspace or directory.
When working across multiple projects, the session list gets noisy. It would be helpful to filter sessions by the directory they were started in.
Proposed behavior
Add a flag (e.g. --cwd or --workspace) to filter sessions by their working directory:
# Show only sessions started from the current directory
claude agents --cwd .
# Show only sessions started from a specific path
claude agents --cwd ~/code/my-project
Alternatively, claude agents could default to showing sessions from the current directory, with a --all flag to show everything.
Current behavior
claude agents always shows all background sessions regardless of which directory it's run from.
6 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The global view is useful for a bird's eye, but the default should probably be scoped to the cwd you opened it from. That's almost always what you want when you're heads-down in a project.
--allfor the rare cross-project check makes more sense than the reverse.It already does. press
ctrl + sCtrl+S groups by directory, but it still shows every session globally. The ask here is to filter, not group. If I have 20 sessions across 5 repos and I'm working in one of them, I want to see only those sessions, not all 20 organized into 5 buckets.
This is shipping in v2.1.141 —
claude agents --cwd <path>scopes the view to sessions whose dispatch origin is<path>or a subdirectory. Worktree-dispatched jobs are matched against their parent project (so a job running in~/projects/my-app/.claude/worktrees/foostill shows under--cwd ~/projects/my-app).Thanks for the request!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.