DEV Community

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

Posted on

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

Four simple habits to stop wasting tokens on clutter, with a ready-to-use example for each.

Introduction: Your Window Is Already Half Full

Out of the box, Claude Code can feel heavy. It burns through tokens, talks too much, and slows down. The reason is often not the model but the context budget: the limited space in the window that everything has to share.

Before you type a single word, that space is already taken by the system prompt, tool definitions, MCP servers, skills and your memory files. The more clutter at the start, the less room for real work, and the more your rules get ignored.

The goal is a lean setup: small instructions, only the tools you use, a clean window and a habit of resetting before quality drops. Here are four ways to get there.

1. Trim Your Global CLAUDE.md

This file loads every session, so every extra line costs you every time. A long file is also less effective: the longer it gets, the more of it is ignored.
Make the replies short. Tell Claude to use plain, simplified English and report only what you need to decide. A standard like ASD-STE100 (simplified technical English) is a good model.
Keep it under about 200 lines, with just enough context. Every few months, delete it and rebuild it from scratch.
Move "never do this" rules out of prose. Sentences in CLAUDE.md get forgotten in long sessions. Permission settings are enforced every time.
Example: a lean CLAUDE.md

# CLAUDE.md
## Style
- Use simple technical English. Short sentences.
- Say only what is needed. Report only what I need to make a decision.
Enter fullscreen mode Exit fullscreen mode

Project basics

  • Build: pnpm build Test: pnpm test
  • Details live in docs/ (open only when needed).

Example: a "never" rule as a permission, not a sentence

{
  "permissions": {
    "deny": ["Read(./.env)", "Bash(rm -rf:*)", "Bash(git push --force:*)"]
  }
}
Enter fullscreen mode Exit fullscreen mode

2. Audit What Loads Before You Type

You can't cut what you can't see. Claude Code has built-in commands that show where your tokens go.

  • /context in a fresh session shows what fills the window: system prompt, tools, memory files, skills. Remove the biggest item, restart, and check again.

  • /usage shows which MCP server, skill, agent or plugin is using the most tokens.

  • /mcp lets you toggle off servers you don't use. They stay in your config for later.

  • Make rarely used skills manual-only so they cost nothing until you call them.

  • Consider CLIs for simple jobs. A command returns only the lines you ask for. Be fair to MCP, though: a well-built server can also return small results, and a CLI can dump a whole file. Check /usage to find the heavy ones before switching anything off.

Example: a manual-only skill

---
name: release-notes
description: "Draft release notes from merged PRs"
disable-model-invocation: true
---
Summarize merged PRs since the last tag into user-facing notes.
Enter fullscreen mode Exit fullscreen mode

Example: audit routine (copy this prompt habit)

1. Open a fresh session. Run /context. Note the biggest item.
2. Run /usage. Note the top token user.
3. Remove or disable that one thing. Restart. Run /context again.
4. Repeat until the starting window is small.
Enter fullscreen mode Exit fullscreen mode

3. Use Effort and Resets Wisely

How you run a session matters as much as how you set it up.

  • Save high effort for planning. For most other work, medium or low is enough.

  • Reset at checkpoints. Use /clear (fresh start) or /compact (summarize) when you finish a milestone, or once the window passes roughly 400k tokens. Quality tends to drift as sessions grow, and regular resets keep it steady.

  • Watch the meter. Add the context meter to your status line with /statusline so you can see the window filling before it hurts.

Example: an effort plan

Plan the feature         -> high effort
Write code and tests     -> medium effort
Rename, format, tiny fix -> low effort
Milestone reached        -> /compact  (or /clear if the next task is unrelated)
Enter fullscreen mode Exit fullscreen mode

Example: a status line request

/statusline show the model name, current git branch,
and a context-window usage bar
Enter fullscreen mode Exit fullscreen mode

4. Offload Heavy Work

Claude Code doesn't have to do everything in one window.

  • Send big exploration to subagents. They read in their own window, and yours only receives a summary.

  • Use other tools for what they do best, for example a separate headless worker for vision-heavy tasks, so your main window stays focused on code.

Example: a delegation prompt

Use a subagent to search the codebase for every place we handle
refunds. Have it read files in its own context and return only:
- a list of file paths
- a 5-line summary of how the flow works
Do not paste file contents back to me.
Enter fullscreen mode Exit fullscreen mode

Conclusion

A fast, cheap Claude Code isn't about a secret setting. It comes from protecting your context budget:

  • Keep CLAUDE.md short, and enforce hard rules through permissions.

  • Audit with /context and /usage, then remove the biggest item first.

  • Match effort to the task and reset at checkpoints, before the window gets bloated.

  • Offload heavy reading to subagents so your main window stays clean.

Start with one change today: run /context in a fresh session and remove the single biggest item. You'll feel the difference right away.

Top comments (8)

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