DEV Community

Cover image for Make Claude Code Lean: Spend Less, Move Faster, Get More Done

Make Claude Code Lean: Spend Less, Move Faster, Get More Done

Manly Beach Labs on December 04, 2026

Four simple habits to stop wasting tokens on clutter, with a ready-to-use example for each. Introduction: Your Window Is Already Half Ful...
Collapse
 
nyaomaru profile image
nyaomaru Necoz •

Great write-up! 😸💚

I use Claude Code at work, and one challenge I've noticed when working with large development teams is that AGENTS.md inevitably tends to grow over time.

The accompanying docs, skills, and rules also gradually become outdated without anyone noticing.

Lately, I've been wondering whether documentation is becoming one of the biggest sources of technical debt in the AI-assisted development era. 😹

We try to review these files at each development phase, but there's always quite a bit that needs updating.

I completely agree that regularly reviewing our configurations, instructions, and even forgotten MCP server settings is becoming increasingly important!

Thanks for sharing these practical tips! 😸👍

Collapse
 
manlybeachlabs profile image
Manly Beach Labs Necoz •

This is my first time posting on Necoz! Happy to receive your feedback to improve! Thank you!

Collapse
 
effessdev profile image
EffessDev Necoz •

Congratulations!!! 😊

Collapse
 
_komachi-jp profile image
Komachi | AI on a Budget •

The /context audit is the part I'll actually try first — I hadn't thought of checking what loads before I type anything. My setup is Claude Pro at $20 a month, so every token that goes to a bloated CLAUDE.md or an MCP server I never use is money I can see on the bill. I keep my instructions short for the same reason, but I never measured which item was the biggest. One question: after you trimmed yours down, did you notice the savings most in long sessions, or right away in short ones too?

Collapse
 
wendelas profile image
Wendel Assis Silva •

Good framing that the window is half full before you type. One thing worth adding: measure it per session rather than trusting a one-time check. In my experience the baseline can shift between days as tools get deferred or loaded differently, so a lean setup today isn't guaranteed lean tomorrow.

Collapse
 
speedrunjaen profile image
Jaen Carrodine •

the reset buys more than the effort setting does. every tool call re-reads the whole conversation from cache, so across a week of our sessions a message sent into one already past 600k cost about 30 times one sent under 200k

Collapse
 
paullovelace profile image
Paul Lovelace •

speedrunjaen's 30x number is the one that stopped me scrolling — a message past 600k costing 30 times one under 200k makes the reset the whole game, not the effort setting. The /context audit is the part I'll actually try first, I never measured which item was biggest either. One thing I'm wondering: do you reset mid-debug when the window gets fat, or only at milestones? /clear in the middle of a bug hunt feels like throwing away the map.

Collapse
 
zhang_jimmy_54a0414571400 profile image
zhang jimmy •

第一条里“把 never 规则写成 permission 而不是句子”是最值得抄的一句,长会话里散文式规则确实会被忘。我想问第四条:把探索交给 subagent、主窗口只收摘要时,怎么保证摘要里的结论可验证?比如让 subagent 回传 file:line 引用,主会话按需再读原文,这样既省了全文、又不用盲信摘要。另外 /statusline 的 context meter 我打算今天就加上,算是成本最低的一条。

Collapse
 
nilesharma0108 profile image
Nilesh Sharma •

"Never" rules as permissions instead of sentences is the tip I'd push hardest. Claude Code's memory docs back up your 200-line target (they say to target under 200 lines per CLAUDE.md because longer files use more context and reduce adherence), and they add one more lever: move instructions that only matter for part of the codebase into path-scoped rules, which load only when Claude works with matching files. That keeps the global file lean without losing the detail.

Collapse
 
reidmarlow profile image
Reid Marlow •

For the reset at a milestone, I'd keep a small handoff alongside the clean context: the current goal, decisions made, files changed, and the next test to run. That makes /clear less likely to discard a constraint that took the previous session a while to uncover. A link to the relevant issue or commit can carry the detail without putting the whole conversation back in the window.

Collapse
 
gautamtalksdev profile image
Gautam K •

Great list. Keeping the context lean is the habit that pays off most. A short project instructions file plus starting fresh between unrelated tasks makes a big difference in both cost and quality.

Collapse
 
vexaloom-labs profile image
vexaloom-labs •

Rebuilding the global instructions from scratch risks turning forgotten incidents into rules that have to fail twice.

Collapse
 
syedfahads profile image
Syed Fahad •

heads up on the deny example, Bash rules match the command prefix, so rm -fr or rm -r -f walk right past rm -rf:*. a PreToolUse hook is the sturdier spot for that one