context-compactor

context-compactor is a skill for Claude Code from winstonkoh87/Athena-Public. It costs 30 tokens per session (905 once invoked), scanned A, original, MIT.

A session-summarising workflow that compresses a long conversation into a structured record of requests, decisions, files, errors, and feedback.

In plain words
What is it for?
Use it when the context is full, tokens are limited, or you need a detailed summary of the current session before continuing.
Why use it?
It helps preserve important context when a conversation becomes too large for the available context window, reducing the chance of losing earlier details.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; mentions Claude Code.

Good fit Use it when the context is full, tokens are limited, or you need a detailed summary of the current session before continuing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/winstonkoh87/athena-public/context-compactor
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 winstonkoh87/Athena-Public --skill context-compactor
Clone the repo
git clone --depth 1 https://github.com/winstonkoh87/Athena-Public

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 context-compactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/winstonkoh87/athena-public/context-compactor/github.svg)](https://agentmods.dev/skills/winstonkoh87/athena-public/context-compactor)
Your own site
<a href="https://agentmods.dev/skills/winstonkoh87/athena-public/context-compactor"><img src="https://agentmods.dev/badge/skills/winstonkoh87/athena-public/context-compactor/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 context-compactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/winstonkoh87/athena-public/context-compactor"><img src="https://agentmods.dev/badge/skills/winstonkoh87/athena-public/context-compactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 905 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 95
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00030 $0.00905
Opus 5 $0.00015 $0.00452
Sonnet 5 $0.00006 $0.00181
Haiku 4.5 $0.00003 $0.00090

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

Security

Grade A, and why

context-compactor 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 10d 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.

examples/skills/workflow/context-compactor/SKILL.md · 101 lines

How it starts

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

Semantic Context Compactor v2.0

Protects the session from Token Bloat and "Lost in the Middle" syndrome.

Source: Claude Code /compact prompt architecture (2026-03-31). Key Innovation: Uses an <analysis> scratchpad block (chain-of-thought) that gets stripped before the summary reaches context. The analysis improves summary quality but consumes no tokens in the final context window.

Triggers

"compact", "token limit", "clean memory", "summarize session", "context full"

Execution Protocol

Step 1: Analysis Phase (Private Scratchpad)

Wrap your analysis in <analysis> tags. This is a drafting scratchpad that will be stripped from the final output. In your analysis:

  1. Chronologically analyze each message and section of the conversation. For each section thoroughly identify:
    • The user's explicit requests and intents
    • Your approach to addressing the user's requests
    • Key decisions, technical concepts and frameworks discussed
    • Specific details like: file names, full code snippets, function signatures, file edits
    • Errors you ran into and how you fixed them
    • Specific user feedback — especially if the user told you to do something differently
  2. Double-check for technical accuracy and completeness

Step 2: 9-Section Summary (Structured Output)

After analysis, produce a summary in <summary> tags with exactly these sections:

1. Primary Request and Intent
   — Capture ALL explicit user requests and intents in detail

2. Key Technical Concepts
   — List all important technical concepts, technologies, and frameworks discussed

3. Files and Code Sections
   — Enumerate specific files examined, modified, or created
   — Include full code snippets where applicable
   — Include WHY each file read or edit is important

4. Errors and Fixes
   — List ALL errors encountered + how fixed + user feedback on each

5. Problem Solving
   — Document problems solved and ongoing troubleshooting

6. All User Messages (Non-Tool-Result)
   — Verbatim list of ALL user messages
   — CRITICAL for detecting intent drift across the session

7. Pending Tasks
   — Outline any pending tasks explicitly asked to work on

8. Current Work
   — Describe in detail precisely what was being worked on IMMEDIATELY before this summary
   — Include file names and code snippets

9. Optional Next Step
   — Only if directly in line with user's most recent explicit request
   — Include DIRECT QUOTES from the most recent conversation
   — Do NOT start on tangential or old completed requests

Read the full file on GitHub · 101 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. 10d ago First seen · 101 lines · 30 tokens per session scan A 0ccd82050653

Subscribe to this mod's changes

context-compactor is a skill published in the GitHub repository winstonkoh87/Athena-Public (585 stars, last pushed yesterday), licensed MIT. It adds 30 tokens to every session and 905 once invoked, about $0.0002 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-30.