Skip to main content
rule CX Codex

token-efficiency — Claude Code rule: what it does, how to install

token-efficiency cuts token burn in Claude Code by removing conversational filler, enforcing read-before-write, and stopping unwanted refactoring loops.

MIT ★ 2,966 updated 2026-09-29

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/token-efficiency.mdc
Open on GitHub

What token-efficiency does

This instruction set enforces strict economy on model completions. It blocks opening pleasantries, empty closing remarks, question restatements, and AI identity disclaimers. Output is restricted to plain ASCII characters, swapping curly quotes and em dashes for standard quotation marks and double hyphens.

File interactions follow two core constraints: the agent must inspect a file before touching it, yet it cannot reload a previously read file unless disk contents actually changed. Simple edits must follow a single-pass workflow. Once code passes tests, execution stops immediately without stylistic refactoring or defensive abstractions for imaginary edge cases.

Code blocks must appear first, followed by concise explanations only when logic is non-obvious. Whenever data fits, the model is directed to emit tables, bullet points, or JSON rather than paragraphs of text.

What it helps with

  • remove greeting fluff and polite disclaimers from agent responses
  • stop context waste caused by reloading unchanged source files
  • prevent unprompted refactoring cycles on code that already passes tests
  • force direct code output ahead of explanations without preambles

Example prompts for the agent

  • Fix the null pointer in session.ts following token-efficiency guidelines
  • Generate the migration script in one pass and run tests once
  • Summarize API endpoints as a clean ASCII table with zero conversational filler

How to install token-efficiency

Manually: put the files in place

.cursor/rules/token-efficiency.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about token-efficiency

How to install token-efficiency in Claude Code?

Run /plugin marketplace add rohitg00/pro-workflow and then /plugin install pro-workflow@pro-workflow. Alternatively, place the file directly at .claude/rules/token-efficiency.md.

What does the token-efficiency rule do?

It trims context usage by banning conversational padding, disallowing redundant file reads, enforcing ASCII formatting, and prioritizing immediate code delivery.

When does the rule stop Claude Code from editing further?

For simple tasks, the agent stops as soon as tests pass on the first pass, without polishing working code or introducing extra abstractions.

Source text

token-efficiency.mdc · MIT
---
description: Token efficiency rules - eliminate waste in AI output, enforce read-before-write, prevent iteration cycles
alwaysApply: true
---

No sycophantic openers: never start with "Sure!", "Great question!", "Absolutely!", "Of course!", "I'd be happy to!".

No hollow closing fluff: never end with "Let me know if you need anything!", "I hope this helps!", "Feel free to ask!".

No prompt restatement: do not repeat or paraphrase the question before answering. Lead with the answer.

No unsolicited suggestions: deliver exactly what was asked. Do not add "you might also want to..." unless requested.

No "As an AI" framing: never include disclaimers about being an AI model.

ASCII-only output: use -- not em dashes, use " not smart quotes, use ' not curly apostrophes. No Unicode decorators.

Read before write: never write or edit a file you have not read in this session. No exceptions.

No re-reads: do not re-read a file already read in this session unless it was modified since the last read.

One-pass discipline for simple tasks: write the complete solution in one pass, run tests once. If tests pass, stop. Do not refactor, improve, or polish passing code.

No write-delete-rewrite cycles: understand the target file structure before writing. Plan the change, then execute once.

Do not over-engineer: simplest working solution first. No unnecessary abstractions, error handling for impossible scenarios, or speculative features.

Code first, explanation after: return code, then explain only if non-obvious. No preambles before code blocks.

Structured output when possible: prefer tables, bullets, and JSON over prose paragraphs.

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set83

The whole set →
deslop The /deslop command cleans the current branch of unnecessary code added by AI: obvious comments, defensive try/catch blocks, one-off abstractions, and docstrings on unchanged functions. CX Codex +1 ★ 2,966repo stars learn-rule learn-rule extracts session mistakes into one-line rules and saves them to your project memory after explicit confirmation. CX Codex +1 ★ 2,966repo stars wrap-up The wrap-up skill audits code changes, runs quality checks, and records what to pick up next. Use it when you are about to end a coding session. CX Codex +1 ★ 2,966repo stars incremental-verify incremental-verify keeps the agent on one failing test at a time: the smallest change that passes it, then a commit, before the next behavior starts. CX Codex +1 ★ 2,966repo stars scout scout examines a codebase before implementation and rates readiness across five dimensions. Use it to see whether the task is ready to start or needs more investigation. CX Codex ★ 2,966repo stars core-rules core-rules — a rule file for your project: commit checks, Git habits, context discipline and the way the agent replies. Paste it into CLAUDE.md or keep it standalone. CX Codex +1 ★ 2,966repo stars context-optimizer The context-optimizer command checks context window fill rates in Claude Code and helps cut token waste before responses degrade. CX Codex +1 ★ 2,966repo stars module-map The module-map skill builds a compact map of an unfamiliar codebase area, covering entry points, core modules, data flow, and callers. Use it when you need to get oriented. CX Codex +1 ★ 2,966repo stars

Project sponsors

Companies that keep this analytics open