compress-session

compress-session is a skill for Claude Code from pedrohcgs/claude-code-my-workflow. It costs 123 tokens per session (2,226 once invoked), scanned A, original, MIT.

A conversation handover tool that turns the current chat into a structured note. The note records decisions, unanswered questions, file locations with line numbers and the next few actions.

In plain words
What is it for?
Creating a resume point before conversation compression and saving it under qualityreports/sessionlogs/.
Why use it?
Long conversations can lose important decisions when older messages are shortened or removed. Saving a compact record makes it easier to resume the work later.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Creating a resume point before conversation compression and saving it under qualityreports/sessionlogs/.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pedrohcgs/claude-code-my-workflow/compress-session
About the project

claude-code-my-workflow is a forkable setup for using Claude Code to produce and review academic papers, slides, data analyses, and replication packages. Researchers use its agents, skills, rules, hooks, and quality checks to coordinate these tasks and verify their results. The catalogue entries define the reusable workflow components for Claude Code.

pedrohcgs/claude-code-my-workflow · 1,668 stars · on GitHub · psantanna.com

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.

Any agent
npx skills add pedrohcgs/claude-code-my-workflow --skill compress-session
Clone the repo
git clone --depth 1 https://github.com/pedrohcgs/claude-code-my-workflow

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for compress-session

README.md
[![agentmods](https://agentmods.dev/badge/skills/pedrohcgs/claude-code-my-workflow/compress-session/github.svg)](https://agentmods.dev/skills/pedrohcgs/claude-code-my-workflow/compress-session)
Your own site
<a href="https://agentmods.dev/skills/pedrohcgs/claude-code-my-workflow/compress-session"><img src="https://agentmods.dev/badge/skills/pedrohcgs/claude-code-my-workflow/compress-session/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for compress-session

Your own site · 80×15
<a href="https://agentmods.dev/skills/pedrohcgs/claude-code-my-workflow/compress-session"><img src="https://agentmods.dev/badge/skills/pedrohcgs/claude-code-my-workflow/compress-session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,226 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00123 $0.02226
Opus 5.5 $0.00049 $0.00890
Sonnet 5.5 $0.00025 $0.00445
Haiku 4.5 $0.00012 $0.00223

Measured 25d ago against content hash d10fea6862d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

compress-session 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 25d ago.

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.

.claude/skills/compress-session/SKILL.md · 169 lines

How it starts

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

/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" 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
Output location quality_reports/checkpoints/YYYY-MM-DD_<slug>.md quality_reports/session_logs/YYYY-MM-DD_compression_<slug>.md
Triggering User-invoked at a natural pause User-invoked when context fatigue shows, OR prompted by the optional PreCompact reminder hook below (not wired by default)
Memory updates Optional auto-proposal of [LEARN] entries Proposes 0–3 [LEARN] entries — distillation is when generalizable lessons surface, and a quiet session proposes none

Read the full file on GitHub · 169 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. 25d ago Changed · +11 lines d10fea6862d0
  2. 1mo ago First seen · 158 lines · 123 tokens per session scan A dcfea42b0dd6

Subscribe to this mod's changes

compress-session is a skill published in the GitHub repository pedrohcgs/claude-code-my-workflow (1,668 stars, last pushed 25d ago), licensed MIT. It adds 123 tokens to every session and 2,226 once invoked, about $0.0005 per session on Opus 5.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-30.