claude-code - 💡(How to fix) Fix Feature request: scope `claude agents` view to current project / CWD [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#58672Fetched 2026-05-14 03:42:23
View on GitHub
Comments
3
Participants
2
Timeline
9
Reactions
1
Assignees
Timeline (top)
commented ×3labeled ×3assigned ×1closed ×1

Code Example

cd ~/projects/foo
claude agents
# → shows sessions from ~/projects/foo, ~/projects/bar, ~/work/baz, etc., all mixed together
RAW_BUFFERClick to expand / collapse

Problem

When running claude agents from inside a project directory, the agent session list currently shows all agentic sessions across all projects on the machine. There is no way to filter the list to the project I'm currently in.

For users who run Claude across many unrelated projects (different repos, different working directories), this makes the list unusable as a per-project task tracker. The view conflates contexts that should be kept separate.

Current behavior

cd ~/projects/foo
claude agents
# → shows sessions from ~/projects/foo, ~/projects/bar, ~/work/baz, etc., all mixed together

Desired behavior

By default, claude agents invoked from a directory shows only sessions whose original CWD matches the current project root (or current working directory).

Optional flags to broaden the view explicitly:

  • claude agents --all — current behavior (every session, every project)
  • claude agents --scope=cwd — only sessions started in the exact current directory
  • claude agents --scope=project (default) — sessions whose CWD is under the current project root, detected via nearest .git parent or similar
  • claude agents --scope=global — same as --all

A config key in ~/.claude/settings.json could set the default scope (agents.defaultScope: "project" | "cwd" | "global").

Why

  • Each project has its own conversational context, its own goals, its own tasks. Mixing them obscures rather than informs.
  • It's the natural mental model — every other dev tool that lists "open work" (VS Code recent, JetBrains projects, git status, tmux sessions) operates within a project scope by default.
  • For users running 10–30 projects with concurrent Claude sessions, the global list rapidly becomes unreadable.

Related

  • claude --bg and the background service introduced in 2.1.139 make multi-project agent work much more practical. Per-project scoping in the agents view is the natural completion of that workflow.

Thanks for considering!

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING