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.
git clone --depth 1 https://github.com/gonzalezpazmonica/saviaWrote 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.
[](https://agentmods.dev/commands/gonzalezpazmonica/savia/context-optimize)<a href="https://agentmods.dev/commands/gonzalezpazmonica/savia/context-optimize"><img src="https://agentmods.dev/badge/commands/gonzalezpazmonica/savia/context-optimize/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.
<a href="https://agentmods.dev/commands/gonzalezpazmonica/savia/context-optimize"><img src="https://agentmods.dev/badge/commands/gonzalezpazmonica/savia/context-optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00019 | $0.00938 |
| Opus 5 | $0.00010 | $0.00469 |
| Sonnet 5 | $0.00004 | $0.00188 |
| Haiku 4.5 | $0.00002 | $0.00094 |
Grade A, and why
context-optimize 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 2d 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- context-optimize — 100% identical, 0 lines differ
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-optimize
🦉 Savia analiza cómo usas el contexto y sugiere cómo mejorarlo.
Cargar perfil de usuario
Grupo: Memory & Context — cargar:
identity.md— slug (para aislar datos por usuario)
Ver .claude/profiles/context-map.md.
Flujo
Paso 1 — Leer log de uso de contexto
- Verificar que existe
$HOME/.pm-workspace/context-usage.log - Si no existe → informar que el tracking no está activo
- Si existe → parsear entradas (formato:
timestamp|comando|fragmentos|tokens_est)
Paso 2 — Analizar patrones
- Fragmentos más cargados: Ranking de ficheros por frecuencia de carga
- Fragmentos menos cargados: Ficheros que se cargan pero raramente se usan
- Co-ocurrencias: Pares de comandos que se ejecutan juntos frecuentemente
- Cargas innecesarias: Fragmentos cargados por el context-map pero que no aparecen en outputs
- Cargas faltantes: Comandos seguidos de recarga inmediata (señal de contexto insuficiente)
Paso 3 — Generar recomendaciones
Para cada hallazgo, generar recomendación con nivel de confianza:
- Alta confianza (>20 ocurrencias): Sugerir cambio en context-map
- Media confianza (10-20): Sugerir revisión por el usuario
- Baja confianza (<10): Solo informar, no recomendar cambio
Tipos de recomendación:
- Degradar: Mover fragmento de carga obligatoria a opcional
- Promover: Mover fragmento de NO-cargar a cargar
- Agrupar: Fusionar grupos del context-map que siempre se usan juntos
- Separar: Dividir un grupo que carga fragmentos con uso desigual
- Pre-mapear: Añadir comandos al context-map que siempre se ejecutan en secuencia
Paso 4 — Mostrar informe
Banner: 🦉 Context Optimization — análisis de {N} sesiones
📊 Resumen de uso
Sesiones analizadas: {N}
Período: {fecha_inicio} — {fecha_fin}
Tokens estimados consumidos: {total}
Tokens estimados ahorrables: {ahorro} ({porcentaje}%)
🔍 Hallazgos
{lista de hallazgos con nivel de confianza}
💡 Recomendaciones
{lista de recomendaciones priorizadas}
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.
- 2d ago First seen · 131 lines · 19 tokens per session scan A 80dfff0534dc
context-optimize is a command published in the GitHub repository gonzalezpazmonica/savia (50 stars, last pushed yesterday), licensed MIT. It adds 19 tokens to every session and 938 once invoked, about $0.0001 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-06.
Other commands, from other repositories
remember
Consolidate stashes + friction into project memory.
chain-load
Loads the most recent chain link to continue work from a previous session.
stash
Stash session context [name].
sm-search
Ad-hoc semantic search over the supamem dual-memory collection.
handoff
Emit a handoff artifact for this session (optionally specify a slug).
resume-from
Boot this session from a handoff artifact (slug, latest, or path).