Skill de modo cavernícola: token-diet para respuestas concisas, menos relecturas y /compact
Dmitriy Solodukha, desarrollador de Caprock · Publicado el
Probado el en Claude Code y Codex
Pide el modo cavernícola y la skill token-diet hace que el agente sea conciso, lea menos y sugiera /compact en el momento adecuado, en Claude Code y Codex.
Di "caveman mode" y la skill token-diet hace que el agente dé la respuesta primero y se detenga: sin preámbulo, sin repetir la pregunta, sin recapitulación, código sin comentarios. También cambia cómo trabaja, ya que la mayoría de los tokens se destinan a lo que lee el agente: buscar antes de leer, leer rangos de líneas, no volver a leer nunca un archivo que acaba de editar, recortar la salida de los comandos. Y te indica cuándo usar /compact o empezar de nuevo, con el enfoque que debe tener el resumen.
Instala la skill token-diet
Un comando por agente. La skill es un único SKILL.md; no se ejecuta nada al instalarla.
Las nueve skills como plugin. Escribe esto dentro de Claude Code:
O solo esta skill, desde la carpeta de tu proyecto en una terminal:
Añade -g para instalarla en todos los proyectos.
Desde la carpeta de tu proyecto, en una terminal:
Añade -g para instalarla en todos los proyectos.
Desde la carpeta de tu proyecto, en una terminal:
Añade -g para instalarla en todos los proyectos. Aún no se ha probado en OpenCode: la skill contiene instrucciones sencillas en el formato abierto, pero ninguna ejecución en OpenCode la ha verificado.
Desde la carpeta de tu proyecto, en una terminal:
Añade -g para instalarla en todos los proyectos. Aún no se ha probado en Cursor: la skill contiene instrucciones sencillas en el formato abierto, pero ninguna ejecución en Cursor la ha verificado.
Prompts que usan la skill token-diet
El agente elige la skill cuando tus palabras coinciden con su descripción; nombrarla lo asegura. Haz clic en un prompt para copiarlo.
Qué cambia la skill caveman: decir menos, leer menos y compactar a tiempo
- Decir menos: la primera línea es la respuesta; se permiten fragmentos si el significado sigue siendo claro; tres viñetas, no siete; una pregunta cada vez, solo cuando el trabajo está bloqueado.
- Leer menos: primero
git grep -norg -n, luego las líneas necesarias; flags para reducir la salida (git status --short,git diff --stat); una sola prueba en lugar de toda la suite; logs largos en un archivo para buscar en ellos. - Mantén el contexto pequeño: tras terminar una subtarea sugiere un contexto nuevo; tras una ejecución larga en la misma tarea,
/compactcon un enfoque como "keep the failing test name, the files changed, and the open question". Antes de pasar a un contexto nuevo, anota lo que debe conservarse.
| Necesidad | Claude Code | Codex CLI |
|---|---|---|
| Ver qué llena el contexto | /context | /status |
| Resumir y seguir trabajando | /compact [instructions] | /compact |
| Empezar de cero | /clear | /new |
Qué ejecutamos y qué hicieron los agentes
Cada skill se ejecutó el 29 de noviembre de 2026 en un repositorio desechable creado para ella, con la skill instalada como skill de proyecto. Un repositorio Python diminuto: pager.py con un error de desfase de uno (start = page * size en páginas con base 1) y una prueba que falla.
Claude Code (claude -p --model sonnet)
caveman mode please, save tokens. Why does test_first_page fail? Fix it.
Dos ejecuciones. Ambas invocaron token-diet, usaron tres o cuatro llamadas al shell, cambiaron pager.py:3 por (page - 1) * size y respondieron en dos líneas cortas: la causa, la corrección y que pytest no estaba instalado, por lo que se llamó directamente a la función de prueba y pasó.
Codex (0.163.0, codex exec)
caveman mode please, save tokens. Why does test_first_page fail? Fix it.
Leyó .agents/skills/token-diet/SKILL.md. Empezó con “Token diet on.”, como indicaba la skill en ese momento; después se cambió la skill para omitir el anuncio y no se volvió a ejecutar Codex. Encontró la corrección ya en el archivo (una ejecución anterior en la misma carpeta la había hecho), ejecutó la prueba y respondió en dos líneas (enlace en texto plano):
Off-by-one: `page * size` skipped the first 10 items. pager.py:3 already has the fix: `(page - 1) * size`. Verified: `test_first_page` passes.
Agentes en los que se probó
- Claude Code: probado el 29 de noviembre de 2026 con
claude -p --model sonnet, con la skill instalada como skill de proyecto en.claude/skills/. - Codex: probado el 29 de noviembre de 2026 con Codex 0.163.0 (
codex exec), con la skill en.agents/skills/. - OpenCode y Cursor: sin probar. La skill consiste en instrucciones en el formato abierto Agent Skills, pero ninguna ejecución en ninguno de los dos la ha verificado.
Límites
- No se afirma que se ahorren tokens: las pruebas no incluyeron ninguna ejecución sin la skill con la que comparar.
- El agente no puede escribir
/compactni/clearpor sí mismo; los sugiere y tú los escribes. - Codex se ejecutó con una redacción anterior que anunciaba el modo; la redacción actual no se ejecutó en Codex.
- token-diet es una skill propia, no una copia de ninguna skill llamada caveman; responde cuando pides el modo caveman.
Con Caprock y sin él
Cuando el servidor MCP de Caprock está conectado, la skill puede llamar a cost para comparar tokens y gasto por día antes y después de la dieta, citando las cifras tal como las da la herramienta. Sin él, te remite a /usage en Claude Code o a /status en Codex. Caprock es la app gratis y de código abierto que registra cada sesión de un agente de programación en tu computadora.
El SKILL.md completo
El archivo tal como está en dspv/skills en la revisión dfce799. Para instalarlo manualmente, guárdalo como .claude/skills/token-diet/SKILL.md para Claude Code o .agents/skills/token-diet/SKILL.md para Codex en tu proyecto.
--- name: token-diet description: > Make the coding agent talk less and spend fewer tokens. Switches replies to terse output (no preamble, no restating the question, no recap of what was just done, code without commentary unless asked) and switches work to token-thrifty habits: search before reading, read only the lines needed, never re-read a file just edited, cut long command output, and tell the user when to compact or clear the context (/compact, /context, /clear in Claude Code; /compact, /status, /new in Codex). Use when the user says "caveman mode", "caveman skill", "be terse", "talk less", "shorter answers", "stop explaining", "save tokens", "compact", "token diet", "you're wasting tokens", or "my context fills up too fast". license: Apache-2.0 --- # Token diet Two halves: say less, and read less. Both stay on for the rest of the session once this skill is invoked, until the user says "normal mode", "explain", "more detail" or the like. Do not announce the mode; the next reply shows it. ## 1. Say less Every reply: - **Answer first.** The first line is the answer, the result or the question you need answered. No "Great question", "Sure, I can help", "Let me...", "I'll now...". - **No restating.** Do not repeat the user's request back, do not summarize the plan before doing it, do not recap what you just did after doing it. The diff and the tool output already show it. - **Fragments are fine.** "Fixed: off-by-one in `paginate()`, `src/page.py:41`." beats a paragraph. Drop articles and filler when the meaning stays clear. Keep file paths, names, numbers exact. - **Code without commentary.** Show the code or the edit. No line-by-line explanation, no "This function does X" unless the user asked why or how. A one-line comment in the code is fine when the code would surprise a reader. - **Lists over prose, short lists.** Three bullets, not seven. No closing summary, no "Let me know if you need anything else", no offer of further help. - **One question at a time**, only when you cannot proceed without the answer. - **Length follows the ask.** A yes/no question gets yes or no plus the reason in one line. Never cut, however terse: - Warnings about data loss, security, destructive commands, failing tests, or anything you could not do or verify. - The exact command, path or value the user needs to act on. - A question that blocks the work. If terse wording would make one of these ambiguous, write the full sentence. ## 2. Read less Tokens go mostly into what the agent reads, not what it writes. Work habits: 1. **Search before reading.** Find the place with `git grep -n`, `rg -n` or the agent's search tool, then open only that part of the file. Read a whole file only when it is small or you need all of it. 2. **Read line ranges.** Use the read tool's offset and limit, or `sed -n '120,180p' file`. Widen the range if the function continues; do not jump to the whole file. 3. **Do not re-read.** A file you just wrote or edited is in your context already; a failed edit reports itself. Re-read only when something else may have changed it (a formatter, a generator, another process). 4. **Cut command output at the source.** Prefer quiet and summary flags: `git status --short`, `git diff --stat` before `git diff`, `git log --oneline -n 20`, a test runner's quiet or fail-only mode, a single test file or test name instead of the whole suite. Pipe long output through `tail -n 50`, `head -n 50` or `grep` for the error. Redirect a big log to a file and search it instead of printing it. 5. **Do not paste tool output back.** After a long result, keep the conclusion (the failing test, the line, the value) and move on. Never quote a log or a file to the user unless asked. 6. **Skip what you do not need.** No listing the whole tree to find one file, no opening lockfiles, generated files, minified bundles, `node_modules`, `dist` or vendored code unless the bug is there. 7. **Batch independent calls** in one turn when the agent supports it, instead of one call, a reply, another call. 8. **Delegate a broad search** to a subagent if your agent has them, so only its conclusion enters the main context. ## 3. Keep the context small The agent cannot run these commands itself: the user types them. Suggest one, in one line, when it pays off: - After a finished subtask, before starting an unrelated one: a fresh context. - When a long run (many files read, long logs) is done and the work continues on the same task: compact, with a focus. - When replies get slow or the agent starts forgetting earlier instructions. | Need | Claude Code | Codex CLI | | ----------------------------- | ------------------------- | ---------- | | See what fills the context | `/context` | `/status` | | Summarize, keep working | `/compact [instructions]` | `/compact` | | Start fresh, same project | `/clear` (alias `/new`) | `/new` | | Fresh chat and clear terminal | `/clear` | `/clear` | | Token usage (and cost) | `/usage` (alias `/cost`) | `/status` | Sources, read on 2026-11-29: Claude Code commands reference (<https://code.claude.com/docs/en/commands>) and the Codex CLI slash commands documentation (<https://learn.chatgpt.com/docs/developer-commands?surface=cli>). Other agents: use their own equivalent if they have one; if you are not sure it exists, do not name it. For a Claude Code `/compact`, propose the focus so the summary keeps what matters, for example: `/compact keep the failing test name, the files changed, and the open question about retries`. Before suggesting a fresh context, write down what must survive (the task, decisions, files touched, next step) in the project's notes file or in your reply, so nothing is lost. ## 4. See the effect If the Caprock MCP tools are available (server `caprock`), call `cost` (optional `days`, `repo`, `all_repos`) to compare tokens and spend per day before and after the diet. Otherwise ask the user to check `/usage` in Claude Code or `/status` in Codex. Report the figures as the tool gives them; never estimate a saving. Caprock (<https://caprock.dev>, free, open source, runs locally) provides that tool. ## Example User: "why does the login test fail?" Without the diet: three paragraphs restating the question, the plan, the full test log, the fix, and a recap. With it: ```text `test_login_expired` fails: `is_expired()` compares local time with UTC, `auth/session.py:58`. Fix: use `datetime.now(timezone.utc)`. Apply it? ```
Preguntas sobre la skill token-diet
- ¿Qué es una skill de modo caveman?
- Una skill que hace que el agente responda con tan pocas palabras como permita el significado. token-diet hace eso y también reduce lo que lee el agente, que es donde se consume la mayoría de los tokens.
- ¿Es token-diet la skill caveman?
- Es una skill independiente que responde a la misma petición: di “caveman mode” y se activa. Di “normal mode” para desactivarla.
- ¿Cuándo debo ejecutar /compact en Claude Code?
- Cuando termina una ejecución larga de la misma tarea y vas a seguir trabajando en ella: `/compact` con un enfoque conserva lo que importa. Después de terminar una subtarea y antes de empezar otra no relacionada, `/clear` empieza de cero. La skill sugiere cada uno en una línea.
- ¿Omite advertencias la skill caveman?
- No. Siempre se conservan las advertencias sobre pérdida de datos, seguridad, comandos destructivos, pruebas fallidas y cualquier cosa que no haya podido verificar.