Export Claude Code session transcripts from JSONL logs to readable text format. Use when the user asks to export a session, save a transcript, create session archives, or convert session logs to readable format. Triggers on phrases like "export session", "save transcript", "session to text".
Export Claude Code session JSONL logs to readable, UI-style text format matching the native /export command output.
~/.claude/projects/<project>/<session-id>.jsonlWhen the user asks to export a session, determine which session to export:
If user provides a session ID:
~/.claude/projects/<project-path>/<session-id>.jsonlIf user wants to browse recent sessions:
~/.claude/projects/ for the current projectTo find sessions for the current project:
ls -lt ~/.claude/projects/$(pwd | sed 's|/|%|g')/*.jsonl | head -10Check project context first:
sessions/, transcripts/, chronicles/, docs/sessions/)If no project convention exists, ask the user:
./sessions/YYYY-MM-DDThhmm-<description>.txtOutput filename format: YYYY-MM-DDThhmm-<description>.txt
The export script is located at:
<plugin-dir>/skills/session-export/scripts/export-session.py
python3 <plugin-dir>/skills/session-export/scripts/export-session.py <session-file.jsonl> <output-path.txt>After export, report:
The export produces UI-style readable text with:
Claude ASCII art header with version and project path
User messages prefixed with >
Assistant messages with ⏺ bullets
Tool uses formatted with ⎿ markers
Concise output (truncates long file contents)
Filtered meta messages and command tags
Credentials redacted to [REDACTED], so exports are safe to commit:
NAME=value, Name = value when the value looks like a
credential (INI, WireGuard), "name": value (JSON), name: value at line
start (YAML, curl -v) or inside a quoted header (-H "x-api-key: …"), where the name ends in
api_key, access_key, secret_key, private_key, client_secret, token, secret,
password, or credentials (any case), or is an upper-case env var ending in _KEY.
$VAR, $(cmd), %s, {name}, and <name> values are left alone.Bearer/Basic auth values.postgres://user:password@host, including raw / and @ in it.sig, signature, code,
X-Amz-Signature, ...) and any long random-looking value (32+ characters with a letter and a
digit, not %-encoded text or a path), as in calendar export links and pre-signed S3/GCS URLs,
including &-escaped and JSON \u0026-escaped links. UUIDs and git SHAs are kept;
other long hashes in a query string, like a ?v=<hash> cache-buster, are redacted too.This is pattern matching, not a guarantee. Review an export before publishing it outside a private repo. Known limits, all failing open (the value is exported as-is):
Name = value with spaces and no quotes needs a credential-looking value (16+ characters
including a digit), so password = hunter2 passes through. NAME=value and quoted values
have no such limit.python3 -m unittest test_export_session.py from scripts/.Export current/recent session:
"Export this session" "Save the transcript"
Export specific session:
"Export session abc123" "Export the session from yesterday"
Browse and choose:
"Show me recent sessions to export" "List sessions from this project"
ddehart/claude-code-plugins
8883655
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.