Skill caveman mode: token-diet para respostas concisas, menos releituras e /compact
Dmitriy Solodukha, desenvolvedor do Caprock · Publicado em
Testado em no Claude Code e no Codex
Peça caveman mode: a skill token-diet faz o agente ser conciso, ler menos e sugerir /compact na hora certa, no Claude Code e Codex.
Diga “caveman mode” e a skill token-diet faz o agente responder primeiro e parar: sem preâmbulo, sem repetir a pergunta, sem recapitulação, código sem comentários. Ela também muda a forma de trabalhar, já que a maior parte dos tokens vai para o que o agente lê: pesquisar antes de ler, ler intervalos de linhas, nunca reler um arquivo que acabou de editar, reduzir a saída dos comandos. E ela diz quando usar /compact ou começar do zero, com o foco a dar ao resumo.
Instale a skill token-diet
Um comando por agente. A skill é um único SKILL.md; nada é executado na instalação.
Todas as nove skills como plugin. Digite isto dentro do Claude Code:
Ou apenas esta skill, em um terminal na pasta do seu projeto:
Adicione -g para instalar em todos os projetos.
Na pasta do seu projeto, em um terminal:
Adicione -g para instalar em todos os projetos.
Na pasta do seu projeto, em um terminal:
Adicione -g para instalar em todos os projetos. Ainda não testada com OpenCode: a skill contém apenas instruções no formato aberto, mas nenhuma execução com OpenCode a verificou.
Na pasta do seu projeto, em um terminal:
Adicione -g para instalar em todos os projetos. Ainda não testada com Cursor: a skill contém apenas instruções no formato aberto, mas nenhuma execução com Cursor a verificou.
Prompts que usam a skill token-diet
O agente escolhe a skill quando suas palavras correspondem à descrição dela; citar seu nome garante isso. Clique em um prompt para copiá-lo.
O que a skill caveman muda: falar menos, ler menos, compactar na hora certa
- Fale menos: a primeira linha é a resposta; fragmentos são aceitáveis quando o sentido continua claro; três itens, não sete; uma pergunta por vez, só quando o trabalho está bloqueado.
- Leia menos: primeiro
git grep -nourg -n, depois as linhas necessárias; flags silenciosas (git status --short,git diff --stat); um único teste em vez da suíte; logs longos em um arquivo para buscar neles. - Mantenha o contexto pequeno: depois de uma subtarefa concluída, sugere um contexto novo; após uma execução longa na mesma tarefa,
/compactcom um foco como “keep the failing test name, the files changed, and the open question”. Antes de um contexto novo, registra o que precisa ser preservado.
| Necessidade | Claude Code | Codex CLI |
|---|---|---|
| Veja o que preenche o contexto | /context | /status |
| Resuma e continue trabalhando | /compact [instructions] | /compact |
| Comece do zero | /clear | /new |
O que executamos e o que os agentes fizeram
Cada skill foi executada em 29 de novembro de 2026 em um repositório descartável criado para ela, com a skill instalada como skill de projeto. Um repositório Python minúsculo: pager.py com um erro de uma unidade (start = page * size em páginas com base 1) e um teste falhando.
Claude Code (claude -p --model sonnet)
caveman mode please, save tokens. Why does test_first_page fail? Fix it.
Duas execuções. Ambas invocaram token-diet, usaram três ou quatro chamadas de shell, corrigiram pager.py:3 para (page - 1) * size e responderam em duas linhas curtas: a causa, a correção e que pytest não estava instalado, então a função de teste foi chamada diretamente e passou.
Codex (0.163.0, codex exec)
caveman mode please, save tokens. Why does test_first_page fail? Fix it.
Leu .agents/skills/token-diet/SKILL.md. Começou com "Token diet on.", como a skill instruía na época; a skill foi alterada depois para remover o anúncio, e Codex não foi executado novamente. Encontrou a correção já no arquivo (uma execução anterior na mesma pasta a havia feito), executou o teste e respondeu em duas linhas (link exibido como texto simples):
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 em que foi testada
- Claude Code: testado em 29 de novembro de 2026 com
claude -p --model sonnet, com a skill instalada como skill de projeto em.claude/skills/. - Codex: testado em 29 de novembro de 2026 com Codex 0.163.0 (
codex exec), a skill em.agents/skills/. - OpenCode e Cursor: não testado. A skill contém instruções simples no formato aberto Agent Skills, mas nenhuma execução em qualquer um dos dois a verificou.
Limites
- Não se afirma que há economia de tokens: os testes não tiveram uma execução sem a skill para comparação.
- O agente não pode digitar
/compactou/clearpor conta própria; ele sugere e você digita. - O Codex foi executado com uma redação anterior que anunciava o modo; a redação atual não foi executada no Codex.
- token-diet é uma skill própria, não uma cópia de qualquer skill chamada caveman; ela responde quando você pede caveman mode.
Com e sem Caprock
Quando o servidor MCP do Caprock está conectado, a skill pode chamar cost para comparar tokens e gastos por dia antes e depois da dieta, citando os valores como a ferramenta os fornece. Sem ele, indica /usage no Claude Code ou /status no Codex. O Caprock é o app gratuito e open source que registra cada sessão de agente de programação no seu computador.
O SKILL.md completo
O arquivo como está em dspv/skills na revisão dfce799. Para instalá-lo manualmente, salve como .claude/skills/token-diet/SKILL.md para Claude Code ou .agents/skills/token-diet/SKILL.md para Codex, no seu projeto.
--- 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? ```
Perguntas sobre a skill token-diet
- O que é uma skill de caveman mode?
- Uma skill que faz o agente responder com o mínimo de palavras permitido pelo sentido. token-diet também reduz o que ele lê, que consome a maioria dos tokens.
- token-diet é a skill caveman?
- É uma skill separada que atende ao mesmo pedido: diga “caveman mode” para ativá-la. Diga “normal mode” para desativá-la.
- Quando devo executar /compact no Claude Code?
- Quando uma execução longa na mesma tarefa termina e você vai continuar nela: `/compact` com um foco mantém o que importa. Após concluir uma subtarefa, antes de outra sem relação, `/clear` começa do zero. A skill sugere cada um em uma linha.
- A skill caveman omite avisos?
- Não. Avisos sobre perda de dados, segurança, comandos destrutivos, testes com falha e tudo o que ela não conseguiu verificar são sempre mantidos.