session-export
Skill0 starsChanged 6 months agoMITView on GitHub
Export the current Claude Code conversation session as a shareable JSONL file. Copies the active session to the current working directory so it can be shared with teammates and imported into their Claude Code. Before exporting, automatically scans and masks sensitive information such as API keys, passwords, personal data (email, phone numbers), and other secrets. Use when asked to "export session", "share this session", "export conversation", "save session to file", or "/session-export [filename]".
- Reads credentials
- Deletes or force-pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- y-a-v-a/session-exporttheir own version, first seen Nov 8, 2026
- apappascs/claude-code-sessionstheir own version, first seen Nov 1, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- y-a-v-a/session-export★ 3same name
- apappascs/claude-code-sessions★ 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 repositoryOne other file it gives its agents.
- session-importSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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
- Distinctive: line 30
Run this to locate the active session:
- Very specific: line 49
If the user passed a filename argument (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Instructions
Export the current Claude Code session as a portable JSONL file with sensitive data masked.
Step 1 — Find the current session file
Run this to locate the active session:
# Encode current project path (/ and spaces → -)
ENCODED=$(echo "$PWD" | sed 's|/|-|g; s| |-|g; s|~|-|g')
SESSION_DIR=~/.claude/projects/"$ENCODED"
echo "Sessions dir: $SESSION_DIR"
# Most recently modified JSONL = current session
CURRENT_SESSION=$(ls -t "$SESSION_DIR"/*.jsonl 2>/dev/null | head -1)
SESSION_ID=$(basename "$CURRENT_SESSION" .jsonl)
LINE_COUNT=$(wc -l < "$CURRENT_SESSION" | tr -d ' ')
echo "Session file: $CURRENT_SESSION"
echo "Session ID: $SESSION_ID"
echo "Lines: $LINE_COUNT"Step 2 — Determine output filename
- If the user passed a filename argument (e.g.
/session-export my-session.jsonl), use that. - Otherwise auto-generate:
session-YYYY-MM-DD-HH-MM.jsonl
OUTPUT_NAME="${USER_ARG:-session-$(date +%Y-%m-%d-%H-%M).jsonl}"Step 3 — Chunk the session and run security-review subagents
Split the session file into chunks of 100 lines each, then spawn a Haiku subagent per chunk to detect and mask sensitive data using contextual judgment — not regex patterns. Finally, concatenate all masked chunks into the output file.
3a. Split the session file into chunks
# Create a temporary working directory for chunks
CHUNK_DIR=$(mktemp -d)
split -l 100 "$CURRENT_SESSION" "$CHUNK_DIR/chunk_"
ls "$CHUNK_DIR"/chunk_* | sort3b. For each chunk, spawn a Haiku subagent
For every chunk file produced in 3a, call the Agent tool with:
model: "haiku"— cost-efficient model for this scanning task- The following prompt (substitute the actual chunk content):
Subagent prompt (per chunk):
You are a security reviewer. Read the following lines from a Claude Code session (JSONL format) and return a FULLY MASKED version.
Rules:
- Read EVERY line carefully and understand the context.
- Replace sensitive values with [MASKED] inline — keep the surrounding JSON/text structure intact.
- Use judgment: mask things that are actually sensitive, not everything that looks like a pattern.
- Do NOT over-mask: code examples, placeholder values, public URLs, or generic variable names that are clearly not real secrets should be left as-is.
Mask the following when they appear to be real/live values:
1. API keys and tokens (Anthropic, OpenAI, GitHub, AWS, Google, Stripe, Slack, Twilio, SendGrid, etc.)
2. Passwords, secrets, passphrases — whether in plain text or JSON key-value pairs
3. Bearer tokens, JWT tokens, OAuth tokens
4. PEM private key blocks
5. Personal information: real names (when clearly identifying a specific person), email addresses, phone numbers, physical addresses, national ID / resident registration numbers, passport numbers, credit card numbers
6. Database connection strings containing credentials
7. Environment variable assignments containing secrets (e.g. `SECRET_KEY=abc123`)
8. Any other value that a reasonable security engineer would consider sensitive in a shared document
Output: Return ONLY the masked lines — every line of the input, in order, with sensitive values replaced by [MASKED]. Do not skip lines, do not add commentary, do not add headers or footers.
--- CHUNK START ---
{PASTE CHUNK CONTENT HERE}
--- CHUNK END ---Run chunks in parallel where possible (send multiple Agent tool calls in a single message) to reduce total time.
3c. Concatenate results and write output
Combine the masked output from all subagents in the original chunk order and write the final result to $PWD/$OUTPUT_NAME using the Write tool. Then clean up the temp directory:
rm -rf "$CHUNK_DIR"Step 4 — Confirm and guide the user
Tell the user:
- Full path of the exported file
- Session ID (UUID)
- Number of lines in the file
- A brief summary of what the subagent found and masked (e.g. "3건의 API 키, 1건의 이메일 주소를 마스킹했습니다")
- Next step: share the
.jsonlfile → recipient runs/session-import <filename>in their Claude Code project to load it
보안 참고: 마스킹은 패턴 매칭이 아닌 서브에이전트의 컨텍스트 기반 판단으로 수행됩니다. 실제 시크릿과 예시 코드를 구분하여 처리하지만, 외부 공유 전 본인이 한 번 더 확인하는 것을 권장합니다.
참고: 내보내기는 현 시점까지의 세션만 캡처합니다. 이후 메시지를 포함하려면 다시 내보내기를 실행하세요.
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
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.

