# Session

Extract conversation turns from AI session history files (.jsonl)

- Repository: https://github.com/axoviq-ai/synthadoc (1725 stars)
- Category: Engineering
- License: AGPL-3.0-or-later
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add axoviq-ai/synthadoc --skill session -g -a claude-code -y`
Codex: `npx skills add axoviq-ai/synthadoc --skill session -g -a codex -y`
Cursor: `npx skills add axoviq-ai/synthadoc --skill session -g -a cursor -y`
Gemini CLI: `npx skills add axoviq-ai/synthadoc --skill session -g -a gemini-cli -y`

## Description

Extract conversation turns from AI session history files (.jsonl)

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Session Skill

Extracts human-readable conversation turns from AI coding session history files
(`.jsonl`). Supports two formats:

- **Claude Code**, the JSONL format written by Anthropic's Claude Code CLI
  (`~/.claude/projects/<hash>/<session-id>.jsonl`)
- **Codex / Cursor**, the simpler `{"role": ..., "content": ...}` per-line format
  used by OpenAI Codex and Cursor IDE sessions

Format is detected automatically from the first parseable line.

## What gets extracted

Only substantive conversation turns are kept:

| Content type | Action |
|---|---|
| User text messages | Kept if ≥ 3 words |
| Assistant text responses | Kept if ≥ 20 words |
| Assistant thinking blocks | Skipped (internal reasoning, not final output) |
| Tool use / tool result blocks | Skipped (avoids leaking file contents or credentials) |
| Image / attachment blocks | Skipped |
| Sub-agent scaffolding (`isSidechain: true`) | Skipped (internal sub-agent turns) |
| Session metadata lines | Skipped (`permission-mode`, `file-history-snapshot`, `system`, `last-prompt`) |

The extracted text is then passed through Synthadoc's standard pre-LLM source sanitizer
(zero-width characters, bidi overrides, HTML comments, hidden CSS spans, base64 blobs,
instruction-override phrases), exactly like PDF, DOCX, URL, and every other source type.

## Output format

Each turn is labelled `[USER]` or `[ASSISTANT]` and separated by `---`:

```
[USER]
How do I implement a sliding window algorithm?

---

[ASSISTANT]
A sliding window algorithm maintains a contiguous subarray (the "window") …
```

## `suggested_slug`

The skill returns a `suggested_slug` in metadata derived from the session file's
modification time and the first substantive user message:

```
session-2026-07-15-how-do-i-implement-a-sliding
```

## Large sessions, chunking

The rest: https://github.com/axoviq-ai/synthadoc/blob/HEAD/synthadoc/skills/session/SKILL.md
