Original Reddit post

After a few painful sessions where Claude Code burned through context halfway through a refactor, I started treating context budget as a first-class constraint in how I scope tasks. The fix that helped most: breaking work into discrete, verifiable checkpoints before starting a session, not during. Each checkpoint ends with a test run or a git commit so the next session can orient itself fast without re-reading half the codebase. My CLAUDE.md now has three sections that actually earn their keep. First, a short project map: which directories matter, which are generated and should be ignored. Second, a conventions block that covers naming, preferred libraries, and error handling patterns. Third, a current-state section I update manually after each session, basically a one-paragraph handoff note. That last section cuts the warm-up phase noticeably on the next run. For longer workstreams I’ve started spinning up subagents for independent tasks. The pattern that works: give each subagent a single output artifact and a clear done condition. If two tasks share state or need to read each other’s output, they’re not actually independent and should be sequential. Learned that the hard way after two subagents stomped on the same config file. Prompt structure matters more than I expected for agentic runs. Front-loading constraints beats appending them. If Claude needs to avoid touching certain files or stay within a certain scope, that goes in the first sentence, not at the end after a long description. Late constraints sometimes get applied inconsistently once tool calls are already in motion. The other thing worth doing: keep a small scratch file in the repo that Claude can write intermediate state to during a long run. Not for the output, just for tracking what it has already touched. Helps avoid redundant re-reads of large files and gives you a cheap audit trail when something goes sideways. submitted by /u/ShellSageAI

Originally posted by u/ShellSageAI on r/ClaudeCode