# Session Export

> Serializes current session state, thought history, and memory data into structured JSON files for persistence.

- Skill: `felipecustodio/session-export` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add felipecustodio/session-export`
- Raw SKILL.md: https://api.skillmd.com/api/skills/felipecustodio/session-export/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: felipecustodio (https://skillmd.com/u/felipecustodio)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/felipecustodio/session-export

---


## Overview & Purpose

Session Export serializes the active session context into structured JSON format to disk, allowing state persistence across tool calls or subagents.

## When to Use

- **State Persistence**: Saving progress before long background operations.
- **Hand-off to Subagents**: Exporting context for sibling or child subagents.

## Execution Workflow

1. **Gather Session Memory**: Collect active thoughts, variables, and metadata.
2. **Execute Export Script**: Call `scripts/session_export.py --file <path> --data <json_string>`.
3. **Verify File Creation**: Confirm the JSON target file was created cleanly.

## Expected Output Contract

```markdown
### Session Export Complete
- **Target File**: [File Path]
- **Export Status**: [Success / Failed]
```

## Scripts

- `scripts/session_export.py` - Deterministic evaluation, state validation, and CLI tool for session-export.

## Gotchas

- Ensure payload JSON is properly escaped when passed via command line flags.

