context-optimizer

context-optimizer is a skill for Claude Code, Codex from anshmajumdar121/context-optimizer. It costs 75 tokens per session (1,672 once invoked), scanned A, original, MIT.

A code-context guide that creates a project manifest and limits how much source code the assistant reads at once.

In plain words
What is it for?
Use it to generate a project context manifest, check the likely impact of changed files, view context limits, or install and reload its rules.
Why use it?
It reduces unnecessary file reading and keeps the assistant focused on the files most affected by a change.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/anshmajumdar121/context-optimizer/context-optimizer-skill
Any agent
npx skills add anshmajumdar121/context-optimizer --skill context-optimizer-skill
Clone the repo
git clone --depth 1 https://github.com/anshmajumdar121/context-optimizer

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 context-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/anshmajumdar121/context-optimizer/context-optimizer-skill.svg)](https://agentmods.dev/skills/anshmajumdar121/context-optimizer/context-optimizer-skill)
Your own site
<a href="https://agentmods.dev/skills/anshmajumdar121/context-optimizer/context-optimizer-skill"><img src="https://agentmods.dev/badge/skills/anshmajumdar121/context-optimizer/context-optimizer-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,672 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00075 $0.01672
Opus 5 $0.00037 $0.00836
Sonnet 5 $0.00015 $0.00334
Haiku 4.5 $0.00007 $0.00167

Measured 4d ago against content hash 38f04b5d0ec7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context-optimizer 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 4d 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.

Origin

Copies of this mod

3 near-identical copies found in the catalogue:

context-optimizer-skill/SKILL.md · 174 lines

How it starts

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

Context Optimizer

Quick Reference

Command Purpose
/context-optimizer <path> Generate CONTEXT_MANIFEST.md for a project
/context-optimizer blast <path> --files file1,file2 Run blast-radius analysis on changed files
/context-optimizer install <path> Run full-stack installer (idempotent)
/context-optimizer reload Reset all skill rules for this session
/context-optimizer status Show current token budget and active limits

Primary Directive

You are a structural, token-minimal code assistant. NEVER dump files or directories. ALWAYS reason from CONTEXT_MANIFEST.md first. Fetch only what is strictly necessary. Compress all output. Preserve 100% technical accuracy.

Context Rules (Hard Limits)

  1. CONTEXT_MANIFEST.md is the ONLY source for dependency/context discovery.
  2. MAX 3 files per turn. Snippets (10–30 lines) preferred over full files.
  3. NEVER scan directories, list files, or read unrequested paths.
  4. If context is missing, ask for ONE specific file/path. Do not guess.
  5. Use blast-radius data from the manifest to prioritize high-impact files.

Manifest Generation

When the user provides a project path, run the mapper:

python3 tools/context_mapper.py <project-path>

Output files:

  • CONTEXT_MANIFEST.md — human + AI readable structural index
  • .claude/graph.json — machine-readable dependency graph

Blast-radius query:

python3 tools/context_mapper.py <project-path> --blast-radius file1.py,file2.py

Returns a JSON report of all files affected by the specified changes, with estimated token cost.

Output Format (Strict)

Every response MUST begin with this exact structure:

**Summary:** [1 line max]
**Impact:** [modules affected] | Blast: [scope] | Risk: [LOW/MED/HIGH]
**Next Steps:**
- [step 1]
- [step 2]
**Tokens:** ~[est] | [compression note]

Rules:

  • Use diffs/patches. Show only changed/relevant lines with // ... or # ....
  • Drop filler, pleasantries, hedging, and step-by-step narration.
  • Code, commands, paths, and technical terms: UNTOUCHED.
  • If format drifts, self-correct immediately.

Read the full file on GitHub · 174 lines

Files

What ships with it

1 file 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. 4d ago First seen · 174 lines · 75 tokens per session scan A 38f04b5d0ec7

Subscribe to this mod's changes

context-optimizer is a skill published in the GitHub repository anshmajumdar121/context-optimizer (5 stars, last pushed 3mo ago), licensed MIT. It adds 75 tokens to every session and 1,672 once invoked, about $0.0004 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

vibing-chat-recall

Use when a vibing.nvim chat session's context feels lost or discontinuous — after a session reset, a dropped connection, or when Claude's own reasoning no longer matches what was discussed earlier in this conversation. Re-reads this conversation's own chat buffer (the buffer announced via the "Current vibing.nvim chat…

shabaraba/vibing.nvim · 130 tokens

deep-context

Build deep codebase understanding using Capsule context, progressive-reader, and specialist agents instead of overwhelming main context. Triggers on: don't have context, understand codebase, learn about, need background. Implements progressive context building.

arpitnath/claude-capsule-kit · 47 tokens

knowledge-base

Create and maintain a Markdown knowledge base that any AI agent can read, search, and update. Use when the user wants to start a knowledge base, add or update notes, organize docs/notes for an agent or LLM to consume, build an index of notes, or run a cleanup/maintenance pass on an existing MD knowledge base. Triggers…

wonderwhy-er/DesktopCommanderMCP · 112 tokens

agent-memory

../../../engineering/agent-memory/skills/agent-memory/SKILL.md.

alirezarezvani/claude-skills · 0 tokens

offensive-c2-frameworks

Command and Control framework deployment, configuration, and operational tradecraft for red team engagements. Covers Cobalt Strike (malleable C2 profiles, Beacon types HTTP/HTTPS/DNS/SMB, Beacon Object Files for in-memory execution, sleep and jitter tuning, named pipe pivoting), Sliver (implant generation across…

SnailSploit/Claude-Red · 250 tokens

memory-management

Guide the agent to recall, remember, and route durable learning into Memory, Skills, Scheduled Tasks, or Tape.

ThinkInAIXYZ/deepchat · 26 tokens