[FEATURE] /sessions command to list named sessions

Resolved 💬 3 comments Opened Mar 20, 2026 by samuelrajan747 Closed Mar 23, 2026

Preflight Checklist

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

Problem Statement

There's no built-in way to list all named Claude Code sessions. When using /rename to name sessions or starting them with claude --name, the names are stored but there's no command to retrieve them.

The /resume picker exists but shows all sessions — named and unnamed — in a long scrollable list. There's no way to filter to just the sessions you've intentionally named. When you have 100+ sessions across multiple projects and worktrees, finding the one you named auth-refactor three days ago means scrolling through dozens of unnamed sessions mixed in.

When working across multiple worktrees and branches simultaneously, I frequently name sessions to track what each one is for. But after a few days, I forget which sessions exist, what branches they were on, and what their session IDs are. The naming system is great for resuming — but only if you can remember what you named things.

Proposed Solution

A built-in /sessions command (or claude --list-sessions) that outputs a table of all named sessions with metadata:

| Name | Branch | Session ID | Project | Date |
|------|--------|-----------|---------|------|
| auth-refactor | feature/auth | 13110118-... | my-app | 2026-03-20 |
| fix-api-routes | bugfix/routes | ae1bc63f-... | my-app | 2026-03-19 |

The data is already available — customTitle, gitBranch, and cwd are all stored in the session JSONL files under ~/.claude/projects/. It just needs a command to surface it.

Flags could include:

  • --json for machine-readable output
  • --project <name> to filter by project
  • --format table|json for output format

Alternative Solutions

I built a project-level /named-sessions command that does this via a Python script scanning ~/.claude/projects/*/*.jsonl for customTitle fields. It works but:

  • It's a per-project command, not globally available
  • It relies on Python and file system knowledge of Claude's internals
  • It breaks if the session storage format changes
  • The /resume picker already has this data internally — it just doesn't expose it as a filterable/listable command

named-sessions.md

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

  1. I'm working on a project with 4 active worktrees (main, feature/auth, bugfix/api, redesign)
  2. Each worktree has 1-2 named Claude sessions for different tasks
  3. I want to resume work on the "auth-refactor" session but can't remember which branch it was on
  4. I run /sessions and immediately see all my named sessions with their branches and projects
  5. I pick the right one and run claude --resume auth-refactor

Additional Context

Session metadata fields already available in JSONL:

  • customTitle — set by both /rename and --name
  • gitBranch — captured at session start
  • cwd — working directory at session start

The interactive /resume picker already reads this data — this feature request is about making it available as a non-interactive, listable command that filters to only named sessions.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗