structured-context-compressor

structured-context-compressor is a skill for Claude Code, Codex from LearnPrompt/cc-harness-skills. It costs 36 tokens per session (282 once invoked), scanned A, original, MIT.

A skill that turns a long coding-agent conversation into a detailed continuation summary. It preserves the request, user messages, files, errors, current work, and next step in nine sections.

In plain words
What is it for?
Use it for long coding tasks, session handoffs, and agent-to-agent continuation when the conversation is nearing its context limit.
Why use it?
Long conversations can lose important decisions and corrections when summarised too briefly. This keeps the context needed for a later session or another agent to continue accurately.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for long coding tasks, session handoffs, and agent-to-agent continuation when the conversation is nearing its context limit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/learnprompt/cc-harness-skills/structured-context-compressor
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 LearnPrompt/cc-harness-skills --skill structured-context-compressor
Clone the repo
git clone --depth 1 https://github.com/LearnPrompt/cc-harness-skills

Made for: Claude Code, Codex.

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 structured-context-compressor

README.md
[![agentmods](https://agentmods.dev/badge/skills/learnprompt/cc-harness-skills/structured-context-compressor/github.svg)](https://agentmods.dev/skills/learnprompt/cc-harness-skills/structured-context-compressor)
Your own site
<a href="https://agentmods.dev/skills/learnprompt/cc-harness-skills/structured-context-compressor"><img src="https://agentmods.dev/badge/skills/learnprompt/cc-harness-skills/structured-context-compressor/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 structured-context-compressor

Your own site · 80×15
<a href="https://agentmods.dev/skills/learnprompt/cc-harness-skills/structured-context-compressor"><img src="https://agentmods.dev/badge/skills/learnprompt/cc-harness-skills/structured-context-compressor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 282 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.00036 $0.00282
Opus 5.5 $0.00014 $0.00113
Sonnet 5.5 $0.00007 $0.00056
Haiku 4.5 $0.00004 $0.00028

Measured 1mo ago against content hash 1747e3a0333f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

structured-context-compressor 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/render_template.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/structured-context-compressor/SKILL.md · 48 lines

What it actually says

Structured Context Compressor

Use this skill when a free-form summary is too lossy and you need a reliable continuation artifact.

Use It For

  • long coding conversations
  • session handoff
  • agent-to-agent continuation
  • preserving user intent under context pressure

Quick Start

Render the standard template:

python3 {baseDir}/scripts/render_template.py

Then apply the prompt in references/prompt-template.md.

Nine Sections

  1. primary request and intent
  2. key technical concepts
  3. files and code sections
  4. errors and fixes
  5. problem solving
  6. all user messages
  7. pending tasks
  8. current work
  9. next aligned step

Highest-Value Rule

Preserve all user messages or an accurate equivalent. Do not compress away the corrections that changed the direction of work.

Supporting Files

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 48 lines · 36 tokens per session scan A 1747e3a0333f

Subscribe to this mod's changes

structured-context-compressor is a skill published in the GitHub repository LearnPrompt/cc-harness-skills (239 stars, last pushed 3mo ago), licensed MIT. It adds 36 tokens to every session and 282 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

agent-state-bar

A design guide for an agent status bar: a short, automatically updated summary of progress, remaining tasks, tool counts, errors, and system state placed near the latest model input.

bojieli/ai-agent-book · 105 tokens

knowledge-org

A guide to organising large bodies of knowledge so an AI system can navigate relationships, summaries, and layers instead of searching only flat text chunks. It covers tree indexes, knowledge graphs, file-like structures, incremental updates, and long-term memory layouts.

bojieli/ai-agent-book · 96 tokens

memory-system

A guide to giving an AI agent persistent, user-specific memory across conversations. It covers what to remember, how to store it, how to update or compress it, and when to use memory instead of a shared knowledge base.

bojieli/ai-agent-book · 95 tokens

context-compression

A guide to shortening the information an agent carries between steps. It explains how to replace large tool outputs and old conversation details with compact, useful summaries while preserving important decisions and constraints.

bojieli/ai-agent-book · 92 tokens

remem-mcp

Long-term memory for coding agents. Auto-applies at the start of any coding task — recall past context before answering, capture decisions/learnings/fixes after work, use CodeGraph instead of grep for symbol lookup. Invoke when you see [remem-mcp] in your context or when starting any non-trivial coding work.

tinhien11/remem-mcp · 71 tokens

write-terva-lore

Author terva lore. Lore is context that a person authors in files. terva injects it only when it is keyword-relevant, or always-on. Use to create/add/write lore, "world info", a lorebook entry, keyed background, or a book of facts for a character.

terva-sh/terva · 66 tokens