Allow SessionStart hook to set session name via hookSpecificOutput
Problem
When running multiple parallel Claude Code sessions (e.g., one per project goal), the VS Code session picker becomes unusable. Sessions are named by truncating the first user message, producing indistinguishable entries like:
- yo so how do we stop requiring approvals for...
- agent builder: so i think we should consider...
- Build in public: let's make this a thread for...
The /rename command exists but is interactive-only -- agents cannot call it programmatically.
Proposed Solution
Add a sessionName field to the SessionStart hook's hookSpecificOutput:
This would let teams with structured workflows (goal-based sessions, project-scoped work) automatically name sessions based on context -- without requiring the user to manually type /rename every time.
Use Case
We run an agentic infrastructure where each session is scoped to a business goal (Product, Marketing, BI, etc.). Our SessionStart hook already reads the goal dashboard and injects context. Being able to also set the session name would make the VS Code picker immediately navigable:
- [PRODUCT] Pipeline Acceleration
- [META] Hook Architecture
- [BIP] LinkedIn Content
Alternatives Considered
- Injecting a /rename suggestion via additionalContext -- works but requires manual user action every session
- Naming convention in first message -- fragile, depends on user discipline
- Third-party extensions (Claude Chats) -- adds dependency for basic UX
Environment
- Claude Code VS Code extension
- Windows 11
- Multiple parallel sessions via goal-routing system
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗