Skip to content

fix(session): replace Skill(rename) with direct JSONL rename script#158

Merged
st0nefish-ci[bot] merged 1 commit into
masterfrom
fix/session-rename-without-skill-tool
Jun 21, 2026
Merged

fix(session): replace Skill(rename) with direct JSONL rename script#158
st0nefish-ci[bot] merged 1 commit into
masterfrom
fix/session-rename-without-skill-tool

Conversation

@St0nefish

Copy link
Copy Markdown
Owner

Summary

  • Skill(rename) is a UI-only command — the harness rejects programmatic calls with "rename is a UI command, not a skill"
  • Investigated Claude Code session storage: session titles live as custom-title records in ~/.claude/projects/<cwd>/<uuid>.jsonl, and the live display name is cached in ~/.claude/sessions/<pid>.json
  • Added scripts/rename-session which finds the active session by CWD, appends the custom-title record, and patches the PID file for immediate UI update — all without user interaction
  • Updated session-start (step 4) and session-issue (step 6) to call the script with the base name already built in the prior step

Test plan

  • Run /session:start with a freeform description — session title updates automatically to wip-<slug> without /rename prompt
  • Run /session:issue with an issue number — session title updates to <type>-<slug> without /rename prompt
  • Verify rename-session handles no active session gracefully (exits non-zero with message)
  • Verify session title persists after session close (check JSONL for custom-title record)

🤖 Generated with Claude Code

Skill(rename) is a UI command that cannot be invoked programmatically —
the harness rejects it with "rename is a UI command, not a skill." Replace
it with a session-local script that renames the session without user input.

- Add scripts/rename-session: finds the active session by CWD match in
  ~/.claude/sessions/<pid>.json, appends a custom-title record to the
  session JSONL, and patches the live PID file for immediate UI update
- Update session-start step 4: call rename-session with the base name
  already built in step 3 (<type>-<slug> or wip-<kebab-slug>)
- Update session-issue step 6: call rename-session with the <type>-<slug>
  base name already built in step 5
- Bump version 4.4.0 → 4.5.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 21, 2026 19:52
@St0nefish St0nefish self-assigned this Jun 21, 2026
@st0nefish-ci st0nefish-ci Bot enabled auto-merge June 21, 2026 19:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the previous Skill(rename)-based session renaming (which the harness rejects programmatically) with a plugin-local Bash script that updates Claude Code’s on-disk session metadata, and updates the session workflow skills to call that script.

Changes:

  • Added plugins-claude/session/scripts/rename-session to rename the active Claude Code session by appending a custom-title JSONL record and patching the live session cache file.
  • Updated session-start and session-issue skill procedures to call the new rename script using the base name computed earlier in each flow.
  • Bumped the session plugin version to 4.5.0 in both Claude and Copilot plugin manifests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
plugins-copilot/session/.claude-plugin/plugin.json Version bump to publish the updated session plugin.
plugins-claude/session/.claude-plugin/plugin.json Version bump to publish the updated session plugin.
plugins-claude/session/skills/session-start/SKILL.md Switch session renaming step to call scripts/rename-session.
plugins-claude/session/skills/session-issue/SKILL.md Switch session renaming step to call scripts/rename-session.
plugins-claude/session/scripts/rename-session New script implementing non-interactive session renaming via Claude’s local session files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +38
# 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 +50 to +52
TEMP=$(mktemp)
jq --arg n "$NEW_NAME" '.name = $n' "$SESSION_FILE" > "$TEMP"
rm -f "$SESSION_FILE" && mv "$TEMP" "$SESSION_FILE"
Comment on lines +1 to +4
#!/usr/bin/env bash
# Rename the active Claude Code session for the current CWD.
# Usage: rename-session <new-name>
set -euo pipefail
@st0nefish-ci st0nefish-ci Bot merged commit abf12f0 into master Jun 21, 2026
7 checks passed
@st0nefish-ci st0nefish-ci Bot deleted the fix/session-rename-without-skill-tool branch June 21, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants