rename-sessions
Skill32 starsChanged 3 months agoMITView on GitHub
Batch-rename past agent sessions of the current project to `MMDD|TYPE|Topic` (date from creation time in Asia/Shanghai, 8 fixed type codes, topic from content). Works on Claude Code, qodercli and Codex session stores, from any of the three hosts. Use when the user says rename sessions, rename conversations, tidy the session list, clean up the resume picker, or batch rename sessions.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- collectifweb/claude-skillstheir own version, first seen Oct 17, 2026
- trifle-labs/skillstheir own version, first seen Feb 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- collectifweb/claude-skills★ 4same name
- trifle-labs/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- create-skillSkill
- karpathy-3d-storySkill
The file
Files
Rename sessions
Renames past sessions of the current project to MMDD|TYPE|Topic. Titles only. Nothing else in any store is touched.
Script
scripts/main.ts sits next to this file. The host announces the directory as "Base directory for this skill"; in Claude Code it is also ${CLAUDE_SKILL_DIR}, in qodercli ${QODER_SKILL_DIR}. Always run it as bun <that dir>/scripts/main.ts. Run --help for all flags.
Target
First argument: claude, qoder, codex, or all. If omitted, the script uses the host it runs in (CLAUDE_CODE_SESSION_ID → claude, QODER_SESSION_ID → qoder, CODEX_THREAD_ID → codex) and errors if none is set. Pass --cwd to target another project.
Flow
- List:
bun <dir>/scripts/main.ts list --tool <t> [--cwd <path>] [--limit 30] [--min-user 2]Prints JSON per store:id,created(ISO),dateandmmdd(already Asia/Shanghai),title,titleSource,userMessages,excerpt(first user prompts, last assistant message). Live sessions, the current session, tiny sessions, and already formatted titles are excluded and counted inskipped. - Decide one title per session from
excerptusing the rules below. Leave out any session whose topic is unclear. Print only this table and stop:
| Session | Created | Before | After |
Sessionis the first 8 characters of the id,Createdisdate. Wait for confirmation. Write nothing before it.- Apply: save the plan as
[{"id": "...", "title": "..."}]to a temp file, thenbun <dir>/scripts/main.ts apply --tool <t> --plan <file>. Report only the counts the script prints: written, skipped, failed, with reasons for the last two.
Title rules
- Format
MMDD|TYPE|Topic, full-width bar|. - TYPE codes, English by default, Chinese only when the user passes
--zh, never mixed in one run: FEA/功能 feature · DES/设计 design · FIX/修复 bug fix · OPT/优化 optimization · REL/发布 release · EXP/探索 exploration · DOC/文档 docs · RES/研究 research - Topic: what the session actually did. Short, specific, fits a sidebar, no project name.
- Unclear topic: leave the session out of the plan. Never guess.
What the script guarantees
- Claude Code and qodercli: appends one
custom-titlerecord to the transcript and restores the file mtime so picker order does not change. Checks an existing record's shape first and refuses to write if the transcript format has changed. Skips sessions listed as live in~/.claude/sessionsor~/.qoder/sessions. - Codex: talks to
codex app-serverover stdio and callsthread/name/set, the same path the app uses. No direct sqlite writes. Lists interactive threads only, which is what the picker shows;codex execruns are left alone. The desktop app refreshes on its next catalog scan; restart it if a name does not show.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

