claude

context-optimizer

See what Claude costs you and spend less of it. In chat: hand a long chat over to a new one, digest long documents, set up Projects, check tokens, sharpen prompts. In Claude Code: Haiku 5.5 subagents for reading and test runs; /cco audit of your own transcripts. Local, no telemetry.

130 on GitHubby Egor Fedorovv5.1.1MITupdated 3 days ago
/

Plugin context-optimizer from marketplace cco in egorfedorov/claude-context-optimizer. Commands read from the repo's manifest — 2 days ago.

This plugin runs code on your machine — its hooks fire automatically on events like tool use. The exact commands are listed below; read them before installing.

What it installs

Skills (6)

  • cco

    In Claude Code: what this session costs and where the tokens go, plus the tools to cut it — /cco for the board, /cco audit, /cco task, /cco pack and more. Use when the user asks about session cost, context size, savings, or wants a task tracked across /compact.

  • doc-digest

    Turn a long document, PDF, transcript, spreadsheet or log into a compact working digest the conversation can continue from. Use when the user shares or pastes something long (several pages or more) and wants to discuss, analyze, compare or use it over more than one message, or asks to summarize a do

  • fresh-start

    Continue in a new chat without losing anything — writes a compact handoff to paste into a fresh conversation. Use whenever the user wants to move to a new chat or conversation, hits usage limits, says replies got slow or Claude forgets earlier details, or the conversation has grown long.

  • project-context

    Turn background the user keeps re-explaining or re-pasting into reusable instructions, so new chats start with it for free. Use when the user repeats the same context, rules, style guide, persona or reference text across messages or chats, says they are tired of explaining the same thing, or asks ho

  • sharpen-prompt

    Rewrite a vague request into a precise prompt — goal, context, scope, constraints, what done looks like, output format. Use when the user asks to improve, rewrite, sharpen or check a prompt.

  • token-check

    Estimate how many tokens a pasted text, an attached file or the conversation so far takes, what it means for the context window and usage limits, and how to cut it. Use when the user asks how big something is in tokens, why they keep hitting limits, or whether a file is too large to send.

Subagents (3)

  • context-analyzer

    Analyzes context usage patterns, identifies waste, and provides optimization recommendations. Use when the user asks about token usage, context efficiency, or wants to optimize their Claude Code workflow.

  • runner

    Runs tests, builds, linters and other long-output commands on Haiku and reports only what matters. Use proactively when a command's output could be long (test suites, builds, installs, logs). Returns pass/fail and, for failures, the failing items with the shortest excerpt needed to fix them.

  • scout

    Cheap read-only explorer on Haiku. Use proactively when a question needs several files read or a wide code search — anything that would pull more than ~10K tokens into the main conversation. Returns a short answer with file:line references. Not worth it for one known file or a single grep.

Hooks (6)

  • PreToolUse

    test -f "${CLAUDE_PLUGIN_ROOT}/src/hook.js" || exit 0; node "${CLAUDE_PLUGIN_ROOT}/src/hook.js"

  • PostToolUse

    test -f "${CLAUDE_PLUGIN_ROOT}/src/hook.js" || exit 0; node "${CLAUDE_PLUGIN_ROOT}/src/hook.js"

  • UserPromptSubmit

    test -f "${CLAUDE_PLUGIN_ROOT}/src/hook.js" || exit 0; node "${CLAUDE_PLUGIN_ROOT}/src/hook.js"

  • PreCompact

    test -f "${CLAUDE_PLUGIN_ROOT}/src/hook.js" || exit 0; node "${CLAUDE_PLUGIN_ROOT}/src/hook.js"

  • SessionStart

    test -f "${CLAUDE_PLUGIN_ROOT}/src/hook.js" || exit 0; node "${CLAUDE_PLUGIN_ROOT}/src/hook.js"

  • SessionEnd

    test -f "${CLAUDE_PLUGIN_ROOT}/src/hook.js" || exit 0; node "${CLAUDE_PLUGIN_ROOT}/src/hook.js"

View source on GitHub egorfedorov.github.io

Similar plugins

Appends two or three short follow-up questions after a substantive answer to help users check key facts, probe the reasoning, and notice missing context

19 skills

anthropics/skills 193,780

Token usage tracking, model cost attribution per agent, budget alerts, and optimization recommendations

24 skills · 1 command · 1 agent · hooks

ruvnet/ruflo 81,589

Skill: add headroom-ai compress() to a Python or TypeScript app to cut LLM input tokens (tool outputs, logs, JSON, chat history). No API key.

1 skill

headroomlabs-ai/headroom 79,508

mem0

claudecodex

Cross-session memory and token savings for coding agents.

6 skills · 1 agent · 1 MCP server · hooks

mem0ai/mem0 68,893

context7

claudecodex

Up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your coding agent's context.

1 MCP server

upstash/context7 64,709

Perform AI code review on Git diffs — supports workspace changes, branch ranges, and single commits with concurrent per-file analysis, codebase search, and deep context-aware review.

2 commands

alibaba/open-code-review 50,068

Maintain context-optimizer?

This page updates itself from your repo. Add the badge to your README, or get it Featured to pin it above the organic results with a followed link to your site.

claude & codex pluginslisted