`claude agents` — expand `@` dispatch autocomplete to include non-git folders and folders without visible sessions

Status Open
Maintainer reply ✓ Yes — bogini
Activity 6 comments · opened May 13, 2026
💡 Likely answer: A maintainer (bogini, collaborator) responded on this thread — see the highlighted reply below.

Background

Originally this issue asked for a way to start a new agent session in an arbitrary folder from inside the claude agents TUI, without dropping into a shell to cd and run claude manually.

@bogini (comment) pointed out that the dispatch input at the bottom of claude agents already partially covers this: typing @<repo> <prompt> starts a session in that repo.

That works well for the common case, but it leaves a specific gap, which is what this issue now tracks.

Current behavior of @ autocomplete

The @ autocomplete in the dispatch input only offers:

  1. Git repos that are siblings of wherever claude agents was launched (i.e. directories at the same level as the launch CWD that contain a .git), and
  2. Repos of sessions that are already visible in the current list.

The remaining gap

This means dispatch via @ cannot reach:

  • Non-git folders — plain working directories without a .git (notes folders, docs repos managed by other VCS, scratch dirs, etc.).
  • Folders that aren't siblings of the launch directory — anything elsewhere on disk, e.g. ~/work/... when claude agents was launched in ~/projects/....
  • Folders that don't yet have any agent session in the list — i.e. new projects where no session has ever been started, which is exactly the situation where the "open a terminal and cd there" round-trip is most painful.

So the original pain point — "start a session in a brand new project without leaving the TUI" — is only partially solved.

Desired behavior

Extend the @ autocomplete (and / or add a dedicated "new agent in folder X" action) so that the dispatchable set also includes:

  1. Non-git folders in the autocomplete candidates.
  2. All folders under ~/.claude/projects/ — every directory where Claude has been used before, regardless of whether it's a git repo or a sibling of the launch CWD.
  3. A "browse / type an arbitrary path" option for folders that have never been used with Claude before, so a fresh project is reachable without a shell round-trip.

The end-state behavior should be the same as today's @<repo> dispatch: after picking the folder, the new session starts with that folder as its CWD, appears in claude agents grouped under that folder, and writes its transcript to ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl.

Why

  • For users running 10–30 projects (often a mix of git repos, non-git working dirs, and brand-new projects), the current autocomplete set is too narrow to reliably avoid the terminal round-trip.
  • The pain is most acute exactly where the gap is: new projects, where no session exists yet, and non-code folders (docs, notes, ops scratch) that aren't git repos.
  • Confirmed not unique — see @thnk2wn's comment: "some of my working folders aren't git repos and I'd love to be able to use claude agents more globally and not think much about where I launched it from."

Related

  • #58672 — claude agents --cwd (filtering the view, shipped in v2.1.141)
  • #58725 — /resume should include background sessions
  • #58591 — --cwd flag for claude --resume

View original on GitHub ↗

6 Comments

github-actions[bot] · 3 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/54614
  2. https://github.com/anthropics/claude-code/issues/47017
  3. https://github.com/anthropics/claude-code/issues/50302

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

zentrolink-ivanzhukov · 3 months ago

Small follow-up / current workaround for anyone hitting this:

I confirmed that the way to get a new session to show up under the right project in claude agents today is:

  1. open a separate terminal,
  2. cd into the target folder,
  3. launch claude there,
  4. send that session to background (so it becomes a background agent).

It then appears immediately in the claude agents list, already grouped under the corresponding project / folder it was launched from.

So the feature requested above is purely about removing this terminal round-trip — the desired end-state (session grouped under the picked folder in claude agents) is already exactly what backgrounding a session from inside the right CWD produces; the TUI just needs to let you do step 1–3 from within itself.

bogini collaborator · 3 months ago

You can do this today from the dispatch input at the bottom of claude agents — type @ to mention a repo, then your prompt:

@my-app investigate the failing test

The @ autocomplete shows git repos: sibling repos under wherever you launched claude agents, plus the repo of every session already visible in the list. So if you run claude agents from ~/projects/ and have ~/projects/my-app as a git repo, @my-app dispatches a new session there.

The ? help overlay lists this as "@ to mention". v2.1.141 also added claude agents --cwd <path> to scope the view to a directory.

What's not covered: targeting an arbitrary path that isn't a git repo in the autocomplete set. If that's the gap you're hitting, that'd be the remaining feature request.

zentrolink-ivanzhukov · 3 months ago

Thanks @bogini — @<repo> does cover part of this, but it has a key limitation that's exactly the case my request was about.

The @ autocomplete only offers:

  1. git repos that are siblings of wherever claude agents was launched, and
  2. repos of sessions already visible in the list.

So it works great for switching between projects where I already have agent sessions running — but it doesn't help with the original pain point: starting a session in a new project, one that:

  • isn't a sibling of the launch directory, AND
  • doesn't yet have any agent session in the list.

That's still a "drop into a shell, cd, run claude" round-trip, which is what I wanted to remove.

I'd be happy to narrow this issue down to that specific gap:

@ autocomplete in the dispatch input should also include: - non-git folders, and - folders that aren't siblings of the launch directory and don't yet have a session in the list (e.g. all folders under ~/.claude/projects/, plus a "browse / type an arbitrary path" option).

Want me to update the title and description to that scoped version, or is it better tracked as a separate issue?

thnk2wn · 3 months ago

I'd love this as well since some of my working folders aren't git repos and I'd love to be able to use claude agents more globally and not think much about where I launched it from. If a primary intent is to help prevent all the terminal tabs then this only partially helps me when doing multiple agents on the same repo or multiple git repos that happen to share the same parent.

I was also expecting / hoping to see past agent sessions show up under completed so I can easily resume past sessions before the agent view came out but that's a separate one-time issue.

zentrolink-ivanzhukov · 3 months ago

Updated the title and description to reflect the narrowed scope (non-git folders + folders without visible sessions in the list).

@thnk2wn — thanks for confirming, your case is exactly the gap this now tracks.