token-efficiency

token-efficiency is a skill for Claude Code, Codex from saitarrun/Devforge-ai. It costs 26 tokens per session (657 once invoked), scanned A, original, Apache-2.0.

A set of techniques for keeping coding-agent work focused, reducing repeated context, and choosing concise ways to inspect code.

In plain words
What is it for?
Use it to guide file reading, handoffs, code queries, and prompt budgeting during development work.
Why use it?
It helps prevent context-window waste and keeps large codebase tasks within practical token limits.

Skill for Claude CodeCodex

Part of the devforge-ai plugin — 48 skills, 17 commands, 13 agents 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/saitarrun/devforge-ai/token-efficiency
Any agent
npx skills add saitarrun/Devforge-ai --skill token-efficiency
Clone the repo
git clone --depth 1 https://github.com/saitarrun/Devforge-ai

Made for: Claude Code, Codex.

Or install devforge-ai, the plugin that ships this one along with the rest of its 48 skills, 17 commands, 13 agents.

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 token-efficiency

README.md
[![agentmods](https://agentmods.dev/badge/skills/saitarrun/devforge-ai/token-efficiency.svg)](https://agentmods.dev/skills/saitarrun/devforge-ai/token-efficiency)
Your own site
<a href="https://agentmods.dev/skills/saitarrun/devforge-ai/token-efficiency"><img src="https://agentmods.dev/badge/skills/saitarrun/devforge-ai/token-efficiency.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 657 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00026 $0.00657
Opus 5 $0.00013 $0.00329
Sonnet 5 $0.00005 $0.00131
Haiku 4.5 $0.00003 $0.00066

Measured yesterday against content hash f1e43c4bd318, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

token-efficiency 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 yesterday.

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.

skills/token-efficiency/SKILL.md · 62 lines

How it starts

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

Token Efficiency & Precision Engineering Skill

This skill enforces strict token conservation, prevents context-window bloat, and optimizes model invocation costs while maximizing code generation and diagnostic accuracy.


1. Token Conservation Hierarchy

When analyzing large codebases or executing multi-agent pipelines, follow the Token Conservation Hierarchy:

[Level 1: Semantic AST Query (Lowest Token Cost: ~50-200 Tokens)]
  ↳ Query code-review-graph or symbol definitions; avoid loading full files.
          ↓
[Level 2: Targeted Line-Range Slice (Minimal Cost: ~200-500 Tokens)]
  ↳ Read only the specific target function / interface lines (StartLine to EndLine).
          ↓
[Level 3: Compact Handoff Artifacts (Bounded Cost: ~500-1,500 Tokens)]
  ↳ Never pass entire conversation logs forward; distill decisions into clean markdown handoffs.
          ↓
[Level 4: Full File Reads (Cautious / Restricted: >2,000 Tokens)]
  ↳ Read entire files only when strictly required for syntax validation. Never read binary or vendor files.

2. The 5 Rules of High-Precision Token Economy

Rule 1: Zero Redundant File Dumps

  • Never re-read files already present in memory or referenced by previous steps.
  • Prefer targeted inspection: fetch only the exact 30–50 lines of an implementation seam rather than the entire 2,000-line module.

Rule 2: Handoff State Compaction

  • At every phase boundary (Plan -> Build -> Verify -> Ship -> Operate), write a structured summary to handoffs/<phase>-handoff.md.
  • Downstream agents only read the handoff file, resetting conversation token depth back to zero and avoiding exponential context degradation.

Rule 3: Structural Search Over Greedy Grep

  • Do not run unconstrained recursive text searches that dump thousands of matched lines into the context window.
  • Filter queries with file extensions and directory boundaries (e.g. apps/claims-engine/src/**/*.ts).

Rule 4: Compact Diff Chunks on Edits

  • When modifying code, use targeted line replacements rather than rewriting entire files.

Read the full file on GitHub · 62 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. yesterday First seen · 62 lines · 26 tokens per session scan A f1e43c4bd318

Subscribe to this mod's changes

token-efficiency is a skill published in the GitHub repository saitarrun/Devforge-ai (5 stars, last pushed 22d ago), licensed Apache-2.0. It adds 26 tokens to every session and 657 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-03.

Related

Other skills, from other repositories

houseclean

Cross-drive storage audit and cleanup. Surveys all drives, finds orphaned git worktrees, large AI tool caches (.ollama, .gemini, .cursor, npm, pip), and buildable artifacts (nodemodules, .venv). Produces a prioritized action plan with specific migration commands. Use when disk space is low or worktrees need cleanup…

SethGammon/Citadel · 89 tokens

schedule

Manages recurring and one-off scheduled tasks. Session-scoped scheduling via CronCreate/CronDelete/CronList. Documents the cloud path for tasks that need to survive machine sleep or network drops.

SethGammon/Citadel · 41 tokens

jobs

Manage agy staffer background jobs - collect results, check status, cancel, follow-up conversation, and setup. Use when an agy job needs collecting, when the user asks "is the agy job done", "show agy's result", "cancel the agy job", "continue the agy conversation", or "set up agy". This is the orchestrator's skill…

keli-wen/agy-staff · 99 tokens

zapier-explore

Explore what Zapier MCP can do for the user — interview them about their role and the apps they live in, suggest specific use cases as on-demand prompts, then walk them through enabling the actions to make those use cases real. The natural next step after zapier-demo. Use when the user asks "what else can Zapier do…

zapier/zapier-mcp · 130 tokens

party

Throw or join an agents-party: a shared channel where several AI agent sessions (and their humans) talk to each other — Claude Code, Cursor, Codex or any other agent, on one machine or across machines. Use when the user asks to throw or start a party, wants several agent sessions to collaborate in one chat, wants two…

1gr14/agents-party · 110 tokens

structure-swift-sources

Organize Swift source trees and oversized Swift files by feature, layer, and declaration group; split large files, normalize // MARK: sections, enforce plain-language block-comment file headers, and move TODO and FIXME text into ledger files. Use after format-swift-sources has established a clean formatting baseline.

gaelic-ghost/socket · 69 tokens