export-session
Export the current (or specified) Claude Code session chain to a markdown file.
Skill by EndUser123
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/enduser123-export-session
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/export-session
What's inside
- Skill name
export-session- Description
- Export the current (or specified) Claude Code session chain to a markdown file. Trigger when the user says "export session", "export conversation", "export chat", "export transcript", "save session", "dump session", or types /export-session. Produces a cross-terminal, cross-compaction session-chain markdown export for analysis consumers (/debrief, /gto, /learn) or archival.
- License
- MIT
- Instructions
- 103 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- body: contains an absolute path from the author's machine
Files (1)
- SKILL.md
SKILL.md (first lines)
# Export Session (/export-session)
Thin, task-centric entry point over the `/chs` export pipeline. Exports the full
**session chain** — every transcript linked to the session across all terminals and
compactions — to a single markdown file.
`/chs export` is the in-skill alias for the same pipeline; both call
`chs_cli.py --export`. `/export-session` exists because "export this session" is the
dominant mental model and leading with the verb is easier to recall than
`<acronym> <subcommand>`.
## Exact CLI mapping
```bash
python "P:/packages/.claude-marketplace/plugins/search-research/skills/chs/scripts/chs_cli.py" \
--export [--session-id <id>] [--output <path>] [--max-sessions N] \
[--fidelity {context-safe,analysis}]
```
## Defaults (no flags needed)
- **Fidelity:** `analysis` (default) — full tool results with
`tool_use`↔`tool_result` id back-refs, uncapped thinking, per-entry ISO
timestamps, per-session git branch, export-time HEAD sha, and compaction-boundary
markers. Use `--fidelity context-safe` for a compact, byte-identical-to-legacy
export when reading the file directly into context.
- **Session:** ALWAYS pass `--session-id` explicitly — see **Session resolution** below. The CLI's "current session" auto-detection is unsafe under concurrent Claude sessions in one Windows Terminal (WT_SESSION is shared; the resolution file is last-writer-wins and can point to a sibling session).
- **Output:** `~/.claude/exports/chain_<timestamp>.md` when `--output` is omitted.
- **Max sessions:** the 30 most-recent transcripts in the chain (newest kept,
oldest silently dropped). Raise with `--max-sessions N` for very long-lived
sessions.
## Cross-terminal + session resume
The chain is reconstructed from `P:/.claude/.artifacts/session_registry.jsonl`
(written by the PreCompact hook), aggregated by `session_id` across **all**
terminals. Resumes and compactions are all included — every transcript segment in
the session's lifetime is reassembled, deduplicated by transcript path.
## Session resolution (MANDATORY: always pass --session-id)
**Always derive and pass `--session-id` explicitly.** Do not rely on the CLI's
"current session" auto-detection — it reads a terminal-keyed file
(`~/.claude/active-session-{terminal_id}.txt`) that is shared across concurrent
Claude sessions in one Windows Terminal and is last-writer-wins. The same flaw
affects `~/.claude/.artifacts/{terminal_id}/identity.json` and the mtime/size
fallbacks. Empirically verified: omitting `--session-id` has produced exports of
the wrong session chain.
**How to derive your session_id:**
1. **From the live transcript path** (preferred). Your most recent hook payload's
`transcript_path` looks like `C:\Users\<user>\.claude\projects\P--\<session_id>.jsonl`
(or `<session_id>-<model>.jsonl` on some setups). The stem minus the optional
`-<model>` suffix is the session_id.
2. **If no hook payload is in context** (first prompt of a session), run `/status`
or inspect `~/.claude/projects/P--/` for the `.jsonl` whose mtime is newest and
whose content includes your current first message — its stem is your session_id.
Do NOT guess from memory or from the active-session file.
Pass it as `--session-id <id>` on every invocation, including the "export this
session" case.
## Context protection
The CLI returns JSON metadata with `context_safe` and `recommendation` fields.
**Default behavior:** report the export path and metadata. Do NOT read the file into
context unless `context_safe` is true. When `recommendation` is
`delegate_to_subagent`, spawn a subagent to read and summarize rather than loading
the file into main context.
| `recommendation` | Action |
|---|---|
| `read_file` | Safe to read into context (<20K tokens) |
| `delegate_to_subagent` | Spawn a subagent to read, summarize, and return key findings |
| `export_is_too_large_use_filters` | Re-export with `--fidelity context-safe` or a targeted `--session-id` |
## Common invocations
```bash
# Default — analysis export of the current session chain
/export-session
# Compact export for direct in-context reading
/export-session --fidelity context-safe
# Export a specific session chain
/export-session --session-id <uuid>
# Bounded for very long sessions
/export-session --max-sessions 5
```
## Provenance note on sha
Transcripts do not record `gitSha` per session (the field is always null). The
`analysis` preset stamps the **export-time** `git rev-parse HEAD` of the working
directory, labeled as such — it is not the session-time commit. Per-session
`gitBranch` is authentic. If a future consumer needs true session-time sha, that
must come from a hook recording it at session start, not from the export.From EndUser123/search-research, MIT.
More from EndUser123/search-research
- 0.479score
crawl
EndUser123
Ingest websites into QMD wiki collections for semantic search via /search and /explore.
SkillCFreshness: CClaude Code +9 - 0.479score
find
EndUser123
Local intelligent find — searches only local data stores (CKS, CHS, CDS, code, docs, skills).
SkillCFreshness: CClaude Code +9 - 0.476score
chs
EndUser123
Dedicated chat history search with summarization, workspace aliases, tool filtering, context preview, session stats, and branch filtering
SkillCFreshness: CClaude Code +9 - 0.476score
research
EndUser123
Canonical research workflow using deterministic capability routing, local and external evidence gathering, source opening, assessment, and provenance-bound…
SkillCFreshness: CClaude Code +9 - 0.475score
gitpack
EndUser123
Pack a code or markdown directory (or a scattered set of files) into compact LLM-context files using only stdlib — AST for Python, regex signatures for…
SkillCFreshness: CClaude Code +9 - 0.474score
note
EndUser123
Add a deliberate entry to your constitutional knowledge system (CKS).
SkillCFreshness: CClaude Code +9 - 0.474score
keep
EndUser123
Alias for /note — add a deliberate entry to your constitutional knowledge system (CKS).
SkillCFreshness: CClaude Code +9 - 0.473score
aid
EndUser123
AI-Distiller wrapper for code analysis - refactoring, security, performance, architecture.
SkillCFreshness: CClaude Code +9 - 0.473score
gitingest
EndUser123
Ingest GitHub repos into NotebookLM — clone, slice, and upload in one pipeline.
SkillCFreshness: CClaude Code +9 - 0.469score
chs-eval
EndUser123
Run golden-case retrieval evaluation against the CHS database and report per-case + mean recall
SkillCFreshness: CClaude Code +9 - 0.469score
repomix
EndUser123
Pack repository contents into AI-friendly formats (XML, Markdown, JSON, plain text) for LLM context.
SkillCFreshness: CClaude Code +9 - 0.469score
context7
EndUser123
Docs-as-Code: Fetch fresh, version-specific documentation via Context7 API.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 5, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/EndUser123/search-research
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from EndUser123
- 0.521score
evidence-driven-experiment-loop
EndUser123
Manage evidence-first experiments, benchmarks, performance optimization, A/B comparisons, repeated evidence gathering, live-run decisions, and fresh-agent…
SkillBFreshness: BClaude Code +9 - 0.516score
preflight
EndUser123
Build an evidence-backed inventory before planning, reviewing, or implementing non-trivial changes to hooks, skills, plugins, entrypoints, defaults, state…
SkillBFreshness: BClaude Code +9 - 0.490score
go
EndUser123
Use when a user asks to run /go, execute the next planned task, process a tasks.json queue, or drive a bounded SDLC task through enforced evidence gates.
SkillBFreshness: BClaude Code +9 - 0.479score
crawl
EndUser123
Ingest websites into QMD wiki collections for semantic search via /search and /explore.
SkillCFreshness: CClaude Code +9 - 0.479score
find
EndUser123
Local intelligent find — searches only local data stores (CKS, CHS, CDS, code, docs, skills).
SkillCFreshness: CClaude Code +9 - 0.476score
chs
EndUser123
Dedicated chat history search with summarization, workspace aliases, tool filtering, context preview, session stats, and branch filtering
SkillCFreshness: CClaude Code +9
Cite this page
export-session skill. Agent Mart. https://agentmart.dev/skills/enduser123-export-session (last updated 2026-10-24)