claude-code - 💡(How to fix) Fix [FEATURE] Auto-assign sessions to groups based on working directory

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…
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Problem I work on multiple projects in parallel and use Claude Code's session groups to keep them organized in the sidebar. Today, the only automatic grouping is by fork lineage (/branch / --fork-session). Every fresh session I start in a project folder lands ungrouped, and I have to drag it into the right group manually.

With 3+ active projects, this becomes constant overhead — and easy to forget, which defeats the point of groups.

Why this matters Session groups only deliver value if they reflect how I think about my work (per-project), and that mapping is stable and obvious — it's the folder I'm cd'd into. Manual assignment is the worst of both worlds: the data the system needs is already present, but it asks me to re-enter it every session.

Environment Claude Code CLI on macOS (Darwin 25.3.0) Model: Opus 4.7

Proposed Solution

Proposed solution Let users map a working directory (cwd) to a group name in settings.json. When a session starts in (or under) that directory, it's automatically assigned to that group.

{ "sessionGroups": { "/Users/berk/Desktop/paff": "paff", "/Users/berk/code/acme-web": "acme", "~/work/side-projects": "side" } } Match should be longest-prefix wins, and ~ should expand.

Alternative (or complement) Expose group assignment to the SessionStart hook so users can script arbitrary logic (e.g. derive group from git remote, branch name, or a .claude/group file):

{ "hooks": { "SessionStart": [{ "hooks": [{ "type": "command", "command": "echo paff" }], "output": "sessionGroup" }] } } The hook's stdout becomes the group name.

Alternative Solutions

No response

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

No response

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

claude-code - 💡(How to fix) Fix [FEATURE] Auto-assign sessions to groups based on working directory