r/ClaudeCode • • 1h ago

Tips & Workflows How I prevented Claude Code from losing his head over big repos without using up my weekly limits

Previously, I would allow one session to go on indefinitely until auto-compaction activated and Claude instantly forgot everything about the architecture that we had just agreed upon.

Switching to a strict "plan -> execute -> fresh review" loop completely fixed it:

- Plan first, clear context second: I have Claude write the implementation plan to a local PLAN.md file, then run /clear before writing a single line of code.

- Keep CLAUDE.md strictly as a map: Instead of stuffing it with style rules, I only list where things live (e.g., "adding a new API route always touches these 3 files").

-Fresh diff review: After a big batch of changes, I open a brand-new session that only sees the git diff and the original goal so it catches mistakes without agreeing with its own prior reasoning.

What’s your current strategy for keeping context clean on bigger projects?

1 Upvotes

6 comments sorted by

•

u/AutoModerator 1h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

5

u/Ayrtru 1h ago

No one asked

1

u/Pixelplanet5 1h ago

well thats exactly what the ultracode mode does by default.

1

u/HugeCannoli 55m ago

I lol at how you are all reinventing configuration files.

1

u/YouthRealistic7125 48m ago

similar, one session per task and a short handoff note the next one reads first
what went wrong for me is the notes kept growing. the session log got to 1 MB and the AI was reading more and more before doing anything. now everything it reads at the start has a size limit and a script checks it, old stuff goes to an archive

1

u/AgentYurt 31m ago

Same shape here — plan first, then /clear, then build. The one thing I'd add is that the plan file needs the same discipline: I keep it to decisions made and what's still open, and rewrite it at each handoff instead of appending. Once it turns into a running log it stops getting read, and that's when the drift creeps back in.