desktop-sessions-discovery
Skill213 starsChanged 3 days agoMITView on GitHub
Discover, search, and selectively restore Claude desktop app sessions hidden across multiple accountIds. Use when user mentions "missing sessions after account switch", "lost desktop sessions", "where do my old sessions live", or runs multiple Claude accounts on the same machine. Do NOT use for Claude Code CLI session history or resuming work within one session — this only recovers the native desktop app's per-accountId session files; for in-session continuity use handoffs.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 71
Use when the user wants to browse the archive visually.
- Distinctive: line 113
After a verified copy, inspect the current app's documented reload/restart requirement and active work before restarting.
- Very specific: line 154
All four scripts detect platform via sys.platform and pick the right path automatically — no flags needed on Mac.
- Very specific: line 161
Reveal in Finder: after restore: open -R ~/Library/Application\ Support/Claude/claude-code-sessions/<acct>/<org>/local_<sid>.json
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude Desktop Sessions Discovery Toolkit
Claude desktop app (Mac/Windows native) stores sessions per <accountId>/<orgId>/. When you switch accounts, old sessions become invisible in UI — they remain on disk but LocalSessionManager.loadSessions() only reads the active accountId folder.
Related reports: #48511 was opened 2026-04-15 and is closed as not planned; #26452 was opened 2026-02-18 and remains open as checked 2026-09-06. These are version-specific user reports, not proof that the installed build has the same cause or that a fix does not exist.
This skill is a community workaround. Use at your own risk — see Caveats.
Storage paths (reverse-engineered, NOT in official Anthropic docs)
| Install type | Path |
| Win32 .exe install | %APPDATA%\Claude\claude-code-sessions\<acct>\<org>\local_<sid>.json |
| Windows MSIX (Microsoft Store) | %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude-code-sessions\<acct>\<org>\ — issue #48362 reports an atomic-rename failure in a specific environment; verify the current local error before attributing a missing session to it. |
| macOS | ~/Library/Application Support/Claude/claude-code-sessions/<acct>/<org>/local_<sid>.json |
| Legacy (pre-Feb 2026) | same path, but folder name was local-agent-mode-sessions/ |
Source: bundled JS .vite/build/index.js line 771: const $6t="claude-code-sessions". May change in any release.
Schema of local_*.json
{
"sessionId": "uuid",
"cliSessionId": "uuid",
"cwd": "C:\\path\\to\\project",
"originCwd": "...",
"createdAt": <unix ms timestamp OR ISO string>,
"lastActivityAt": <unix ms timestamp OR ISO string>,
"model": "claude-opus-4-7-...",
"effort": "default",
"isArchived": false,
"title": "Human-readable title shown in UI",
"permissionMode": "default",
"remoteMcpServersConfig": [],
"completedTurns": 12
}NB: timestamp format is inconsistent — some sessions use Unix ms (int), others ISO string. Parser must handle both.
Four operations
1. Registry — interactive HTML browse (recommended starting point)
Script: scripts/sessions_registry.py
python "${CLAUDE_SKILL_DIR}/scripts/sessions_registry.py" # generate + auto-open in default browser
python "${CLAUDE_SKILL_DIR}/scripts/sessions_registry.py" --no-open # generate only
python "${CLAUDE_SKILL_DIR}/scripts/sessions_registry.py" --output /custom/path.htmlProduces a self-contained HTML registry with:
- Live JS search by title / cwd / sessionId substring
- Sort by recency / turns count / title A-Z / size
- Filter: hide 0-turn auto-runs ("Morning digest", "Observer daily analysis"), hide already-restored
- Per-accountId collapsible sections, active accountId highlighted green
- Selectable session ID per session — select and copy it; the page does not perform a restore
- "RESTORED" badge for sessions already migrated (read from
~/.claude/desktop-migrations.jsonl) - Includes BOTH
claude-code-sessions/(current) ANDlocal-agent-mode-sessions/(legacy pre-Feb 2026)
Use when the user wants to browse the archive visually. When the user has already selected and authorized a specific restore, the agent performs the scoped dry-run, backup/copy and verification itself through available approved tools; do not assign clipboard/terminal work to the user. A generated restore command is an input to inspect, not authorization by itself.
2. Inventory — full picture (text)
Script: scripts/sessions_inventory.py
Scans all <accountId>/<orgId>/local_*.json, prints grouped table with title/cwd/size/lastActivityAt sorted by recency. Includes cross-account view (which projects appear in multiple accountIds — useful when same user worked on the same project under different accounts).
3. Find — search by title, cwd, or session ID substring (text)
Script: scripts/sessions_find.py
python sessions_find.py "<query>" # substring in title, cwd, or session ID
python sessions_find.py "<query>" --account <prefix> # filter by accountId
python sessions_find.py --since 2026-04-01 # date filter
python sessions_find.py --untitled # parse-failed or emptyOutput is top-N matches sorted by recency, with copy-pasteable restore command.
4. Restore — selective single-session migration
Script: scripts/sessions_restore.py
python sessions_restore.py <sid8> # auto-detect active accountId
python sessions_restore.py <sid8> --to <acct> # explicit target
python sessions_restore.py <sid8> --dry-run # plan onlyBehaviour:
- Find source session by sessionId substring (8 chars usually unique)
- Detect active accountId by latest mtime (heuristic)
- Copy
local_<sid>.jsoninto<targetAcct>/<sameOrgId>/ - Verify byte-for-byte match before declaring success (proof loop)
- Append to
~/.claude/desktop-migrations.jsonlaudit log - Source kept as backup, never deleted
After a verified copy, inspect the current app's documented reload/restart requirement and
active work before restarting. File parity alone does not prove a session is visible or resumable.
The default target-account detection is an mtime heuristic: inspect the signed-in destination
and use explicit --to for an authorized restore; never treat newest mtime as account authority.
Caveats and risks
v2.1.9+ regression (issue #18645)
Historical reports described machine-origin validation. Same-machine success or cross-machine failure from those builds does not establish current compatibility. Check the installed version, actual storage and error before using this workaround; do not predict future validation changes.
Reported disk-image layout (issue #54428)
The linked historical report describes a disk-image storage variant. Discover the installed layout first; these scripts only support the enumerated JSON layouts. Do not manipulate disk images or infer an announced roadmap from an issue. An unsupported layout is a measured limit.
Reported MSIX rename failure (issue #48362)
The issue reports EXDEV during atomic rename in a specific MSIX environment. Check current package version, path and observed error before attributing missing history to it. Do not switch installation channels or claim all Store sessions fail based on that historical report.
Mass merge wrecks UI usability
With 700+ sessions in one accountId, the app's session list becomes unreadable. Prefer selective restore one-at-a-time when you actually need a specific thread.
Recommended long-term
Preserve the project's canonical transcript archive and durable task/handoff state regardless of UI choice. CLI and desktop have different persistence/restore contracts; neither is a substitute for verified backups. Choose a runtime from the required capabilities and observed behavior, not a universal recommendation to move serious work away from desktop.
Files
scripts/sessions_registry.py— interactive HTML registry, opens in browserscripts/sessions_inventory.py— full text table (grep-friendly)scripts/sessions_find.py— substring searchscripts/sessions_restore.py— selective copy with verify and audit log
macOS specifics
All four scripts detect platform via sys.platform and pick the right path automatically — no flags needed on Mac.
- Storage path:
~/Library/Application Support/Claude/claude-code-sessions/<acct>/<org>/local_<sid>.json - Legacy path:
~/Library/Application Support/Claude/local-agent-mode-sessions/<acct>/<org>/local_<sid>.json - HTML auto-open: uses
open <html>(system default browser) - Different packaging: the Windows MSIX report does not establish macOS behavior; verify the installed macOS build and observed error independently.
- Spotlight bonus:
mdfind -onlyin ~/Library/Application\ Support/Claude/ "<query>"works on session JSONs (indexes content), faster thanfindfor one-off lookups - Reveal in Finder after restore:
open -R ~/Library/Application\ Support/Claude/claude-code-sessions/<acct>/<org>/local_<sid>.json
License
Public domain. This is a community session-file discovery and recovery tool; its usefulness depends on the verified local layout and failure, not a universal product-bug diagnosis.
See also
- claude-sync (CLI only): https://github.com/tawanorg/claude-sync
- claude-session-restore (CLI only): https://github.com/ZENG3LD/claude-session-restore
- CLI multi-account guide: https://medium.com/@buwanekasumanasekara/setting-up-multiple-claude-code-accounts-on-your-local-machine-f8769a36d1b1
Other versions1 project uses a version of this.
Word for word · 1
- AnastasiyaW/claude-code-config★ 213100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-harness-designSkill
- agents-best-practicesSkill
- diffusion-engineeringSkill
- flux2-klein-promptingSkill
- flux2-lora-trainingSkill
- forensic-prompt-compilerSkill
- ml-research-labSkill
- notebooklm-grounded-researchSkill
- vlm-segmentationSkill
- feature-newSkill
- harness-designSkill
- layer-newSkill
- plan-swarm-reviewSkill
- pixel-art-storyboardSkill
- pixel-art-studioSkill
- architecture-firstSkill
- architecture-qualitySkill
- bug-reproducerSkill
- code-complexitySkill
- control-cliSkill
- control-uiSkill
- deep-reviewSkill
- deslopSkill
- distill-feedbackSkill
- harness-feedbackSkill
- proof-verifySkill
- refactoring-safelySkill
- repo-mapSkill
- root-cause-deliverySkill
- system-and-data-designSkill
- testing-strategySkill
- thermo-nuclear-code-quality-reviewSkill
- verify-thisSkill
- workflow-orchestrationSkill
- frontend-designSkill
- motion-framerSkill
- ui-designSkill
- ui-ux-pro-maxSkill
- ios-developmentSkill
- lean-codeSkill
- cross-harness-continuationSkill
- deepseek-provider-contractSkill
- epistemic-challengeSkill
- gemini-delegateSkill
- harness-auditSkill
- observability-monitoringSkill
- remote-compute-opsSkill
- plan-to-ticketsSkill
- product-meaning-extractorSkill
- remotion-production-guideSkill
- script-evaluatorSkill
- video-narrative-arcSkill
- video-post-productionSkill
- article-structure-reviewSkill
- cavemanSkill
- humanize-englishSkill
- humanize-russianSkill
- owner-voiceSkill
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.

