common-context-optimization

common-context-optimization is a skill for Claude Code, Codex from HoangNguyen0403/agent-skills-standard. It costs 40 tokens per session (466 once invoked), scanned A, original, MIT.

A set of methods for managing limited context in long coding-agent sessions. Context is the text and tool output the agent can consider at once.

In plain words
What is it for?
Use it to summarize oversized tool output, compact long conversations, preserve goals and decisions, and organize prompts for more efficient agent work.
Why use it?
It reduces noise from large logs and lists, preserves important task state during summarization, and helps avoid losing key information in long conversations. It also considers repeated prompt text that can affect response speed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to summarize oversized tool output, compact long conversations, preserve goals and decisions, and organize prompts for more efficient agent work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hoangnguyen0403/agent-skills-standard/common-context-optimization
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 HoangNguyen0403/agent-skills-standard --skill common-context-optimization
Clone the repo
git clone --depth 1 https://github.com/HoangNguyen0403/agent-skills-standard

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 common-context-optimization

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/hoangnguyen0403/agent-skills-standard/common-context-optimization"><img src="https://agentmods.dev/badge/skills/hoangnguyen0403/agent-skills-standard/common-context-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 466 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.00040 $0.00466
Opus 5.5 $0.00016 $0.00186
Sonnet 5.5 $0.00008 $0.00093
Haiku 4.5 $0.00004 $0.00047

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

Security

Grade A, and why

common-context-optimization 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 today.

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.

.agents/skills/common/common-context-optimization/SKILL.md · 43 lines

What it actually says

Priority: P1 (HIGH)

Workflow

  1. Inspect host capabilities; do not assume agents can rewrite history, prompts, or memory.
  2. Project outputs after consuming them: retain decisions, evidence, errors, and required values; point to complete logs/artifacts by stable reference.
  3. Bound context at host-supported boundaries. Carry goal, active slice, authority, decisions, blockers, evidence links, and next action; preserve a stable append-only prefix where supported.
  4. Compact only when useful and supported. Keep required details retrievable; never discard source evidence or rely on a fixed turn/token threshold.
  5. Measure cache reads, replayed input, and total actor cost across the whole task. Separate observed usage from estimates; no invoice, savings, or efficacy claims without evidence.

Anti-Patterns

  • No history rewrite assumption: Project outputs or create artifact references; use only host-supported controls.
  • No fixed threshold: Compact from observed context pressure and task needs, not a universal turn/token count.
  • No evidence deletion: Keep stable references to source outputs, decisions, and verification. Archive required packets, reports and receipts at durable references before cleanup.
  • No omission-as-optimization: Never claim savings from suppressing required instruction bodies. Selection or body-return counts are not acknowledgment, comprehension, or enforcement.
  • No partial cost claim: Include cache reads, replay, and total actor cost; label estimates. Missing coverage or rates means no savings claim.

References

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. today Changed · +1 lines d58365f38068
  2. 19d ago Changed · -18 lines · -12 tokens per session e0756d938897
  3. 1mo ago First seen · 60 lines · 52 tokens per session scan A 0c292b0274a1

Subscribe to this mod's changes

common-context-optimization is a skill published in the GitHub repository HoangNguyen0403/agent-skills-standard (583 stars, last pushed today), licensed MIT. It adds 40 tokens to every session and 466 once invoked, about $0.0002 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

inspector-workbench

Runs Inspector UI work on the standalone Threads state lab so the agent can see the overlay. Use when a CopilotKit employee asks an agent to fix, polish, add, or debug Inspector UI, chrome, panes, overlay actions, launcher, Home, Threads, Playground, Memory, or any visual behavior in @copilotkit/web-inspector. Don't…

CopilotKit/CopilotKit · 112 tokens

nextjs-idioms

Next.js App Router architecture: React Server Components (RSC), Server Actions, nested layouts, route handlers, and streaming. Use when building or refactoring Next.js web applications. Pair with react-idioms and typescript-idioms.

irahardianto/awesome-agv · 55 tokens

react-idioms

React 19+ patterns: custom hooks, Suspense boundaries, state management, component composition, and web performance. Use when developing or refactoring React components and client applications. Pair with typescript-idioms.

irahardianto/awesome-agv · 48 tokens

elite-engineer

The operating system for elite software engineering in TypeScript, React, and Next.js. Enforces the cognitive models, architecture laws, type-level patterns, component design, visual standards, and performance mandates that separate exceptional software from the ordinary — grounded in named sources (Torvalds…

Kerim-Sabic/elite-engineer · 167 tokens

oma-frontend

Implement or modify web UI in React, Next.js, or Angular. Use for components, pages, styles, forms, and frontend state or data flows.

first-fluke/fullstack-starter · 35 tokens

design-patterns

Frontend design patterns with React 19.2 and TypeScript 6 examples (Composition, Compound Components, Custom Hooks, Render Props, HOC, State Machines). Use when user asks "implement pattern", "use composition", or when designing reusable components.

altmemy/claude-code-templates · 55 tokens