token-efficiency

A set of practices and tools for using fewer language-model tokens during coding sessions. Tokens are the pieces of text an AI reads and remembers while working.

In plain words
What is it for?
Use it when setting up agent work, when tests or Git commands produce long output, or when a session is running out of context.
Why use it?
It reduces repeated command output and helps prevent long sessions from reaching their context limit. It covers output compression, session cleanup, model selection, and related habits.

Skill for Claude CodeCodex

Part of the oficina plugin — 6 skills, 5 commands shipped together

Install

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.

agentmods
npx agentmods add skills/joaoequer/oficina/token-efficiency
Any agent
npx skills add JoaoEquer/Oficina --skill token-efficiency
Clone the repo
git clone --depth 1 https://github.com/JoaoEquer/Oficina

Made for: Claude Code, Codex.

Or install oficina, the plugin that ships this one along with the rest of its 6 skills, 5 commands.

Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,122 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
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 $0.00105 $0.01122
Opus 5 $0.00053 $0.00561
Sonnet 5 $0.00021 $0.00224
Haiku 4.5 $0.00011 $0.00112

Measured 2d ago against content hash 62744532634b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

token-efficiency scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
skills/token-efficiency/SKILL.md · 55 lines

How it starts

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

Token efficiency

Tokens are the working memory of the session. Every verbose command output gets re-read on every subsequent turn, so waste compounds: a 2,000-token git diff costs ~20,000 tokens over the next 10 turns. Two fronts: tooling (RTK) and habits.

RTK (Rust Token Killer)

rtk-ai/rtk is an open-source CLI proxy (single Rust binary, Apache 2.0) that compresses command output before it reaches the context window — 60–90% savings on test runners, git operations and package managers. It runs locally and hooks into the agent's official extension points (Claude Code PreToolUse hook); it does not touch API traffic.

Setup (once per machine)

# Install (official script; on Windows, native binary works since v0.37.2)
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh

# Activate for your harness — hook-only avoids extra per-turn context
rtk init -g --hook-only        # Claude Code
rtk init -g --gemini           # Gemini CLI
rtk init -g --agent cursor     # Cursor

Restart the agent afterwards. The hook rewrites Bash calls transparently (git statusrtk git status); the agent doesn't need to know RTK exists. Prefer --hook-only: the alternative injects an RTK.md into context on every turn, which spends tokens to save tokens.

What it actually covers (calibrate expectations)

  • Big wins: test runners showing failures only (pytest, vitest, cargo test — 90%+), git diff/log/status, package manager install noise, tsc/lint output grouped by file.
  • Not covered: the agent's native Read/Grep/Glob tools bypass the Bash hook. In read/edit-heavy sessions RTK has little to intercept — that's expected, not broken.
  • Verify it's working: rtk gain shows accumulated savings; rtk discover finds commands you ran that could have been compressed.
  • Failure safety: when a command fails, RTK saves the full unfiltered output to disk so nothing important is lost.

Read the full file on GitHub · 55 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. 2d ago First seen · 55 lines · 105 tokens per session scan C 62744532634b

Subscribe to this mod's changes

token-efficiency is a skill published in the GitHub repository JoaoEquer/Oficina (2 stars, last pushed 1mo ago), licensed MIT. It adds 105 tokens to every session and 1,122 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.