agentleFS
arbelharbelh/perdure/skills/archive/SKILL.md

archive

Skill0 starsChanged 29 days agoMITView on GitHub

Export Claude Code session JSONLs to portable, human-readable markdown

22 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use distill, plan and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • HK-hubSkill

    distill

    Strip designs to their essence by removing unnecessary complexity. Great design is simple, powerful, and clean. Use when the user asks to simplify, declutter, reduce noise, remove elements, or make a UI cleaner and more focused.

    Also in 3 projects that use this

  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 5 projects that use this

  • AnthropicSkill

    status

    Case status summary by audience — client-facing (plain language), internal (for the professor), or court-ready (formal caption format per local rules). Same facts, different framing and depth. Use when a student needs to update the client, brief the professor, or prepare a court status report.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    test

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 1

    Distinctive

    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
  1. Very specific:

    Use ${CLAUDE_PLUGIN_ROOT}/scripts/export-session.py if the env var is set.

    line 33
  2. Distinctive:

    If not found, STOP and tell the user the plugin is not properly installed.

    line 44
  3. Very specific:

    Add --output "$OUTPUT" / --force when the user passed them.

    line 61

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

Archive Claude Code Sessions

Exports Claude Code's session transcripts from ~/.claude/projects/.

You are exporting session JSONL transcripts to self-contained markdown files under perdure/archives/. Archives survive JSONL pruning, work without Claude Code, and are readable by anyone with a text editor.

Arguments

  • $1 — session UUID, current (or empty: auto-detect the current session), or all — sweep mode: archive every session in this project that doesn't have an archive yet.
  • --format brief|medium|verbose — verbosity (default: medium)
  • --output <path> — override the default archive path (single-session only)
  • --force — re-archive even if the archive file already exists

Steps

1. Locate the export script

Use ${CLAUDE_PLUGIN_ROOT}/scripts/export-session.py if the env var is set; else the plugin checkout's root scripts/export-session.py (Codex keeps the whole checkout) or scripts/export-session.py beside this SKILL.md (skills CLI); else:

# Claude Code's install manifest names the ACTIVE install. A bare
# `find ... | head -1` returns whichever path the filesystem yields first, and
# the plugin cache keeps every version ever installed — that can be an old one.
python3 -c "import json,pathlib;d=json.loads((pathlib.Path.home()/'.claude/plugins/installed_plugins.json').read_text());p=d.get('plugins',d);print(next(v[0]['installPath'] for k,v in p.items() if k.split('@')[0]=='perdure'))"

If not found, STOP and tell the user the plugin is not properly installed.

2a. Single session (default)

Determine the session id:

  • $1 is a UUID (36 chars with dashes) → use it.
  • Empty or current → most recently modified JSONL in ~/.claude/projects/<cwd-slug>/ (cwd-slug = $PWD with / → -); its filename stem is the id. If its mtime is within the last 60s, note the session is still active and the archive reflects current state.

Run:

python3 "$SCRIPT_PATH" --session-id "$SESSION_ID" --project-dir "$PWD" --format "${FORMAT:-medium}"

Add --output "$OUTPUT" / --force when the user passed them. If the archive already exists without --force, the script stops — relay its message (re-run with --force to regenerate, or --output for a different path).

2b. Sweep mode ($1 = all)

python3 "$SCRIPT_PATH" --sweep --project-dir "$PWD" --format "${FORMAT:-medium}" ${FORCE:+--force}

The script enumerates the project's JSONLs, skips ones already archived (matched by the 8-char UUID suffix), archives the rest, and prints one line each. Good moments to sweep: returning to a project after a gap, before upgrading Claude Code, before cold-storing a project. Not needed right after archiving the current session.

3. Report

✅ Archived
Path(s):  perdure/archives/session-<date>-<slug>-<short-id>.md  (one line per file in sweep mode)
Format:   <brief|medium|verbose>
Source:   ~/.claude/projects/<slug>/*.jsonl

Commit policy

Archives are gitignored by default (the exporter scaffolds the scoped .gitignore per the commit-archives preference) — transcripts can contain pasted secrets and personal content, so committing them is an explicit opt-in with a redaction pass. See docs/RECORDS-CONVENTION.md (also at references/RECORDS-CONVENTION.md beside this SKILL.md in a skills-CLI install). Workflow files and ADRs are the committed-by-default layer; archives are the privacy layer.

Reference

FormatContents
briefDialogue prose only; tool calls elided
medium (default)Dialogue + one-line tool summaries
verboseDialogue + tool summaries + truncated outputs

Naming: perdure/archives/session-<YYYY-MM-DD>-<slug>-<short-uuid>.md (first message date, session slug, first 8 UUID chars for collision safety).

Semantics: idempotent within a session (re-run regenerates from the larger JSONL); per-session filenames never collide; the archive stands alone once written; the JSONL remains the source of truth while it exists. Corrupt JSONLs are skipped with a stderr log, never fatal.

The auto-archive-before-compact preference runs this automatically via the PreCompact hook.

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.