sessions:export

A command for saving a coding session as a Markdown document or JSON data file.

In plain words
What is it for?
Use it to export the current or a selected session, choose Markdown or JSON, and write the result to a file.
Why use it?
It turns session memory into a portable record that can be read, shared, or processed by other tools.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/iam-dev/cc-sessions/sessions-export
Clone the repo
git clone --depth 1 https://github.com/iam-dev/cc-sessions
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 624 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00011 $0.00624
Opus 5 $0.00005 $0.00312
Sonnet 5 $0.00002 $0.00125
Haiku 4.5 $0.00001 $0.00062

Measured yesterday against content hash f1c161a808e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sessions:export scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/sessions-export.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Export Session

Export a session memory to markdown or JSON format.

Usage Examples

/sessions:export
/sessions:export mem_abc123_xyz789
/sessions:export --format json
/sessions:export --format md --output ./session-notes.md

Instructions

When the user runs /sessions:export, execute via CLI:

node "${CLAUDE_PLUGIN_ROOT}/dist/cli.js" export $ARGUMENTS

Arguments:

  • $1 - Session ID (optional, defaults to last session)
  • --format - Export format: md (markdown) or json (default: md)
  • --output - Output file path (prints to console if not specified)

Markdown Export Format

# Session: {summary}

**Project:** {projectPath}
**Date:** {date}
**Duration:** {duration}
**Tokens Used:** {tokensUsed}

## Summary

{description}

## Tasks

### Completed
- [x] {task 1}
- [x] {task 2}

### Pending
- [ ] {task 1}
- [ ] {task 2}

## Files Modified

### Created
- `{file1.ts}`
- `{file2.ts}`

### Modified
- `{file3.ts}`

## Key Decisions

- {decision 1}
- {decision 2}

## Suggested Next Steps

1. {step 1}
2. {step 2}

---

*Exported from cc-sessions on {exportDate}*
*Session ID: {sessionId}*

JSON Export Format

{
  "id": "mem_abc123_xyz789",
  "projectPath": "/Users/you/projects/myapp",
  "projectName": "myapp",
  "startedAt": "2025-01-12T15:30:00Z",
  "endedAt": "2025-01-12T16:15:00Z",
  "duration": 45,
  "summary": "Implemented user authentication system",
  "description": "Added login, registration, and password reset flows...",
  "tasks": [
    {"description": "Create login form", "status": "completed"},
    {"description": "Add form validation", "status": "pending"}
  ],
  "filesCreated": ["src/auth/Login.tsx"],
  "filesModified": ["src/App.tsx"],
  "tokensUsed": 125000,
  "tags": ["authentication", "react"]
}

Success Message

When writing to file:

Session exported successfully!

File: {outputPath}
Format: {format}

Session: {summary}
From: {date}

Error Messages

Session not found:

Session not found: {session_id}

Use /sessions:list to see available sessions.

Read the full file on GitHub · 127 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 127 lines · 11 tokens per session scan A f1c161a808e9

Subscribe to this mod's changes

sessions:export is a command published in the GitHub repository iam-dev/cc-sessions (2 stars, last pushed 4mo ago), licensed MIT. It adds 11 tokens to every session and 624 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.