@alexismunozdev/claude-session-topics 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -11
- package/hooks/hooks.json +39 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -20,7 +20,8 @@ Supported colors: `red`, `green`, `yellow`, `blue`, `magenta` (default), `cyan`,
|
|
|
20
20
|
|
|
21
21
|
## What it does
|
|
22
22
|
|
|
23
|
-
-
|
|
23
|
+
- A Stop hook sets the initial topic automatically after Claude's first response (no model tokens spent)
|
|
24
|
+
- The auto-topic skill refines the topic when the conversation shifts
|
|
24
25
|
- Shows the topic in the Claude Code statusline (`◆ Topic`)
|
|
25
26
|
- Change the topic anytime with `/set-topic`
|
|
26
27
|
- Composes with existing statusline plugins (doesn't overwrite)
|
|
@@ -28,10 +29,11 @@ Supported colors: `red`, `green`, `yellow`, `blue`, `magenta` (default), `cyan`,
|
|
|
28
29
|
## What the installer configures
|
|
29
30
|
|
|
30
31
|
1. Copies the statusline script to `~/.claude/session-topics/`
|
|
31
|
-
2.
|
|
32
|
-
3.
|
|
33
|
-
4.
|
|
34
|
-
5.
|
|
32
|
+
2. Installs the Stop hook (`auto-topic-hook.sh`) that sets the initial topic
|
|
33
|
+
3. Configures `statusLine` in `~/.claude/settings.json`
|
|
34
|
+
4. Adds bash permission for the script
|
|
35
|
+
5. Installs `auto-topic` and `set-topic` skills to `~/.claude/skills/`
|
|
36
|
+
6. If you already have a statusline, creates a wrapper that shows both
|
|
35
37
|
|
|
36
38
|
## Requirements
|
|
37
39
|
|
|
@@ -60,7 +62,7 @@ The default topic color is bold magenta. Three ways to change it:
|
|
|
60
62
|
|
|
61
63
|
### Auto-topic (automatic)
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
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.
|
|
64
66
|
|
|
65
67
|
### /set-topic (manual)
|
|
66
68
|
|
|
@@ -76,16 +78,18 @@ Change the topic at any time:
|
|
|
76
78
|
```
|
|
77
79
|
Session starts
|
|
78
80
|
|
|
|
79
|
-
|
|
81
|
+
Claude sends first response
|
|
80
82
|
|
|
|
81
|
-
|
|
83
|
+
Stop hook (auto-topic-hook.sh) extracts topic from first user message
|
|
82
84
|
|
|
|
83
|
-
|
|
85
|
+
Writes topic to ~/.claude/session-topics/${SESSION_ID}
|
|
84
86
|
|
|
|
85
|
-
|
|
87
|
+
auto-topic skill monitors for conversation shifts and updates topic
|
|
88
|
+
|
|
|
89
|
+
Statusline script reads the topic file → displays: ◆ Topic
|
|
86
90
|
```
|
|
87
91
|
|
|
88
|
-
The statusline script receives the session ID via stdin JSON, reads the corresponding topic file, and renders it with ANSI color codes.
|
|
92
|
+
The 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.
|
|
89
93
|
|
|
90
94
|
## Uninstall
|
|
91
95
|
|
package/hooks/hooks.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"type": "command",
|
|
8
|
+
"command": "COLOR='${user_config.topic_color}'; [ -n \"$COLOR\" ] && mkdir -p \"$HOME/.claude/session-topics\" && echo \"$COLOR\" > \"$HOME/.claude/session-topics/.color-config\" || true"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "command",
|
|
12
|
+
"command": "S=$(ls \"$HOME/.claude/plugins/cache/claude-session-topics/claude-session-topics\"/*/scripts/auto-setup.sh 2>/dev/null | tail -1); [ -n \"$S\" ] && bash \"$S\" || true"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"PermissionRequest": [
|
|
18
|
+
{
|
|
19
|
+
"matcher": "Bash",
|
|
20
|
+
"hooks": [
|
|
21
|
+
{
|
|
22
|
+
"type": "command",
|
|
23
|
+
"command": "S=$(ls \"$HOME/.claude/plugins/cache/claude-session-topics/claude-session-topics\"/*/scripts/auto-allow.sh 2>/dev/null | tail -1); [ -n \"$S\" ] && bash \"$S\" || true"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"Stop": [
|
|
29
|
+
{
|
|
30
|
+
"hooks": [
|
|
31
|
+
{
|
|
32
|
+
"type": "command",
|
|
33
|
+
"command": "S=$(ls \"$HOME/.claude/plugins/cache/claude-session-topics/claude-session-topics\"/*/scripts/auto-topic-hook.sh 2>/dev/null | tail -1); [ -n \"$S\" ] && bash \"$S\" || true"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexismunozdev/claude-session-topics",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Session topics for Claude Code — auto-set and display a topic in the statusline, change anytime with /set-topic",
|
|
5
5
|
"bin": {
|
|
6
6
|
"claude-session-topics": "bin/install.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"bin/",
|
|
10
|
+
"hooks/",
|
|
10
11
|
"scripts/",
|
|
11
12
|
"skills/",
|
|
12
13
|
"LICENSE",
|