Your task
Name the current session so it appears in the statusline and is saved for future reference.
The argument provided is: {{ args }}
Steps
Get the session name — use the argument if provided, otherwise ask the user with AskUserQuestion: "What name do you want to give this session?"
Find the current session ID — run:
ls -t ~/.claude/projects/*/*.jsonl 2>/dev/null | head -1 | xargs basename | sed 's/\.jsonl$//'Save the session name:
mkdir -p ~/.claude/session_notes echo "<name>" | tee ~/.claude/session_notes/<session_id>Confirm — tell the user the session is named and will appear in the statusline (📌 ) after the next response.
Note
This is separate from Claude Code's built-in /rename command which renames the session in the UI sidebar.
Use /name to tag the session so the statusline always reminds you what you're working on.
You can use both: /rename for the sidebar, /name for the statusline.