compact-instructions

compact-instructions is a skill for Claude Code, Codex from avizmarlon/agent-skills. It costs 46 tokens per session (747 once invoked), scanned A, original, MIT.

A set of instructions for preserving important project context when an AI coding session is shortened or restarted because of its context limit. It identifies what to retain, such as the objective, blockers, decisions, tests, branch state, and next step.

In plain words
What is it for?
It helps prepare information for manual or automatic context compaction, so a later session can quickly recover the current objective, validation status, worktree state, and next action.
Why use it?
When a session loses context, an agent may repeat finished work or miss unresolved problems. These instructions keep the facts needed to continue the project accurately.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit It helps prepare information for manual or automatic context compaction, so a later session can quickly recover the current objective, validation status, worktree state, and next action.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/avizmarlon/agent-skills/compact-instructions
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 avizmarlon/agent-skills --skill compact-instructions
Clone the repo
git clone --depth 1 https://github.com/avizmarlon/agent-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 compact-instructions

README.md
[![agentmods](https://agentmods.dev/badge/skills/avizmarlon/agent-skills/compact-instructions/github.svg)](https://agentmods.dev/skills/avizmarlon/agent-skills/compact-instructions)
Your own site
<a href="https://agentmods.dev/skills/avizmarlon/agent-skills/compact-instructions"><img src="https://agentmods.dev/badge/skills/avizmarlon/agent-skills/compact-instructions/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 compact-instructions

Your own site · 80×15
<a href="https://agentmods.dev/skills/avizmarlon/agent-skills/compact-instructions"><img src="https://agentmods.dev/badge/skills/avizmarlon/agent-skills/compact-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 747 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.
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.00046 $0.00747
Opus 5 $0.00023 $0.00374
Sonnet 5 $0.00009 $0.00149
Haiku 4.5 $0.00005 $0.00075

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

Security

Grade A, and why

compact-instructions 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 9d 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.

skills/compact-instructions/SKILL.md · 58 lines

How it starts

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

Compact Instructions: Context Preservation Strategy

When a Claude Code session approaches context-window limits and performs context compaction (manual /compact or automatic), the agent must balance information density with continuity. This skill defines what to preserve and what to discard.

What to Preserve

  • Current objective / phase — one-line statement of what the session is actively working on
  • Blockers and open blockers — issues preventing forward progress, with minimal context
  • Decisions that remain valid — architectural or planning decisions made in earlier sessions that still apply
  • Validation state — which tests are passing, which requirements are met, which gates are open/blocked
  • Worktree / branch state — when relevant to resuming work (branch name, uncommitted changes, PR status)
  • Next concrete step — what the next AI session should do immediately after loading context

What to Discard

  • Resolved conversations — back-and-forth debugging or decision-making that concluded
  • Repeated reasoning — the same analysis or explanation presented multiple times across the session
  • Discarded attempts — approaches tried and rejected, unless the rejection reason remains strategically important
  • Large tool outputs — full log dumps, verbose grep results, API responses in their entirety (keep only the relevant extracted data)
  • Intermediate mental models — exploratory reasoning or "let me think through this" passages that didn't lead to decision

Critical Principle

The compact summary is a sketch, not a replacement for durable state. If the project has a session-handoff.md, PROGRESS.md, CHANGELOG.md, or equivalent living documentation, those files remain the source of truth. The compacted context is temporary and lossy — it buys context space in the current session, but it does not eliminate the need to maintain formal handoff documents for the next session.

If compaction is being used to work around missing handoff documentation, that is a symptom — fix the root cause (write the missing session-handoff.md or PROGRESS.md) rather than relying on compaction to carry state.

Read the full file on GitHub · 58 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. 9d ago First seen · 58 lines · 46 tokens per session scan A 15d25daf21fe

Subscribe to this mod's changes

compact-instructions is a skill published in the GitHub repository avizmarlon/agent-skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 747 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-31.

Related

Other skills, from other repositories

agent-carnet

Use this skill when the user asks to save, recall, find, or organize notes. Triggers on: 'remember this', 'save this', 'note this', 'what did we discuss about...', 'check the notebook', 'find in carnet'. Also use proactively when discovering findings worth preserving across sessions.

yamadashy/repomix · 67 tokens

taiyi-compress

A workflow tool for shrinking large coding-agent conversations and work files into shorter context notes. It can also coordinate separate agents for parallel development and create handoff notes for continuing work in a new session.

Dong90/oh-my-taiyiforge · 51 tokens

maestro

Curador del conocimiento local de un proyecto bajo bucle ralph. Mantiene un conjunto de skills locales (metodologías, pitfalls y decisiones del proyecto) para que futuras iteraciones planifiquen y ejecuten sin dar palos de ciego. Su acción review lee el plan y los logs tras una tarea y crea, extiende o borra esas…

SantanderAI/ralph · 80 tokens

codebase-memory-mcp

Resolve canonical Git checkouts, index and verify codebase-memory-mcp graphs through the guarded CLI, and safely audit duplicate worktree caches. Use when a user mentions codebase memory MCP, searchgraph, tracepath, indexrepository, worktree indexes, or oversized graph caches.

vincentkoc/dotskills · 62 tokens

save-md

Saves a named source to Markdown with provenance and faithful extraction through direct export endpoints. Use when asked to "save this article", "get the markdown", "transcribe this", or "keep this source". A URL supplied as task context alone does not trigger conversion; a chat summary stays in chat.

mblode/agent-skills · 64 tokens

search

Search the gnosis-mcp knowledge base. Keyword (default), hybrid semantic+keyword (--semantic), or git commit history (--git). Includes sanity checks and a reranker warning.

nicholasglazer/gnosis-mcp · 38 tokens