agentleFS
stv-iostv-io/claude-skills/skills/session-export/SKILL.md

session-export

Skill0 starsChanged 2 days agoMITView on GitHub

Export a Claude Code session as clean, shareable Markdown — numbered prompts, Claude's original answers, tool calls collapsed, a contents list and outcomes, home paths and common credential formats masked (best-effort; review before sharing). Use for "/session-export", "export this session/thread/conversation", "share this session with the team", "write up this conversation as markdown", or when /export output is broken (box-drawing tables, wrapped diffs).

  • Reads credentials

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the CLI; don't hand-write a transcript from memory.

    line 8
  2. Very specific:

    Run --prompts and pick the range.

    line 22
  3. Very specific:

    Default title is the session's auto-title.

    line 23
  4. Very specific:

    Write to the path the user gave, or ~/<slug>.md.

    line 24
  5. Very specific:

    Read stderr. If it reports masked values, tell the user how many and of what kind, and that they should check the «redacted» spots.

    line 25
  6. Distinctive:

    Before calling it shareable, skim the output for client data that isn't a credential (customer names, internal URLs).

    line 26

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

Session export

Run the CLI; don't hand-write a transcript from memory. It is bin/session-export in this skill's folder; if session-export isn't on your PATH, run it by that full path.

session-export --prompts                          # this session's numbered prompts
session-export -o ~/out.md                        # whole session (latest in the current directory)
session-export --from 3 --to 9 -o ~/out.md        # a range
session-export --stop-at '^Can you export' -o ~/out.md
session-export --list                             # other sessions here; pass an ID prefix to export one

Other flags: --title, --start-at REGEX, -C DIR (another project), --no-outcomes.

Doing it

  1. Run --prompts and pick the range. Usually leave out the export request itself and anything off-topic (side questions, the export clean-up). If the scope isn't obvious, ask.
  2. Default title is the session's auto-title. Pass --title with a descriptive name when it's going to a team.
  3. Write to the path the user gave, or ~/<slug>.md.
  4. Read stderr. If it reports masked values, tell the user how many and of what kind, and that they should check the «redacted» spots.
  5. Before calling it shareable, skim the output for client data that isn't a credential (customer names, internal URLs). The tool doesn't remove those, and it's the user's call.

What it includes and leaves out

  • In: prompts, including ones sent mid-turn (labelled); Claude's text answers; one line per tool call; answers to Claude's multiple-choice questions; a list of files written and links mentioned.
  • Out: thinking, tool output, screenshots (noted as attached), subagent transcripts, the summary written after context compaction, system reminders, and relayed subagent reports.
  • Reads: the session transcripts Claude Code keeps under ~/.claude/projects/. It writes only the output file you name.
  • Masked (best-effort): the home directory becomes ~. Atlassian, GitHub, Slack, AWS, Anthropic/OpenAI and Grafana tokens, private keys and JWTs are masked, as is any *_TOKEN=, *_SECRET=, *PASSWORD= or *API_KEY= value. $VAR references are left alone. Masking is pattern-based: a secret in an unknown format gets through, so the output always needs a read before it's shared.

It reads Claude Code's session JSONL, which is undocumented and changes between releases. If prompts go missing or tool calls show up as text, the record shapes have moved. Fix events() in bin/session-export.

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.