claude-code - 💡(How to fix) Fix `claude agents` — allow choosing the working directory when starting a new agent from the TUI [4 comments, 3 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#58738Fetched 2026-05-14 03:40:43
View on GitHub
Comments
4
Participants
3
Timeline
10
Reactions
0
Assignees
Timeline (top)
commented ×4labeled ×3assigned ×1mentioned ×1
RAW_BUFFERClick to expand / collapse

Problem

Currently the only way to start an agentic session that is scoped to a particular project is to:

  1. open a new terminal,
  2. cd into the project directory,
  3. launch claude (or claude --bg) there,
  4. and only then the session shows up under that project in claude agents / ~/.claude/projects/<encoded-cwd>/.

There is no way to start a new agent from inside the claude agents TUI itself and tell it which directory to run in. The TUI lets you view, resume and delete existing sessions, but "new agent" is missing entirely — and the implicit CWD of whatever shell happens to be running claude agents is not necessarily where you want the new session to live.

Desired behavior

In the claude agents TUI, add a "new agent" action (e.g. Ctrl+N) that opens a directory picker:

  • prepopulated with the list of directories already present under ~/.claude/projects/ (every project where Claude has been used before),
  • with a "browse / type a path" option to pick an arbitrary folder,
  • optionally a "current shell CWD" shortcut.

After picking a folder, the new session starts with that folder as its CWD, just as if the user had cd'd there and run claude --bg manually. It then appears in claude agents under the corresponding project, and its transcript is written to ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl accordingly.

Why

  • claude agents is becoming the central hub for multi-project agent work (especially after --bg and the background service in 2.1.139). Not being able to start anything from there forces a context switch to a shell every time.
  • For users with 10–30 projects, jumping to a terminal, cd-ing, and re-launching claude just to spawn a new session in a known directory is the slowest part of the workflow.
  • Pairs naturally with #58672 (per-project scoping of the agents view) — if the view is project-scoped, "new agent" should also let you pick the project.

Related

  • #58672 — scope claude agents view to current project / CWD
  • #58725 — /resume should include background sessions
  • #58591 — --cwd flag for claude --resume

Thanks!

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