Skip to content

[FEATURE] Auto-assign sessions to groups based on working directory #59982

Closed

Description

@berkay-cimen

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/myapp": "myapp",
"/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 myapp" }],
"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

Activity

  1. github-actions commented on May 17, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. Group recent sessions in sidebar by project / working directory #56067
    2. [FEATURE] Group sessions by project folder and show explicit date/time #55980
    3. Feature Request: Session folders/grouping in Claude Code Desktop sidebar #38036

    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

  2. amorriscode commented on May 20, 2026

    @amorriscode
    Contributor

    You can group by project in the sidebar.

    CleanShot.2026-05-20.at.14.35.32.mp4
  3. github-actions commented on Jul 10, 2026

    @github-actions

    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.

  4. locked as resolved and limited conversation to collaborators on Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions