@alexismunozdev/claude-session-topics 2.0.0 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexismunozdev/claude-session-topics",
3
- "version": "2.0.0",
3
+ "version": "2.0.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"
@@ -6,20 +6,10 @@ input=$(cat)
6
6
  # ── Parse JSON
7
7
  SESSION_ID=$(echo "$input" | jq -r '.session_id // ""')
8
8
 
9
- # ── PID→Session bridge
9
+ # ── Write active session file
10
10
  if [ -n "$SESSION_ID" ]; then
11
- echo "$SESSION_ID" > "/tmp/claude-pid-${PPID}"
12
- fi
13
-
14
- # ── Pick up pending topic from /set-topic
15
- PENDING="/tmp/claude-pending-topic-${PPID}"
16
- if [ -n "$SESSION_ID" ] && [ -f "$PENDING" ]; then
17
- PENDING_TOPIC=$(cat "$PENDING" 2>/dev/null || echo "")
18
- if [ -n "$PENDING_TOPIC" ]; then
19
- mkdir -p "$HOME/.claude/session-topics"
20
- echo "$PENDING_TOPIC" > "$HOME/.claude/session-topics/${SESSION_ID}"
21
- rm -f "$PENDING"
22
- fi
11
+ mkdir -p "$HOME/.claude/session-topics"
12
+ echo "$SESSION_ID" > "$HOME/.claude/session-topics/.active-session"
23
13
  fi
24
14
 
25
15
  # ── Topic
@@ -74,8 +64,6 @@ CLEANUP_LOCK="/tmp/.claude-topic-cleanup-lock"
74
64
  if mkdir "$CLEANUP_LOCK" 2>/dev/null; then
75
65
  trap "rmdir '$CLEANUP_LOCK' 2>/dev/null || true" EXIT
76
66
  find "$HOME/.claude/session-topics" -type f -mtime +7 -delete 2>/dev/null || true
77
- find /tmp -maxdepth 1 -name "claude-pid-*" -mtime +1 -delete 2>/dev/null || true
78
- find /tmp -maxdepth 1 -name "claude-pending-topic-*" -mtime +1 -delete 2>/dev/null || true
79
67
  rmdir "$CLEANUP_LOCK" 2>/dev/null
80
68
  fi
81
69
 
@@ -27,7 +27,7 @@ This skill activates on **every user message**. Run it silently — do not menti
27
27
  ### Step 1: Read the current topic
28
28
 
29
29
  ```bash
30
- SESSION_ID=$(cat /tmp/claude-pid-$PPID 2>/dev/null)
30
+ SESSION_ID=$(cat "$HOME/.claude/session-topics/.active-session" 2>/dev/null)
31
31
  if [ -n "$SESSION_ID" ]; then
32
32
  TOPIC_FILE="$HOME/.claude/session-topics/${SESSION_ID}"
33
33
  CURRENT_TOPIC=$(cat "$TOPIC_FILE" 2>/dev/null || echo "")
@@ -52,7 +52,7 @@ DO update when:
52
52
  If the topic has meaningfully changed, run:
53
53
 
54
54
  ```bash
55
- SESSION_ID=$(cat /tmp/claude-pid-$PPID 2>/dev/null)
55
+ SESSION_ID=$(cat "$HOME/.claude/session-topics/.active-session" 2>/dev/null)
56
56
  if [ -n "$SESSION_ID" ]; then
57
57
  mkdir -p "$HOME/.claude/session-topics"
58
58
  echo "Your New Topic" > "$HOME/.claude/session-topics/${SESSION_ID}"
@@ -68,5 +68,5 @@ If the topic has NOT meaningfully changed, **do nothing** — skip the write ent
68
68
  - Run this on **every** user message, but only write when the topic has genuinely changed
69
69
  - Do NOT mention the topic to the user — ever
70
70
  - Keep topics short and descriptive (2-4 words, max 20 characters)
71
- - If the statusline hasn't run yet (no PID file), skip silently
71
+ - If the statusline hasn't run yet (no `.active-session` file), skip silently
72
72
  - A high bar for "meaningfully changed" prevents unnecessary churn — when in doubt, keep the current topic
@@ -21,14 +21,13 @@ Set or change the topic displayed in the Claude Code statusline.
21
21
  3. Run this bash command to discover the session ID and write the topic file:
22
22
 
23
23
  ```bash
24
- SESSION_ID=$(cat /tmp/claude-pid-$PPID 2>/dev/null)
24
+ SESSION_ID=$(cat "$HOME/.claude/session-topics/.active-session" 2>/dev/null)
25
25
  if [ -n "$SESSION_ID" ]; then
26
26
  mkdir -p "$HOME/.claude/session-topics"
27
27
  echo "$ARGUMENTS" > "$HOME/.claude/session-topics/${SESSION_ID}"
28
28
  echo "Topic set to: $ARGUMENTS"
29
29
  else
30
- echo "$ARGUMENTS" > "/tmp/claude-pending-topic-$PPID"
31
- echo "Topic queued: $ARGUMENTS (will appear on next statusline refresh)"
30
+ echo "Error: No active session found. The statusline must run at least once before setting a topic."
32
31
  fi
33
32
  ```
34
33