Feature request: --name flag or SessionStart hook support for /rename

Resolved 💬 3 comments Opened Apr 9, 2026 by bslavin Closed Apr 13, 2026

Feature Request

What: Allow sessions to be named at launch or via hooks, not just interactively.

Why: When working across multiple projects, every session starts as "Untitled" until you manually /rename it. This is friction that adds up — especially when you have 5+ sessions open and they all say the same thing.

Ideal solution (pick any):

Option A: --name CLI flag

claude --name freshdesk-ai

Simple, composable, works with shell aliases:

# ~/.zshrc
alias cc='claude --name "$(basename $PWD)"'

Option B: Allow hooks to execute /rename

A SessionStart hook that can trigger /rename would let users auto-name sessions based on directory, git branch, or any other context:

{
  "hooks": {
    "SessionStart": [{
      "hooks": [{
        "type": "command",
        "command": "echo '{\"rename\": \"'$(basename $PWD)'\"}'",
        "timeout": 5
      }]
    }]
  }
}

Option C: sessionName in settings.json

A per-project setting that names sessions automatically:

// .claude/settings.json
{ "sessionName": "${basename}" }

Current workaround: Manually typing /rename freshdesk-ai at the start of every session. Works but tedious.

Context: Working on a multi-repo project (orchestrator + 3 agent repos) where I frequently switch between sessions. Auto-naming by directory would eliminate the cognitive overhead of figuring out which session is which.

View original on GitHub ↗

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