Agent skill

Desktop Sessions Discovery

by AnastasiyaW in AnastasiyaW/codex-claude-code-config

Discover, search, and selectively restore Claude desktop app sessions hidden across multiple accountIds.

MITAuto-check passed

Install Desktop Sessions Discovery

skills CLI
$ npx skills add AnastasiyaW/codex-claude-code-config --skill desktop-sessions-discovery -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AnastasiyaW/codex-claude-code-config desktop-sessions-discovery --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AnastasiyaW/codex-claude-code-config.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/operational/desktop-sessions-discovery .claude/skills/desktop-sessions-discovery && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
desktop-sessions-discovery
GitHub stars
154
Token cost
~2.4k tokens
SKILL.md length
862 words
Files
6 (incl. scripts)
Skills in repo
50
Repo updated
First seen
Licence
MIT

At a glance

Discover, search, and selectively restore Claude desktop app sessions hidden across multiple accountIds.

  • Works in 4 steps: Registry — interactive HTML browse… → Inventory — full picture (text) → Find — search by title, cwd, or session… → …
  • User mentions missing sessions after account switch
  • SKILL.md covers Storage paths…, Schema of local_*.json, Four operations and Caveats and risks, plus 5 more sections
  • Runs Python scripts from its folder; calls python

What it does

Desktop Sessions Discovery is an agent skill from AnastasiyaW/codex-claude-code-config. 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.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts (for example `scripts/sessions_find.py`, `scripts/sessions_inventory.py` and `scripts/sessions_registry.py`).

The repository describes itself as: Claude Code, Codex, and multi-agent configuration system: principles, hooks, skills, and workflow patterns for AI-assisted development. The licence is MIT.

When your agent uses it

  • User mentions missing sessions after account switch
  • Lost desktop sessions
  • Where do my old sessions live
  • Runs multiple Claude accounts on the same machine

Example prompts

  • “missing sessions after account switch”
  • “lost desktop sessions”
  • “where do my old sessions live”
  • “/desktop-sessions-discovery”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Registry — interactive HTML browse (recommended starting point)
  2. Inventory — full picture (text)
  3. Find — search by title, cwd, or session ID substring (text)
  4. Restore — selective single-session migration

What it can do on your machine

Read from SKILL.md and the folder at commit 3601289. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 5 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • medium.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Desktop Sessions Discovery loads about 2.4k tokens when it runs. Until then it costs about 126 tokens; SKILL.md has 862 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~126
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from AnastasiyaW/codex-claude-code-config at commit 3601289, republished under its MIT licence (© AnastasiyaW). 862 words, ~2,371 tokens.

Download SKILL.mdSave it as .claude/skills/desktop-sessions-discovery/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
desktop-sessions-discovery
description
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.

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 typePath
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

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

Script: scripts/sessions_registry.py

bash
python scripts/sessions_registry.py                # generate + auto-open in default browser
python scripts/sessions_registry.py --no-open      # generate only
python scripts/sessions_registry.py --output /custom/path.html

Produces 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) AND local-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

bash
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 empty

Output is top-N matches sorted by recency, with copy-pasteable restore command.

4. Restore — selective single-session migration

Script: scripts/sessions_restore.py

bash
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 only

Behaviour:

  1. Find source session by sessionId substring (8 chars usually unique)
  2. Detect active accountId by latest mtime (heuristic)
  3. Copy local_<sid>.json into <targetAcct>/<sameOrgId>/
  4. Verify byte-for-byte match before declaring success (proof loop)
  5. Append to ~/.claude/desktop-migrations.jsonl audit log
  6. 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

Show full SKILL.md (363 more words)Show less
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.

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 browser
  • scripts/sessions_inventory.py — full text table (grep-friendly)
  • scripts/sessions_find.py — substring search
  • scripts/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 than find for 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

© AnastasiyaW, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts) in skills/operational/desktop-sessions-discovery of AnastasiyaW/codex-claude-code-config.

  • SKILL.md
  • scripts/sessions_find.py
  • scripts/sessions_inventory.py
  • scripts/sessions_registry.py
  • scripts/sessions_restore.py
  • scripts/test_sessions_find.py

Open the folder on GitHubat commit 3601289

Compare with similar skills

Desktop Sessions Discovery next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Desktop Sessions Discovery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Desktop Sessions Discovery this skillAnastasiyaW/codex-claude-code-config154—~2.4kAutomated safety check: PassMIT
Restore Legacy Sessionszai-org/ZCode7.7k—~1.2kAutomated safety check: PassApache-2.0
Session Compaction And Restoremvschwarz/openrig6.8k—~2.2kAutomated safety check: PassApache-2.0
Context Restoregarrytan/gstack136k—~10kAutomated safety check: NotesMIT
Session Handoffsickn33/agentic-awesome-skills47k—~1.8kAutomated safety check: NotesMIT
Fal Restorenexu-io/open-design100k—~302Automated safety check: PassApache-2.0

Similar skills

  • A skill your agent uses when ZCode needs to inspect, plan, or execute restoration of old ACP-era ZCode sessions from ~/.zcode/v2/sessions into the new ZCode task/session stores.

    7.7k GitHub stars~1.2k tokensUpdated yesterday
    DatabasesAuto-check passed
  • A skill your agent uses when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs…

    6.8k GitHub stars~2.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Restore

    garrytan/gstack

    Reloads the most recent saved working state so you can continue a task after a break, a new session or a switch between workspaces.

    136k GitHub stars~10k tokensUpdated today
    Agent WorkflowsAuto-check: notes
  • Session Handoff

    sickn33/agentic-awesome-skills

    A skill your agent uses when context approaches capacity, before /clear or /compact, when switching tasks, or when ending a coding session: produces a structured handoff artifact for the next session.

    47k GitHub stars~1.8k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check: notes
  • Fal Restore

    nexu-io/open-design

    Restore and fix image quality — deblur, denoise, fix faces, and restore old documents using fal.ai's hosted restoration models.

    100k GitHub stars~302 tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • Session Persist

    ruvnet/ruflo

    Persist and restore agent sessions across conversations with state snapshots

    74k GitHub stars~415 tokensUpdated yesterday
    Auto-check: notes

More from AnastasiyaW/codex-claude-code-config

All 50 skills in this repo
  • Bug Reproducer

    AnastasiyaW/codex-claude-code-config

    Find likely software bugs in a codebase, rank concrete bug candidates, and prove or reject them with focused regression tests before proposing a fix.

    154 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Motion Framer

    AnastasiyaW/codex-claude-code-config

    A skill your agent uses when implementing Motion or Framer Motion in React/JavaScript: interactive UI components, micro-interactions, gestures, layout or page transitions, and scroll-based animation.

    154 GitHub starsUsed in 1 repo~5.2k tokens
    Auto-check passed
  • Proof Verify

    AnastasiyaW/codex-claude-code-config

    Plan-based verification - freeze acceptance criteria before building, then verify after with an independent fresh-context agent (the builder must not verify their own work).

    154 GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Workflow Orchestration

    AnastasiyaW/codex-claude-code-config

    Написание и запуск Claude Code dynamic workflows (JS-оркестратор субагентов).

    154 GitHub stars~3.8k tokensUpdated today
    Auto-check passed
  • Notebooklm Grounded Research

    AnastasiyaW/codex-claude-code-config

    A skill your agent uses when: NotebookLM, notebooklm MCP, large documentation sets, courses, books, papers, or citation-backed research are mentioned.

    154 GitHub stars~2.4k tokensUpdated today
    Auto-check: warnings
  • Deepseek Provider Contract

    AnastasiyaW/codex-claude-code-config

    Validate a proposed DeepSeek API integration before any key or project context is sent: check thinking-mode tool-call history, strict-schema assumptions, bounded output, and provider data boundaries.

    154 GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Questions about Desktop Sessions Discovery

What does Desktop Sessions Discovery do?

Discover, search, and selectively restore Claude desktop app sessions hidden across multiple accountIds. Desktop Sessions Discovery is an agent skill from AnastasiyaW/codex-claude-code-config. Discover, search, and selectively restore Claude desktop app sessions hidden across multiple accountIds.

When should I use Desktop Sessions Discovery?

Desktop Sessions Discovery fits situations like: user mentions missing sessions after account switch; lost desktop sessions; where do my old sessions live; runs multiple Claude accounts on the same machine.

How do I install Desktop Sessions Discovery in Claude Code?

Run `npx skills add AnastasiyaW/codex-claude-code-config --skill desktop-sessions-discovery -a claude-code`. Or copy the skill folder (skills/operational/desktop-sessions-discovery in AnastasiyaW/codex-claude-code-config) into .claude/skills/desktop-sessions-discovery in your project. Claude Code loads it when a task matches its description.

How do I install Desktop Sessions Discovery in Codex?

Run `npx skills add AnastasiyaW/codex-claude-code-config --skill desktop-sessions-discovery -a codex`. Or copy the skill folder (skills/operational/desktop-sessions-discovery in AnastasiyaW/codex-claude-code-config) into .agents/skills/desktop-sessions-discovery in your project. Codex loads it when a task matches its description.

Can I use Desktop Sessions Discovery in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AnastasiyaW/codex-claude-code-config --skill desktop-sessions-discovery -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/desktop-sessions-discovery, .gemini/skills/desktop-sessions-discovery, .github/skills/desktop-sessions-discovery and .opencode/skills/desktop-sessions-discovery in your project.

What does Desktop Sessions Discovery need to run?

Going by SKILL.md and its folder, Desktop Sessions Discovery needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Desktop Sessions Discovery access the network?

SKILL.md names 2 domains. As links in the text: github.com and medium.com. This is read from the text; nothing was executed.

Is Desktop Sessions Discovery safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Desktop Sessions Discovery use?

Desktop Sessions Discovery is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Desktop Sessions Discovery use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Desktop Sessions Discovery?

Skills that share tags, products or a category with Desktop Sessions Discovery: Restore Legacy Sessions (zai-org/ZCode, 7.7k stars), Session Compaction And Restore (mvschwarz/openrig, 6.8k stars), Context Restore (garrytan/gstack, 136k stars) and Session Handoff (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Desktop Sessions Discovery?

AnastasiyaW (a GitHub user) maintains it in AnastasiyaW/codex-claude-code-config, which has 154 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on October 11, 2026.

Source: AnastasiyaW/codex-claude-code-config on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.