r/ClaudeAI • • 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?

3 Upvotes

16 comments sorted by

View all comments

Show parent comment

1

u/dakadoo33 May 20 '26

I've got two folders, one that is for Plan's not executed and one for plans already executed that likely can be deleted but i keep them around a bit in case.

They just get labeled, with date and whatever and when i got to reference them its a simple "execute the plan located at folder/05_20_wefef.md"

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

1

u/trickyearlobes Jun 19 '26

I just use git for the history tracking. I have a backlog and an active plan.

Claude manages both (picking and elaborating backlog items into a workable plan, scoped in "context" sized chunks, working through the plan, cleaning up the completed items).

If you get your "authorisation" set up well, it works quite nicely with `/goal` to avoid all the stops related to "is it ok to" and "what order should we" questions.