salvage-session-archives

salvage-session-archives is a skill for Claude Code from eranw2000/claude-maintenance-skills. It costs 97 tokens per session (2,094 once invoked), scanned D, original, MIT.

A cleanup skill that reads leftover Claude Code session transcripts for a project and finds useful facts, decisions, or warnings missing from its CLAUDE.md file.

In plain words
What is it for?
Use it during project cleanup or when you want to salvage information from old session archives. It appends recovered notes to CLAUDE.md and deletes the leftover folders.
Why use it?
It helps recover project knowledge from sessions that ended before their important details were recorded. It also checks for duplicates or contradictions before adding anything.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions CLAUDE.md.

Good fit Use it during project cleanup or when you want to salvage information from old session archives. It appends recovered notes to CLAUDE.md and deletes the leftover folders.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/eranw2000/claude-maintenance-skills/salvage-session-archives
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add eranw2000/claude-maintenance-skills --skill salvage-session-archives
Clone the repo
git clone --depth 1 https://github.com/eranw2000/claude-maintenance-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for salvage-session-archives

README.md
[![agentmods](https://agentmods.dev/badge/skills/eranw2000/claude-maintenance-skills/salvage-session-archives/github.svg)](https://agentmods.dev/skills/eranw2000/claude-maintenance-skills/salvage-session-archives)
Your own site
<a href="https://agentmods.dev/skills/eranw2000/claude-maintenance-skills/salvage-session-archives"><img src="https://agentmods.dev/badge/skills/eranw2000/claude-maintenance-skills/salvage-session-archives/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for salvage-session-archives

Your own site · 80×15
<a href="https://agentmods.dev/skills/eranw2000/claude-maintenance-skills/salvage-session-archives"><img src="https://agentmods.dev/badge/skills/eranw2000/claude-maintenance-skills/salvage-session-archives.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,094 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00097 $0.02094
Opus 5 $0.00048 $0.01047
Sonnet 5 $0.00019 $0.00419
Haiku 4.5 $0.00010 $0.00209

Measured 12d ago against content hash ba60003a68d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade D, and why

salvage-session-archives scanned grade D with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks the agent to reveal its instructionsmediumSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

- Output instructions: append (via Edit with a unique anchor at end of file, NOT Write) a section titled exactly `## Salvaged from session archives`. Organize by topic, not by session. Tight bullets. Plain language: no e

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

Ask the user to confirm before deleting. On confirmation, `rm -rf` each leftover folder identified in step 2. After deletion, run a quick `find` to confirm only the canonical project folder remains. Never delete the cano
salvage-session-archives/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Salvage session archives for a project

Goal: recover any durable knowledge that lives in old session .jsonl transcripts but never made it into the project's CLAUDE.md, then clean up.

The Claude Code harness writes transcripts into auto-named "leftover folders" with dashed paths (e.g. ~/.claude/projects/-Users-<username>--claude-projects-<ProjectName>/). Sessions that ended cleanly already distilled their content via an end-of-session save, but premature exits, subagent runs, and quietly-discovered gotchas often leave salvageable material behind.

When to run

  • User asks to salvage / collect / extract / mine session archives or leftover folders.
  • End-of-quarter cleanup pass across multiple projects.

Steps

1. Identify the project from the current working directory

Do NOT ask the user which project to work on. Derive <project_name> from the current working directory (pwd). Handle these cases:

  • pwd is ~/.claude/projects/<ProjectName>/ → use <ProjectName> directly. This is the canonical project directory.
  • pwd is the project's source repo (anywhere on disk) or a subdir of it → use the repo directory's basename as <ProjectName>. The canonical project directory is ~/.claude/projects/<ProjectName>/.
  • pwd is a dash-prefixed leftover folder like ~/.claude/projects/-Users-<username>--claude-projects-<ProjectName>/ → use <ProjectName> (the trailing segment after the last -).
  • pwd is ~/.claude itself or any other location that doesn't clearly map to a project → only in this case, list ~/.claude/projects/ and ask the user which project to target (show the 3-4 most recently-touched via ls -lt).

State the inferred project name in one sentence before continuing, so the user can redirect if needed. Then proceed without waiting for confirmation.

2. Find every leftover folder for that project

Run find ~/.claude -maxdepth 3 -type d -iname "*<project_name>*" and inspect the results. Real leftover folders are the dash-prefixed ones (Claude Code encodes each session's working-directory path into the folder name, replacing every / with -, so a -Users-<username>-... prefix is just your $HOME dash-encoded). For example:

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 125 lines · 97 tokens per session scan D ba60003a68d8

Subscribe to this mod's changes

salvage-session-archives is a skill published in the GitHub repository eranw2000/claude-maintenance-skills (5 stars, last pushed 14d ago), licensed MIT. It adds 97 tokens to every session and 2,094 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it D with 2 findings (asks the agent to reveal its instructions, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

agents-md-improver

Audit and improve project-rules files (AGENTS.md, CLAUDE.md, .agents/instructions, local overrides) so the agent keeps accurate project context. Use when the user asks to check, audit, review, update, improve, or fix their AGENTS.md or CLAUDE.md, mentions "project rules maintenance" or "agent context optimization", or…

waybarrios/opencode-power-pack · 125 tokens

self-improve

Extract lessons from the current session, or sweep the project's past sessions when asked, and route them to the appropriate knowledge layer (project AGENTS.md, auto memory, existing skills, or new skills). Use when the user asks to "self-improve", "distill this session", "distill past sessions", "sweep past…

tobihagemann/turbo · 125 tokens

agents-md-revise

Capture learnings from the current session into the project-rules file (AGENTS.md, CLAUDE.md, or local override) so future sessions benefit. Use when the user says "revise the rules", "update AGENTS.md / CLAUDE.md with what we just learned", "save this to project memory", "remember this for next time", or at the end…

waybarrios/opencode-power-pack · 114 tokens

report

Writes the session final report to a file, then prints only the path and a one-line summary. Fires when the prompt contains "Report per memstack:report", and also when the prompt begins with a standing trigger configured through MEMSTACKREPORTONTASKPROMPTS or MEMSTACKREPORTTRIGGERS. Dormant otherwise.

cwinvestments/memstack · 67 tokens

token-optimization

Use when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity. Covers TokenStack, the built-in compression proxy that shrinks Claude Code tool output before it reaches the Anthropic API. Do NOT use for…

cwinvestments/memstack · 79 tokens

compress

Use when the user says 'tokenstack', 'compression', 'token savings', 'proxy status', or asks about context window usage.

cwinvestments/memstack · 29 tokens