aboutsummaryrefslogtreecommitdiff
path: root/hooks/settings-snippet.json
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-11 13:23:13 -0500
committerCraig Jennings <c@cjennings.net>2026-06-11 13:23:13 -0500
commitbdc9a5d6e1320032770f54c747c210e4f465c399 (patch)
tree0ccf24de982248ea5b709afc230526544d59299d /hooks/settings-snippet.json
parent3df14fc985ddad041c290c732b5b5b8eae41f68e (diff)
downloadrulesets-bdc9a5d6e1320032770f54c747c210e4f465c399.tar.gz
rulesets-bdc9a5d6e1320032770f54c747c210e4f465c399.zip
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 "<uname -n> <project>" (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.
Diffstat (limited to 'hooks/settings-snippet.json')
-rw-r--r--hooks/settings-snippet.json6
1 files changed, 6 insertions, 0 deletions
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
@@ -2,6 +2,12 @@
"hooks": {
"SessionStart": [
{
+ "matcher": "startup|resume",
+ "hooks": [
+ { "type": "command", "command": "~/.claude/hooks/session-title.sh" }
+ ]
+ },
+ {
"matcher": "clear",
"hooks": [
{ "type": "command", "command": "~/.claude/hooks/session-clear-resume.sh" }