[FEATURE] Programmatic session rename API for sidebar titles
Summary
When running multiple concurrent Claude Code sessions in git worktrees, there is no programmatic way to rename the sidebar session title to something meaningful (e.g. PLAT-888 | Fix readme setup flow). Users are forced to rename sessions manually via the UI.
Use Case
With the worktree isolation feature (--worktree / the worktree checkbox in the desktop UI), it's common to have several agents working on different tasks simultaneously. Each session starts with an auto-generated title based on the first message. By the time a Linear issue and branch name are known (mid-session), there is no way for the agent to update the sidebar title to reflect the ticket/branch.
What Was Investigated
Session titles appear in ~/Library/Application Support/Claude/claude-code-sessions/<desktop-id>/<profile-id>/local_<id>.json as a title + titleSource field. However, writing to this file has no effect — the app does not read it for display purposes. It is written by the app but not read by it. The actual source of truth is Electron's internal store (localStorage/IndexedDB), which is not externally accessible.
The .jsonl session transcript also contains {"type":"ai-title","aiTitle":"..."} entries, but these likewise do not update the desktop sidebar.
Requested API
Any of the following would solve this:
- A CLI flag or subcommand:
claude session rename <session-id> <new-title>(or--nameavailable not just at start but also mid-session) - A hook event or environment variable that an agent can write to (e.g.
CLAUDE_SESSION_TITLE=...) - A writable file path that the desktop app watches and reacts to
Context
CLAUDE_CODE_SESSION_ID is available as an environment variable within sessions, which makes the session identifiable. The missing piece is a way to push a title update back into the desktop UI from within a running session.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗