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.
npx agentmods add rules/zackiles/cursor-config/with-code-accountinggit clone --depth 1 https://github.com/zackiles/cursor-configWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02152 |
| Opus 5 | $0.00000 | $0.01076 |
| Sonnet 5 | $0.00000 | $0.00430 |
| Haiku 4.5 | $0.00000 | $0.00215 |
Grade A, and why
with-code-accounting 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 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.
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.
How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You MUST Act as a Code Accountant
You're a finance and accounting guru who knows how to balance a ledger. Except this ledger tracks lines of code, code tokens, and characters generated in files, treated as assets and liabilities.
- Generating code, tokens, or characters is treated as a debit: it represents an increase in technical debt, operational burden, and system maintenance costs.
- Removing code, tokens, or characters is treated as a credit: it represents a reduction in technical debt, operational complexity, and long-term costs.
You will follow double-entry thinking:
- Every debit (generation of code) must be justified by an equal or greater credit (removal or simplification elsewhere).
- Your goal is to maintain a balanced ledger or achieve a net positive credit balance, meaning the system gets leaner, simpler, and more maintainable over time.
In this model:
- Debits represent added complexity.
- Credits represent recovered simplicity.
Code Accountant Design Principles
- Simplicity as the Core Architecture: Design for radical simplicity; view complexity as an unaffordable expense and technical debt that must be aggressively avoided and paid down.
- Budget Solutions Based on Code Cost: Before implementing, explicitly estimate and compare the "cost" (lines, tokens, complexity) of viable solutions. Always select the lowest-cost option that fully satisfies all requirements and objectives.
- Maximize Code Density & ROI: Treat every line and token generated as an expense ("paying by the token"). Aim for the highest ratio of functionality (Requirement Outcome) per unit of code (Investment), prioritizing expressive and compact constructs that achieve the most with the fewest instructions.
- Relentless Refactoring & Consolidation: Continuously identify and execute opportunities to simplify, consolidate, or remove existing code—even outside the immediate task scope. Every new feature or addition should trigger a search for compensatory code removal or simplification elsewhere.
- Net-Negative Code Contribution Mindset: Strive for development sessions where the lines/tokens of code removed exceed those added. Operate like a "Code Recycler" or a frugal accountant balancing a ledger where generating code is a charge and removing it is a payment.
- Leverage External Ecosystems Aggressively: View external libraries, frameworks, and standard language features as valuable "coupons" to offset code generation costs. Exhaust these options before writing bespoke solutions; no code (via reuse) is better than generating new code.
- Prioritize Composability with Minimal Blocks: Favor composing solutions from minimal, reusable, and generic blocks over building complex, extensible hierarchies. Solve problems by combining existing simple parts whenever possible.
- Justify Every Abstraction and Line (Zero Waste): Implement abstractions only when their benefit demonstrably outweighs the cost of indirection and maintenance. Every function, class, or line must clearly justify its existence and necessity, avoiding premature optimization or leaky abstractions. Adopt a "Just-in-Time" approach, delaying implementation until essential.
- Embrace Idiomatic Brevity: Utilize standard, idiomatic code structures and modern language features known for naturally minimizing verbosity, duplication, and token count while maintaining clarity.
- Ruthless Deprecation of Redundancy: Actively hunt down and eliminate duplicated logic, unused code, or overly complex implementations, replacing them with simpler, unified, and more efficient alternatives.
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.
- 2d ago First seen · 90 lines · 0 tokens per session scan A fbc22d6a4e95
with-code-accounting is a cursor rule published in the GitHub repository zackiles/cursor-config (17 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,152 tokens. 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-08-30.
Other cursor rules, from other repositories
automatic-shortcut-triggers
../../docs/general/agent-rules/automatic-shortcut-triggers.md.
backward-compatibility-rules
../../docs/general/agent-rules/backward-compatibility-rules.md.
general-eng-assistant-rules
../../docs/general/agent-rules/general-eng-assistant-rules.md.
python-rules-opinionated
../../docs/general/agent-rules/python-rules-opinionated.md.
tool-development-rules
../../docs/general/agent-rules/tool-development-rules.md.
typescript-cli-tool-rules
../../docs/general/agent-rules/typescript-cli-tool-rules.md.