From bdc9a5d6e1320032770f54c747c210e4f465c399 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 11 Jun 2026 13:23:13 -0500 Subject: feat(hooks): title sessions "host project" for the remote session list Remote sessions showed up on claude.ai/code and mobile under auto-generated names, so picking the right one meant guessing. Claude Code 2.1.152+ lets a SessionStart hook set the title via hookSpecificOutput.sessionTitle. hooks/session-title.sh emits " " (ratio rulesets, velox work) on startup and resume. Project is the git-toplevel basename so a session started in a subdirectory still names the project, with the cwd basename as fallback. The hook stays silent when a title already exists, so a /rename or an earlier run isn't clobbered on resume. The harness ignores titles on clear and compact, so the settings matcher restricts to startup|resume. Wired in settings.json and the install-hooks snippet. As a default hook it reaches every machine through make install on the next session start. --- hooks/settings-snippet.json | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hooks/settings-snippet.json') diff --git a/hooks/settings-snippet.json b/hooks/settings-snippet.json index 1be5f00..a5f9d9c 100644 --- a/hooks/settings-snippet.json +++ b/hooks/settings-snippet.json @@ -1,6 +1,12 @@ { "hooks": { "SessionStart": [ + { + "matcher": "startup|resume", + "hooks": [ + { "type": "command", "command": "~/.claude/hooks/session-title.sh" } + ] + }, { "matcher": "clear", "hooks": [ -- cgit v1.2.3