From f537150ff3f67899d27a7f121bc302f61a307c1c Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 13 Jun 2026 13:49:21 -0500 Subject: feat(hooks): title sessions host-project with a hyphen, no space The SessionStart hook joined host and project with a space ("ratio rulesets"), which reads as two words in the claude.ai/code and mobile session lists. I changed the join to "$host-$project" ("ratio-rulesets") so the title is one token, and updated the three session-title-hook.bats expectations test-first. --- scripts/tests/session-title-hook.bats | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/tests/session-title-hook.bats') diff --git a/scripts/tests/session-title-hook.bats b/scripts/tests/session-title-hook.bats index 60b633d..5ce8b6a 100644 --- a/scripts/tests/session-title-hook.bats +++ b/scripts/tests/session-title-hook.bats @@ -1,6 +1,6 @@ #!/usr/bin/env bats # hooks/session-title.sh — SessionStart hook that titles the session -# " " (uname -n + git-toplevel basename, cwd basename outside +# "-" (uname -n + git-toplevel basename, cwd basename outside # a repo) so remote sessions are identifiable on web/mobile. It only sets a # title when the session doesn't have one yet: a /rename or an earlier run # must not be clobbered on resume. @@ -25,13 +25,13 @@ run_hook() { fi } -@test "titles host + repo basename inside a git repo" { +@test "titles host-repo basename inside a git repo" { git -C "$TMPDIR_T" init -q -b main mkdir -p "$TMPDIR_T/sub/dir" run run_hook "$TMPDIR_T" [ "$status" -eq 0 ] title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle') - [ "$title" = "$HOST $(basename "$TMPDIR_T")" ] + [ "$title" = "$HOST-$(basename "$TMPDIR_T")" ] } @test "uses the repo toplevel basename from a subdirectory" { @@ -40,7 +40,7 @@ run_hook() { run run_hook "$TMPDIR_T/sub/dir" [ "$status" -eq 0 ] title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle') - [ "$title" = "$HOST $(basename "$TMPDIR_T")" ] + [ "$title" = "$HOST-$(basename "$TMPDIR_T")" ] } @test "falls back to cwd basename outside a git repo" { @@ -48,7 +48,7 @@ run_hook() { run run_hook "$TMPDIR_T/chime" [ "$status" -eq 0 ] title=$(echo "$output" | jq -r '.hookSpecificOutput.sessionTitle') - [ "$title" = "$HOST chime" ] + [ "$title" = "$HOST-chime" ] } @test "emits valid SessionStart hookSpecificOutput" { -- cgit v1.2.3