context-optimization

context-optimization is a skill for Claude Code from athola/claude-night-market. It costs 31 tokens per session (1,265 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: hooks in frontmatter. 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,265 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.01265
Opus 5 $0.00015 $0.00633
Sonnet 5 $0.00006 $0.00253
Haiku 4.5 $0.00003 $0.00127

Measured 5d ago against content hash a8c74b7b4177, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 5d 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 · 139 lines

How it starts

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

Table of Contents

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

Read the full file on GitHub · 139 lines

Files

What ships with it

9 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. 5d 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 (336 stars, last pushed 2d ago), licensed MIT. It adds 31 tokens to every session and 1,265 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-09-03.

Related

Other skills, from other repositories

preserve

Single write point for the vault. Centralizes entity detection, textual matching, entity creation/update, and bidirectional linking. Accepts structured input (list of entities), free-form input (text, meeting notes, session context), or graphify output (graph.json + obsidian markdown from /graphify pipeline). Use…

ccplugins/awesome-claude-code-plugins · 118 tokens

setup

Initialize any folder as a Bedrock-powered Obsidian vault. Creates entity directories, copies templates, configures language and domain taxonomy, scaffolds connected example entities, and checks dependencies. Use when: "bedrock setup", "bedrock-setup", "/bedrock:setup", "initialize vault", "setup vault", "create…

ccplugins/awesome-claude-code-plugins · 90 tokens

sync

Re-synchronizes the vault with external sources. In default mode, scans the sources field of all entities, deduplicates URLs, fetches updated content from each source (Confluence, GDocs, GitHub, Markdown), performs incremental diff and delegates writing to /bedrock:preserve. With --people, scans actor repositories via…

ccplugins/awesome-claude-code-plugins · 138 tokens

ask

Adaptive vault reader skill. Receives a natural language question, searches the vault first (Glob/Grep, entity reads, wikilink traversal), then self-assesses whether more context is needed. Escalates to /graphify for graph-level understanding or to /bedrock:teach for remote content ingestion only when the vault alone…

ccplugins/awesome-claude-code-plugins · 141 tokens

compress

Vault alignment engine. Detects and fixes 5 types of structural misalignments: broken backlinks, concept fragmentation, entity miscategorization, duplicated entities, and misnamed entities. Delegates all writes to /bedrock:preserve. Supports interactive mode (user confirmation) and cron mode (autonomous mechanical…

ccplugins/awesome-claude-code-plugins · 104 tokens

gdoc-to-markdown

Internal fetcher module for Google Docs and Sheets. Fetches content via MCP (preferred, when available), Google API with bearer token or public URL export (fallback), or browser DOM extraction via Claude in Chrome (last resort) and returns Markdown. Used by /bedrock:teach and /bedrock:sync — not intended for direct…

ccplugins/awesome-claude-code-plugins · 76 tokens