← ClaudeAtlas

session-namelisted

Assign or update a short label describing what this Claude Code session is currently doing, stored in a per-session sidecar file so status_line.sh and the tab title can show it
YoniChechik/claude-code-config · ★ 0 · Data & Documents · score 65
Install: claude install-skill YoniChechik/claude-code-config
Sets (or re-sets) the current session's display name: a short, human-readable label stored in a per-session sidecar file. `status_line.sh` and the tab-title mechanism read only this file — there is no fallback to the branch/worktree name or to Claude Code's own native `session_name` field. Safe to re-run any number of times in one session as the topic drifts; each run is a fresh decision, not a one-time setup step. ## Step 1: Guard the session id ```bash if [[ -z "${CLAUDE_CODE_SESSION_ID:-}" ]]; then echo "Error: CLAUDE_CODE_SESSION_ID is unset; cannot set a session name." >&2 exit 1 fi ``` Every file this skill touches is keyed on this exact env var, matching the convention `ci-watcher` and `_notify.sh` already use for their own `/tmp/*_<slot>` files. ## Step 2: Load the shared helpers and read the currently-stored name `scripts/_notify.sh` holds the ONE implementation of this feature's sanitize-and-cap contract. Source it and use it — never re-inline a copy of the sanitize logic here, in `status_line.sh`, or anywhere else. ```bash source ~/.claude/scripts/_notify.sh STORED_NAME=$(_session_name_read "$CLAUDE_CODE_SESSION_ID") ``` `_session_name_read` returns the stored name already sanitized and capped, and returns empty for every "no usable name" case: missing file, empty file, a non-regular file, or content that sanitizes down to nothing. ## Step 3: The sanitize-and-cap contract `_sanitize_and_cap "<text>"` (from the same sourced file) is the one contract