claude-code-minimax: Agent for Claude Code

.claude/agents/context-optimizer.md

context-optimizer is an agent for Claude Code from zapprosite/claude-code-minimax. It costs 26 tokens per session (1,086 once invoked), scanned A, original, MIT.

An agent that reviews how much working context a coding session uses and suggests ways to reduce it. Context is the information available to the assistant while it works.

In plain words
What is it for?
Use it to inspect active context, find large source files, identify unused Python imports or TypeScript exports, and locate debug logs.
Why use it?
Long files, unused imports, unused exports, and debug output can make sessions harder to manage and leave less room for new work.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; positional $N argument.

This is zapprosite/claude-code-minimax's own configuration. It tells Claude Code how to work on claude-code-minimax itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-code-minimax configures →

Reuse

Borrowing it

Nothing to install: this file belongs to zapprosite/claude-code-minimax. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zapprosite/claude-code-minimax/master/.claude/agents/context-optimizer.md
Clone the repo
git clone --depth 1 https://github.com/zapprosite/claude-code-minimax

Made for: Claude Code.

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/agents/zapprosite/claude-code-minimax/context-optimizer/github.svg)](https://agentmods.dev/agents/zapprosite/claude-code-minimax/context-optimizer)
Your own site
<a href="https://agentmods.dev/agents/zapprosite/claude-code-minimax/context-optimizer"><img src="https://agentmods.dev/badge/agents/zapprosite/claude-code-minimax/context-optimizer/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-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/agents/zapprosite/claude-code-minimax/context-optimizer"><img src="https://agentmods.dev/badge/agents/zapprosite/claude-code-minimax/context-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,086 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.
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.00026 $0.01086
Opus 5.5 $0.00010 $0.00434
Sonnet 5.5 $0.00005 $0.00217
Haiku 4.5 $0.00003 $0.00109

Measured 1mo ago against content hash ee077f764d08, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

.claude/agents/context-optimizer.md · 131 lines

How it starts

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

Context Optimizer Agent

Analisa o estado atual do contexto e sugere ações para preservar a janela de contexto.

Análise de Contexto

1. Session Status

# Verificar sessões ativas
mcp__memory-keeper__context_status

# Listar canais
mcp__memory-keeper__context_list_channels includeEmpty=true

# Estatísticas
mcp__memory-keeper__context_channel_stats includeInsights=true

2. Tamanho de Arquivos Recentes

# Arquivos >300 LOC — candidatos a cleanup
find . -name "*.py" -o -name "*.ts" -o -name "*.js" -o -name "*.tsx" | \
  xargs wc -l 2>/dev/null | sort -rn | head -20

# Arquivos >500 LOC
find . -name "*.py" -o -name "*.ts" -o -name "*.js" -o -name "*.tsx" | \
  xargs wc -l 2>/dev/null | awk '$1 > 500' | sort -rn

3. Imports/Props Mortos

# Imports não usados em Python
grep -rnE "^import |^from " --include="*.py" . | grep -v "^[^:]*:[^:]*#" | \
  awk -F: '{print $1 ":" $2}' | sort -u > /tmp/all_imports.txt

# Exports não usados em TypeScript
grep -rnE "export (const|function|class|type|interface)" --include="*.ts" --include="*.tsx" .

4. Console Logs e Debug

# Debug logs em código
grep -rnE "console\.(log|debug|info|warn|error)" --include="*.js" --include="*.ts" --include="*.tsx" .
grep -rnE "print\(.*DEBUG|logger\.debug|log\.debug" --include="*.py" .

# TODO/FIXME/HACK órfãos
grep -rnE "TODO|FIXME|HACK|XXX" --include="*.py" --include="*.js" --include="*.ts" --include="*.tsx" .

5. Memória de Sessão

# Verificar se há itens de sessão >10 mensagens
mcp__memory-keeper__context_get sessionId=current limit=50 sort=created_desc

Sugestões de Compactação

Ações Imediatas

  1. Remover console.logs órfãos — reducen ruido na leitura
  2. Deletar imports não usados — import statements ocupam linhas
  3. Limpar props mortos — props que não são mais usados em components

Ações de Contexto

  1. Checkpoint antes de cleanup — mcp__memory-keeper__context_checkpoint name="pre-cleanup"
  2. Compactar sessões antigas — mcp__memory-keeper__context_compress olderThan="30 days"
  3. Escrever session summary — salvar estado em context-log.md

Read the full file on GitHub · 131 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. 1mo ago First seen · 131 lines · 26 tokens per session scan A ee077f764d08

Subscribe to this mod's changes

context-optimizer is an agent published in the GitHub repository zapprosite/claude-code-minimax (2 stars, last pushed 6mo ago), licensed MIT. It adds 26 tokens to every session and 1,086 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-08-31.

Related

Other agents, from other repositories

context-finder

Read-only, memory- and index-aware codebase search. Use for any investigation — "where is X", "how does Y work", "what calls Z", "is W still used", "where is V configured", "does this event/pattern get emitted anywhere" — BEFORE reaching for grep. Consults the code index and prior session memory first and greps last…

futuregerald/futuregerald-claude-plugin · 107 tokens

wiki-ingest

Use this agent when ingesting URLs, files, or pasted text into the vault during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY ingestion, batch source processing, or converting raw captures to typed-knowledge pages. See "When to invoke" in the agent body for worked scenarios.

karlorz/llm-wiki · 64 tokens

data scientist

Ecosystem Data Scientist.

khalilbenaz/MDAN · 8 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens