agentleFS
EliaAlbertiEliaAlberti/cpr-compress-preserve-resume/skills/preserve/SKILL.md

preserve

Skill512 starsChanged 3 months agoMITView on GitHub

Write this session's durable learnings into the project's CLAUDE.md, keeping it short and archiving stale sections. Run after important decisions or when the project's status changes.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. iurykrieger/claude-bedrock★ 104same name
    2. sandsower/memento-vault★ 13same name
    3. OTSkit/OTSkit-skills★ 2same 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 repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    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
  1. Distinctive:

    Ask once with AskUserQuestion, multi-select, header "Preserve".

    line 25
  2. Distinctive:

    Read the current CLAUDE.md and match its structure and voice.

    line 29
  3. Distinctive:

    Leave out implementation detail, full file contents, timestamps, and anything the code or git history already records.

    line 36
  4. Distinctive:

    If it is still over 200 after that, list the remaining non-core sections and ask which to archive.

    line 55
  5. Very specific:

    Never propose archiving a section whose heading contains (PROTECTED), or the core sections: Approach, Philosophy, Paths, Structure, Key …

    line 56

“Common” is measured: kept by at least 6 in 10 of the 3 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/cpr:preserve

Update the project's CLAUDE.md with what this session taught that every future session should know from the first message. CLAUDE.md is loaded at the start of every session and re-injected after compaction, so it is the right home for status, decisions, conventions and next steps, and the wrong home for narrative or anything the code already says.

Project

!python3 "${CLAUDE_PLUGIN_ROOT}/scripts/cpr_paths.py"

$ARGUMENTS containing quick means: skip the question, preserve every category that has real content.

Find CLAUDE.md

Look in project_root for CLAUDE.md, Claude.md, or .claude/CLAUDE.md. If none exists, ask with AskUserQuestion whether to create one at {project_root}/CLAUDE.md or to print the notes into the conversation instead. If the user chooses the conversation, write the same content as a short markdown block and stop.

What to preserve

Ask once with AskUserQuestion, multi-select, header "Preserve". Options: Phase/Status Changes, Key Decisions, New Files/Structure, Patterns/Insights, Blockers/Warnings, Next Steps. Recommend the ones this session produced.

Read, then edit

Read the current CLAUDE.md and match its structure and voice. Update existing sections in place rather than appending duplicates. Every addition should be something a future session would otherwise have to rediscover or be told again:

  • Status changes as one line each.
  • Decisions with the reason, in a table if the file already uses tables.
  • New directories or files as a short list, not a tree of everything.
  • Next steps as a checklist.

Leave out implementation detail, full file contents, timestamps, and anything the code or git history already records. Point to files instead of copying them. Keep exact values for paths, flags and identifiers.

Edit the file directly, then report:

CLAUDE.md updated

Preserved:
- {what changed}

CLAUDE.md is now {X} lines (target: under 200)

Keep it short

Claude Code recommends CLAUDE.md files under 200 lines for adherence. After editing, check wc -l. If the file is over 200 lines:

  1. Find archivable content: ## Session Notes (DATE) sections older than 7 days, ## Completed Projects, and any section whose heading contains (ARCHIVABLE).
  2. Show the user what archiving those would remove and the resulting line count, and ask with AskUserQuestion: archive now, or keep everything.
  3. If it is still over 200 after that, list the remaining non-core sections and ask which to archive.
  4. Never propose archiving a section whose heading contains (PROTECTED), or the core sections: Approach, Philosophy, Paths, Structure, Key References, Links, Skills, Commands, Key Patterns, Conventions. Adapt the list to the names the file actually uses.

Archived sections go to {project_root}/CLAUDE-Archive.md, appended under a ## Archived: {date} heading, and are removed from CLAUDE.md. Create the archive file with a one-line intro if it does not exist.

No CLAUDE.md and the user declined to create one

Print a compact preservation block to the conversation with the selected categories and a two-sentence resume context, then suggest creating a CLAUDE.md so it persists.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.