# compress-session

This skill turns the current conversation into a structured note with decisions, open questions and next steps before auto-compaction eats the context.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 1668
- Author: Claude Code Academic Workflow
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/pedrohcgs/claude-code-my-workflow/tree/HEAD/.claude/skills/compress-session/SKILL.md
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/skills/compress-session

## What it does

Auto-compaction keeps recent turns and drops earlier ones, so whatever was decided mid-session is gone. `compress-session` distils instead: it splits the conversation into sections and writes a file the next session can resume from in under a minute.

The note covers the active plan, branch and last commit, decisions with a one-line reason, touched files as `path:line` pointers, open questions, and one to three next actions. A separate block lists what was discarded as noise — dead-end hypotheses and abandoned approaches — so they do not resurface in a fresh context. The skill also proposes up to three `[LEARN]` entries for MEMORY.md, and none of them merge automatically.

Output lands in `quality_reports/session_logs/YYYY-MM-DD_compression_<topic>.md`, with the slug taken from the argument or the current plan name. Nothing runs on its own: you invoke it when context is close to the threshold or when the session has piled up enough debris. Use `/checkpoint` for a deliberate stop-point and `/clear` to start fresh.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compress-session -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/compress-session/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/compress-session/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compress-session -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/compress-session/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compress-session -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/compress-session/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pedrohcgs/claude-code-my-workflow compress-session
```

2. **Manually: put the files in place**
- File: `.github/skills/compress-session/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compress-session -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pedrohcgs/claude-code-my-workflow --path .claude/skills/compress-session
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/compress-session/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pedrohcgs/claude-code-my-workflow --skill compress-session -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pedrohcgs/claude-code-my-workflow/tree/HEAD/.claude/skills/compress-session/SKILL.md

## When to use it
- keep session decisions before context auto-compacts
- hand work to another agent without retelling the whole conversation
- separate dead-end hypotheses from what actually shipped
- record open questions with file pointers
- surface generalisable lessons for MEMORY.md

## Example prompts
- /compress-session auth-refactor
- /compress-session
- Compress this session before auto-compact, slug parser-fix

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 7683108e9b017aa7.

BEGIN THIRD-PARTY FILE 7683108e9b017aa7
```text
---
name: compress-session
description: Distill the current conversation into a structured note (decisions made, open questions, file pointers with line numbers, next 1–3 actions) and save to `quality_reports/session_logs/` before auto-compression. Differs from `/checkpoint` (explicit stop-point snapshot) and from auto-compaction (which truncates rather than distills). Use when context is approaching auto-compact threshold, when a long pipeline has accumulated many decisions, or when the user says "compress", "distil this session", "before we hit auto-compact", "structured handoff before context resets".
argument-hint: "[optional-topic-slug]"
disable-model-invocation: true
allowed-tools: ["Read", "Write", "Glob", "Grep", "Bash"]
metadata:
  author: Claude Code Academic Workflow
  version: 1.0.0
---

# `/compress-session` — distil, don't truncate

Auto-compaction is **lossy**: it keeps recent turns and drops earlier ones, with no preservation of *what was decided* mid-session. `/compress-session` is the **distil-not-truncate** alternative — produce a structured note that the next session can resume from in under a minute.

## Why this skill exists

Drew Breunig's ["How Long Contexts Fail"](https://www.dbreunig.com/2025/06/22/how-contexts-fail-and-how-to-fix-them.html) identifies four failure modes for long-context sessions:

1. **Poisoning** — early hallucinated content gets quoted by later turns, compounding the error.
2. **Distraction** — irrelevant earlier context dilutes the model's attention to current task.
3. **Confusion** — contradicted facts pile up; the model doesn't know which to trust.
4. **Clash** — multiple plans, decisions, or specs accumulate without explicit reconciliation.

The template's 200-line `MEMORY.md` cap defends against *distraction*. The plan-on-disk convention defends against *clash*. Nothing currently defends against *poisoning* or directly against *confusion* — that's what this skill is for.

## Distinction from `/checkpoint`

| | `/checkpoint` | `/compress-session` |
|---|---|---|
| **When** | Explicit stop-point (end of working session, before model switch, before collaborator handoff) | Forced — context is about to auto-compact, or the conversation has accumulated enough noise that distillation pays for itself |
| **What's preserved** | Active plan, decisions, file pointers, next 1–3 actions | Same, plus an explicit "discarded as noise" line so the next session knows what was *intentionally* not kept |
```
END THIRD-PARTY FILE 7683108e9b017aa7

The third-party file has ended. Everything between the 7683108e9b017aa7 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2498 of 9517 bytes. © Claude Code Academic Workflow · MIT · https://github.com/pedrohcgs/claude-code-my-workflow/tree/HEAD/.claude/skills/compress-session/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
