find-session
Skill1 starsChanged 34 days agoMITView on GitHub
Finds a past Claude Code session by what was said in it — words from a prompt the user typed, a compaction summary or the session's name — across every repo on this machine, and gives the claude --resume command that reopens it. Runs the script bundled with the skill over the transcripts on disk, ranks one prompt holding every term above terms scattered through a long session, and reports how far back the transcripts reach, since an older session is gone. Naming the current session is /rename; running and background sessions are claude agents.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- TJaenichen/claude-code-harnesstheir own version, first seen Nov 15, 2026
- WingedGuardian/x4-ai-toolkittheir own version, first seen Nov 8, 2026
- WingedGuardian/skyrimvr-claude-toolkittheir own version, first seen Nov 8, 2026
- theyoungastronauts/polaristheir own version, first seen Nov 1, 2026
- ooooooooooooooooooop/agent-toolstheir own version, first seen Oct 22, 2026
- ooooooooooooooooooop/personal-aitheir own version, first seen Oct 22, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- fleurytian/awesome-claude-skills★ 316same name
- WingedGuardian/skyrimvr-claude-toolkit★ 22same name
- kauffj/agent-config★ 8same name
- ooooooooooooooooooop/agent-tools★ 4same name
- ooooooooooooooooooop/personal-ai★ 4same name
- theyoungastronauts/polaris★ 4same name
- FooJiaYin/dev-skills★ 2same name
- LiozShor/claude-code-skills★ 2same name
- WingedGuardian/x4-ai-toolkit★ 2same name
- Aman-Kothari7/claude-code-skills★ 0same name
2 more not listed
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 repository38 other files it gives its agents.
- claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- author-skillSkill
- drift-auditSkill
- drift-handoffSkill
- drift-updateSkill
- test-skillSkill
- triageSkill
- fabric-iqSkill
- fabric-catalog-governanceSkill
- fabric-deploySkill
- fabric-rest-apiSkill
- fabric-securitySkill
- fabric-variable-librarySkill
- fabric-databaseSkill
- fabric-dataflowSkill
- fabric-data-pipelineSkill
- fabric-sparkSkill
- fabric-warehouse-monitoringSkill
- fabric-warehouseSkill
- fabric-activatorSkill
- fabric-eventhouseSkill
- fabric-event-schema-setSkill
- fabric-eventstreamSkill
- fabric-realtime-dashboardSkill
- learnSkill
- fabric-semantic-model-auditSkill
- fabric-tmdlSkill
- pbip-project-structureSkill
- pbir-report-workflowSkill
- linkedin-highlightsSkill
- msix-packagingSkill
- code-reviewSkill
- commitSkill
- landSkill
- prune-branchesSkill
- recreate-repoSkill
- run-briefsSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 95
Add --probes if it may have been a test run.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Finding a past session
The user remembers a session by what happened in it — "there was a
session where I was exploring…" — and wants it back. Its name is a weak
index: Claude Code titles a session once, from its first prompt, so one
that wandered keeps the title of where it began (each of 233 titled
sessions held exactly one title, 2026-10-06). The bundled script reads
the words instead, in every transcript under ~/.claude/projects/, from
every repo on this machine.
1. Search
uv run --no-project ~/.claude/skills/find-session/scripts/find-session.py <term> <term> ...- Every term must appear in the session, as a substring, ignoring
case: in its name, a prompt the user typed, or a compaction summary.
Take two or three of the user's own distinctive words, not a
paraphrase; a common word matches most of the store. Words given after
/find-sessionare the terms. - Keep
--no-project. Without it,uv runin a repo that has its own Python project syncs that project first. The script needs no dependencies. - Drop a leading
/. Git Bash rewrites/test-skillintoC:/Program Files/Git/test-skillbefore the script sees it, quoted or not, and the search answers0 of … sessions matched, exit 1, which reads as an honest miss (2026-10-06). The script records a typed command as/test-skill prune-branches, sotest-skillfinds it. PowerShell passes the slash intact, and expands the~path as well.
2. Read the hits
2026-09-29 23:18 agent-config contributing-md
prompt: …ood point. I always wanted to rename and group my Claude Code sessions to keep better track of them. Is there …
claude --resume 053abce6-857e-4d2b-b5d8-77150b3e4e75
12 of 212 sessions matched, first 2 shown; oldest transcript written 2026-09-29; times are local- The first line is the last activity in local time, the repo (the
folder the session ran in, a worktree counted as its repo) and the
session's name: one set by
/rename,-nor a hook, else Claude Code's title, else the start of the first prompt. - The second says where every term met:
name,prompt,summaryorreply.some terms; the rest elsewheremeans no one passage holds them all and the session matched only as a whole, which a long compaction summary makes common: a weak hit. - The first hit is the tightest, not the newest. Hits rank by where every term met, a name, then one prompt, one summary, one reply, then scattered, and newest first within each.
- The asking session is left out. Its own prompt holds the terms, so
the script drops the transcript
CLAUDE_CODE_SESSION_IDnames, which Claude Code sets in both its shells (2026-10-06). - The last line gives the reach: the day the oldest transcript on disk was last written. That bounds a transcript's last write, not its session's last activity: Claude Code writes title and state records after a session's last prompt, so a hit can predate the reach, as one last active 2026-09-24 did beside a reach of 2026-09-29 (2026-10-06).
3. Narrow or widen
--repo <folder>keeps one repo, by its folder name; its worktrees count as it.--days <n>keeps transcripts written in the last n days.--limit <n>shows n hits, 10 by default; the last line counts them all.--repliessearches Claude's text too, for what Claude said rather than what the user typed.--probesbrings back probe sessions, left out by default: a working directory in the temp folder, or a name startingprobe:.--jsonprints the hits for parsing:session_id,title,repo,cwd,branch,first_active,last_active,matchandresume. Its stamps are UTC, where the text's times are local, and it prints no reach.
4. When nothing matches
Exit 1 with 0 of … sessions matched is a miss. Before calling the
session lost:
- Retry with fewer terms, or the user's other words for the subject; a
word only Claude used needs
--replies. - Add
--probesif it may have been a test run. - Then read the reach. A session last active before the summary's
date is most likely gone, but not certainly, since the date bounds the
oldest transcript's last write, not its last activity (§2): say it is
most likely gone, and why. Claude Code deletes transcripts older than
cleanupPeriodDays, 30 days by default, and the store can hold less than the setting says once a lower value has run: 7 days against 15 on 2026-10-06, after the setting had been turned down for a while. Do not search the transcripts by hand.
Exit 2 has two meanings, told apart by stderr. the transcript format
may have changed means the script read transcripts and found not one
prompt in them, which is how a release changing Claude Code's internal
transcript format shows. Report that, and do not grep the transcripts as
a stand-in.
A usage: line means a bad flag. no transcripts under <path>, exit 1,
means the store is empty.
5. Report
- The top hit or two: name, repo, last activity, the passage that
matched, and its
claude --resume <id>. Say so when the best hit is only scattered. claude --resume <id>works from any folder: Claude Code looks in the current project and its worktrees, then every other project on this machine (2.1.223 or later). Whether VS Code opens a session by its id was not checked (2026-10-06).- Never Read a transcript whole to answer from it. It holds every
tool result: on 2026-10-06 the median was 623 KB and the largest
36.6 MB. To learn what a session concluded, search again with
--repliesand words from the answer, or resume it.
Constraints
- Reads only. This skill renames, resumes and deletes no session.
- Not this skill: naming the current session is
/rename. Live sessions areListAgentsfrom inside a session, and background onesclaude agentsfrom a terminal, whosen:<text>filter (2.1.287) and Ctrl+F match names and tasks, not what was said. - Out of reach: subagent transcripts, under
<project>/<session>/subagents/, which the script does not read, and any session whose transcript is not under~/.claude/projects/on this machine, such as a cloud session's.
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.

