Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins-claude/session/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "session",
"version": "4.4.0",
"version": "4.5.0",
"description": "Work session management — issue-driven and freeform doors sharing an explore-then-plan spine, with multi-agent orchestration and a review-gated PR finalizer",
"author": {
"name": "Logan Gagne"
Expand Down
54 changes: 54 additions & 0 deletions plugins-claude/session/scripts/rename-session
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
# Rename the active Claude Code session for the current CWD.
# Usage: rename-session <new-name>
set -euo pipefail
Comment on lines +1 to +4

NEW_NAME="${1:-}"
if [[ -z "$NEW_NAME" ]]; then
echo "Usage: rename-session <new-name>" >&2
exit 1
fi

CWD="$(pwd)"
SESSIONS_DIR="$HOME/.claude/sessions"

# Find the session file for this CWD
SESSION_FILE=""
for f in "$SESSIONS_DIR"/*.json; do
[[ -f "$f" ]] || continue
if jq -e --arg cwd "$CWD" '.cwd == $cwd' "$f" >/dev/null 2>&1; then
SESSION_FILE="$f"
break
fi
done

if [[ -z "$SESSION_FILE" ]]; then
echo "rename-session: no active session found for cwd=$CWD" >&2
exit 1
fi

SESSION_ID=$(jq -r '.sessionId' "$SESSION_FILE")
if [[ -z "$SESSION_ID" || "$SESSION_ID" == "null" ]]; then
echo "rename-session: could not read sessionId from $SESSION_FILE" >&2
exit 1
fi

# Encode CWD: replace every / with - (leading / becomes leading -)
ENCODED_CWD=$(echo "$CWD" | sed 's|/|-|g')
JSONL_PATH="$HOME/.claude/projects/${ENCODED_CWD}/${SESSION_ID}.jsonl"
Comment on lines +36 to +38

if [[ ! -f "$JSONL_PATH" ]]; then
echo "rename-session: session JSONL not found: $JSONL_PATH" >&2
exit 1
fi

# Append custom-title record — this is what /rename writes
jq -nc --arg n "$NEW_NAME" --arg s "$SESSION_ID" \
'{"type":"custom-title","customTitle":$n,"sessionId":$s}' >> "$JSONL_PATH"

# Patch the live PID file so the UI updates immediately
TEMP=$(mktemp)
jq --arg n "$NEW_NAME" '.name = $n' "$SESSION_FILE" > "$TEMP"
rm -f "$SESSION_FILE" && mv "$TEMP" "$SESSION_FILE"
Comment on lines +50 to +52

echo "Session renamed to: $NEW_NAME"
12 changes: 8 additions & 4 deletions plugins-claude/session/skills/session-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,14 @@ begin-work spine (explore → plan). To start from your own description instead,
number — the linkage lives in the PR's `Closes #N`, which is what auto-closes
the issue on merge.

6. **Rename this session** — invoke the built-in rename via the `Skill` tool
(`skill: "rename"`, no args) so the session title reflects the issue being
worked on. The rename auto-generates a short descriptive name from the current
conversation context — call it now, while the issue title and summary are fresh.
6. **Rename this session** — call the rename script using the base name from
step 5 (the `<type>-<slug>` you just built):

```bash
bash ${CLAUDE_PLUGIN_ROOT}/scripts/rename-session "<base-name>"
```

Call this now, while the issue title and summary are fresh.

### Phase 3 — Run the spine

Expand Down
12 changes: 8 additions & 4 deletions plugins-claude/session/skills/session-start/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ issues instead, use `/session:session-issue`; for a read-only status view, use
- **Freeform** → base name `wip-<kebab-slug>` (3-5 word slug from the description).
No issue linked; the description is the context.

4. **Rename this session** — invoke the built-in rename via the `Skill` tool
(`skill: "rename"`, no args). Call it regardless of whether this is new work
or a continuation — the description from Phase 0 is in context and the rename
auto-generates a short descriptive name from it.
4. **Rename this session** — call the rename script using the base name from
step 3 (the `<type>-<slug>` or `wip-<kebab-slug>` you just built):

```bash
bash ${CLAUDE_PLUGIN_ROOT}/scripts/rename-session "<base-name>"
```

Call this regardless of whether it is new work or a continuation.

### Phase 2 — Run the spine

Expand Down
2 changes: 1 addition & 1 deletion plugins-copilot/session/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "session",
"version": "4.4.0",
"version": "4.5.0",
"description": "Work session management — issue-driven and freeform doors sharing an explore-then-plan spine, with multi-agent orchestration and a review-gated PR finalizer",
"author": {
"name": "Logan Gagne"
Expand Down
Loading