@alexismunozdev/claude-session-topics
v2.6.0
Published
Session topics for Claude Code — auto-set and display a topic in the statusline, change anytime with /set-topic
Maintainers
Readme
claude-session-topics
Session topics for Claude Code. Auto-detect and display a topic in the statusline, change anytime with /set-topic.

Install
npx @alexismunozdev/claude-session-topicsWith color
npx @alexismunozdev/claude-session-topics --color cyanSupported colors: red, green, yellow, blue, magenta (default), cyan, white, orange, grey/gray. Raw ANSI codes are also accepted (e.g., 38;5;208).
What it does
- A Stop hook sets the initial topic automatically after Claude's first response (no model tokens spent)
- The auto-topic skill refines the topic when the conversation shifts
- Shows the topic in the Claude Code statusline (
◆ Topic) - Change the topic anytime with
/set-topic - Composes with existing statusline plugins (doesn't overwrite)
What the installer configures
- Copies the statusline script to
~/.claude/session-topics/ - Installs the Stop hook (
auto-topic-hook.sh) that sets the initial topic - Configures
statusLinein~/.claude/settings.json - Adds bash permission for the script
- Installs
auto-topicandset-topicskills to~/.claude/skills/ - If you already have a statusline, creates a wrapper that shows both
Requirements
jqbash- POSIX-compatible system (macOS, Linux)
Customization
The default topic color is bold magenta. Three ways to change it:
- Re-run with
--color <name>:npx @alexismunozdev/claude-session-topics --color cyan - Edit the config file directly:
echo "cyan" > ~/.claude/session-topics/.color-config - Set the
CLAUDE_TOPIC_COLORenvironment variable:export CLAUDE_TOPIC_COLOR="cyan"
Usage
Auto-topic (automatic)
After Claude's first response, a Stop hook extracts a 2-4 word topic from your first message using lightweight heuristics (no model tokens spent). The auto-topic skill then monitors the conversation and updates the topic when you shift to a different subject.
/set-topic (manual)
Change the topic at any time:
/set-topic Fix Login Bug
/set-topic API RedesignHow it works
Session starts
|
Claude sends first response
|
Stop hook (auto-topic-hook.sh) extracts topic from first user message
|
Writes topic to ~/.claude/session-topics/${SESSION_ID}
|
auto-topic skill monitors for conversation shifts and updates topic
|
Statusline script reads the topic file → displays: ◆ TopicThe Stop hook runs after each model response and uses heuristics to extract the initial topic from the transcript. On subsequent messages, the auto-topic skill handles topic updates when the conversation shifts. The statusline script receives the session ID via stdin JSON, reads the corresponding topic file, and renders it with ANSI color codes.
Uninstall
npx @alexismunozdev/claude-session-topics --uninstallLicense
MIT
