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?