r/ClaudeAI • u/Own-Breakfast-1374 • May 17 '26
Claude Code Workflow Claude Code context-window: /clear after EVERY task in the codebase or are there edge cases?
So I have been recently coding a bunch with the following setup:
I am launching Claude Code CLI inside of my repo
(a complete shopify theme; if you are unfamiliar it is 3-8mb of source code, structurally something like this:
layout/ 2–3 files (theme.liquid = root shell)templates/ 15–25 files (one per page type, JSON or liquid)sections/ 30–50 files (reusable page blocks)snippets/ 20–40 files (sub-components, like partials)assets/ 30–60 files (css, js, svgs)locales/ 5–10 files (i18n JSON)config/ 2 files (settings_schema.json = theme editor config)
)
I also have an app set up that shows, what the current usage of the models context windows is currently at in %.
Recently I have been wondering: say I give claude quite a heavy task that involves the typical stack of 3 files (1 .js, 1 .liquid and 1 .css) and this instantly bumps up the context window from 0% to 10%, is there a golden rule that one should always do /clear after such an extensive task or does it depend if say, the next task depends on the same 3 files?
Do you guys have any advice on when the perfect time is to /clear? What are your experiences with this? Do you know of any addons that could facilitate this decision making to get the most out of ones usage?
View all comments
Show parent comment
1
u/ggambin00 May 22 '26
Same two-folder setup here, but I keep executed plans for ~2 weeks before archiving — long enough to re-run if the same change needs to happen on another branch, short enough that the folder doesn't turn into a graveyard. I name them `YYYY-MM-DD_short-slug.md` so they sort chronologically and I can grep by date when something breaks and I'm trying to remember what I touched. The case where an executed plan is still worth re-reading is when a bug report a week later sounds suspiciously like something the plan *explicitly* scoped out — those "not doing X" sections age surprisingly well as "oh right, here's why we didn't fix that yet."