Skip to content
Development
Skill

/common-context-optimization

Manage context and prompt-cache costs without losing task state. Use for context management, orchestration cost, token budgets, large tool outputs, cache misses, or long-running conversations.

From plugin
agent-skills-standard
583200 skills21 agents33 commands1 MCP

Claude Code

$ npx -y skills add hoangnguyen0403/agent-skills-standard --skill common-context-optimization --agent claude-code

SKILL.md

common-context-optimization.SKILL.md
name: common-context-optimization
description: Manage context and prompt-cache costs without losing task state. Use for context management, orchestration cost, token budgets, large tool outputs, cache misses, or long-running conversations.
metadata:
  triggers:
    files:
      - "*.log"
      - "chat-history.json"
    keywords:
      - reduce tokens
      - optimize context
      - summarize history
      - clear output
      - context management
      - prompt-cache
      - prompt caching
      - orchestration cost

**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

  • [Compaction](references/compaction.md)
  • [Masking and output projection](references/masking.md)
  • [Implementation and cost measurement](references/implementation.md)
Read more
@hoangnguyen0403
Ships withagent-skills-standard

The portable standards layer for AI coding agents. Sync once, then work in your own runtime.

583200 skills21 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
583
Star history of hoangnguyen0403/agent-skills-standard on GitHub, a chart by star-history.com

Other skills on agent-skills-standard.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about common-context-optimization.

Which coding agents can use common-context-optimization?
common-context-optimization installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.