context-optimization

context-optimization is a skill for Claude Code from athola/claude-night-market. It costs 31 tokens per session (1,116 once invoked), scanned A, original, MIT.

A system for managing how much of an AI coding session's conversation remains active. It groups older information into less prominent layers and helps select context-management steps for long tasks.

In plain words
What is it for?
It assesses context use, chooses supporting modules, coordinates subagents, and allocates the available context budget.
Why use it?
It reduces context pressure so multi-step work has room for relevant instructions, files, and tool results.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents; mentions Claude Code.

Part of the conserve plugin — 15 skills, 6 commands, 5 agents shipped together

Good fit It assesses context use, chooses supporting modules, coordinates subagents, and allocates the available context budget.

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

Made for: Claude Code.

Or install conserve, the plugin that ships this one along with the rest of its 15 skills, 6 commands, 5 agents.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/athola/claude-night-market/context-optimization"><img src="https://agentmods.dev/badge/skills/athola/claude-night-market/context-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,116 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.00031 $0.01116
Opus 5.5 $0.00012 $0.00446
Sonnet 5.5 $0.00006 $0.00223
Haiku 4.5 $0.00003 $0.00112

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

Security

Grade A, and why

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 7d 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.

plugins/conserve/skills/context-optimization/SKILL.md · 118 lines

How it starts

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

Context Optimization Hub

When To Use

  • Threshold Alert: When context usage approaches 50% of the window.
  • Complex Tasks: For operations requiring multi-file analysis or long tool chains.

When NOT To Use

  • Simple single-step tasks with low context usage
  • Already using mcp-code-execution for tool chains

Core Hub Responsibilities

  1. Assess context pressure and MECW compliance.
  2. Route to appropriate specialized modules.
  3. Coordinate subagent-based workflows.
  4. Manage token budget allocation across modules.
  5. Synthesize results from modular execution.

Module Selection Strategy

def select_optimal_modules(context_situation, task_complexity):
    if context_situation == "CRITICAL":
        return ["mecw-assessment", "subagent-coordination"]
    elif task_complexity == "high":
        return ["mecw-principles", "subagent-coordination"]
    else:
        return ["mecw-assessment"]

Context Classification

Utilization Status Action
< 30% LOW Continue normally
30-50% MODERATE Monitor, apply principles
> 50% CRITICAL Immediate optimization required

Large Output Handling (Claude Code 2.1.2+)

Behavior Change: Large bash command and tool outputs are saved to disk instead of being truncated, and file references are provided for access.

Impact on Context Optimization

Scenario Before 2.1.2 After 2.1.2
Large test output Truncated, partial data Full output via file reference
Verbose build logs Lost after 30K chars Complete, accessible on-demand
Context pressure Less from truncation Same - only loaded when read

Best Practices

  • Avoid pre-emptive reads: Large outputs arrive as file references and stay out of context until read.
  • Read selectively: Use head, tail, or grep on file references.
  • Use full data: Quality gates can access complete test results via files.
  • Monitor growth: File references are small, but reading the full files adds to context.

Read the full file on GitHub · 118 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. 7d ago Changed · -1 lines d533b98b1873
  2. 17d ago Changed c5d4069db244
  3. 25d ago Changed · -1 lines dd730bb7b29d
  4. 1mo ago Changed · -21 lines e6dafc5d9573
  5. 1mo ago Changed · +11 lines 79b32616e055
  6. 2mo ago Changed · -9 lines 6356a54dbbd0
  7. 2mo ago First seen · 139 lines · 31 tokens per session scan A a8c74b7b4177

Subscribe to this mod's changes

context-optimization is a skill published in the GitHub repository athola/claude-night-market (358 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 1,116 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-09-03.

Related

context-optimization compared with skills from other repositories

context-optimization next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context-optimizationathola/claude-night-marketSkill358todayMITA31Claude Code
setupccplugins/awesome-claude-code-pluginsSkill1.0k3mo agoApache-2.0A90Claude Code
syncccplugins/awesome-claude-code-pluginsSkill1.0k3mo agoApache-2.0A138Claude Code
preserveccplugins/awesome-claude-code-pluginsSkill1.0k3mo agoApache-2.0A118Claude Code
askccplugins/awesome-claude-code-pluginsSkill1.0k3mo agoApache-2.0A141Claude Code
compressccplugins/awesome-claude-code-pluginsSkill1.0k3mo agoApache-2.0A104Claude Code
checkpointShweta-Mishra-ai/tokenmizerSkill35todayMITA61Claude Code