Terug naar podcastsClaude
Claude Code 101
Contextbeheer in Claude Code
is Claw's working memory.
is het werkgeheugen van Claude.
Every file it reads, every command it runs, every message you send, it all takes up space in the context window.
Elk bestand dat het leest, elke opdracht die het uitvoert, elk bericht dat u verstuurt, dit alles neemt ruimte in het context window in beslag.
Think of the context window as the amount of space that Claude could hold in his memory.
Beschouw het context window als de hoeveelheid ruimte die Claude in zijn geheugen kan bewaren.
Whenever you enter a prompt, Claude reads a file, runs a tool call, gets a tool call result.
Elke keer dat u een prompt invoert, leest Claude een bestand, voert een tool call uit, ontvangt een tool call resultaat.
This is added on to the context window.
Dit wordt toegevoegd aan het context window.
And since there's only a finite amount you can put in the context window, it becomes extremely important to optimize this as much as possible.
En omdat er slechts een eindige hoeveelheid in het context window past, wordt het extreem belangrijk om dit zoveel mogelijk te optimaliseren.
Now, when you approach this limit, the context window is automatically compacted.
Wanneer u deze limiet nadert, wordt het context window automatisch compact.
Compaction will summarize important details and remove the unnecessary tool call results and free up a lot of space in your context window.
Compact zal belangrijke details samenvatten en de onnodige tool call resultaten verwijderen en veel ruimte vrijmaken in uw context window.
Do note though that this could potentially lose details in your previous conversation.
Let er wel op dat dit mogelijk details uit uw vorige gesprek kan verliezen.
You can run the compaction manually as well with the /compact command.
U kunt de compactie ook handmatig uitvoeren met het /compact commando.
This will compact everything that you've done up to that point, which could be handy if you want to clear up context space, but also have a memory of what you previously worked on.
Dit zal alles wat u tot dat punt hebt gedaan compacteren, wat handig kan zijn als u contextruimte wilt vrijmaken, maar ook een herinnering wilt bewaren aan wat u eerder hebt gewerkt.
If you want to completely start from scratch without memory of what was previously worked on, you can also run /cle and that will remove everything starting from scratch.
Als u volledig opnieuw wilt beginnen zonder geheugen van wat er eerder aan gewerkt is, kunt u ook /clear uitvoeren en dat zal alles verwijderen en opnieuw beginnen.
To check the state of your context, run the /context command.
Om de status van uw context te controleren, voert u het /context commando uit.
Here you'll get a big picture of how large your context size is, the different categories that are taking up the most context, and a graphic showing you all of this.
Hier krijgt u een overzicht van hoe groot uw contextomvang is, de verschillende categorieën die het meeste context in beslag nemen, en een afbeelding die dit allemaal toont.
A general rule of thumb is when you're working on a specific feature and are going over the context window, but need to continue, then compact.
Een algemene vuistregel is dat wanneer u aan een specifieke functie werkt en het context window overschrijdt, maar verder moet gaan, u compact gebruikt.
Keeping the context relevant for this feature is important when continuing development.
Het relevant houden van de context voor deze functie is belangrijk bij het voortzetten van de ontwikkeling.
If you have finished the plan and want to start on a new feature, then clear.
Als u het plan hebt voltooid en aan een nieuwe functie wilt beginnen, gebruik dan clear.
You don't want the previous conversation to present bias in anything new that you want to create.
U wilt niet dat het vorige gesprek vooroordelen introduceert in alles nieuws wat u wilt maken.
For things that you do want Claude to remember in other sessions, put it in the claw.md file.
Voor zaken die u wilt dat Claude in andere sessies onthoudt, zet u deze in het claude.md bestand.
That way, it doesn't have to rediscover things from scratch all over again.
Op die manier hoeft het niet opnieuw alles van de grond af te herontdekken.
Be specific.
Wees specifiek.
The irony behind writing a smaller prompt is that it in the long run, it will take up more context.
De ironie achter het schrijven van een korter prompt is dat het op de lange termijn meer context in beslag neemt.
Without being explicit, Claude is forced to look around your codebase more and do its own thinking, which takes up a lot more context.
Zonder expliciet te zijn, is Claude gedwongen om door uw codebase te zoeken en eigen denkwerk te verrichten, wat veel meer context in beslag neemt.
window space than if you were just a little bit more clear with a sentence or two.
vensterruimte dan wanneer u met een zin of twee wat duidelijker was geweest.
MCP servers load all of the tools available into context by default.
MCP servers laden standaard alle beschikbare tools in de context.
So, if you have a lot of MCP servers for things that are unrelated to the project, it might be worth turning them off.
Dus als u veel MCP servers heeft voor zaken die niet gerelateerd zijn aan het project, kan het de moeite waard zijn om deze uit te zetten.
You can also try out skills, which works similarly to MCP servers, but doesn't put the entire thing into context, saving you space.
U kunt ook skills uitproberen, die op een vergelijkbare manier werken als MCP servers, maar de volledige inhoud niet in de context plaatst, waardoor u ruimte bespaart.
Sub agents run in parallel with your main agent but has a complete separate context window.
Sub agents draaien parallel met uw hoofdagent maar hebben een volledig apart context window.
So for tasks that require an answer without the journey like where is the authentication endpoints located, you can have the sub agent do the work and return just a summary to your main agent.
Voor taken die een antwoord vereisen zonder de reis, zoals waar de authenticatie-endpoints zich bevinden, kunt u de sub agent het werk laten doen en alleen een samenvatting terugsturen naar uw hoofdagent.
Managing context within cloud code is crucial.
Het beheren van context in Claude Code is cruciaal.
Use slash compact to summarize long sessions and slashclear to start fresh.
Gebruik /compact om lange sessies samen te vatten en /clear om opnieuw te beginnen.
To use your context window effectively, be specific with what you want.
Om uw context window effectief te gebruiken, wees specifiek over wat u wilt.
Check what's using your current context window and use sub agents to delegate tasks you only need the answer for.
Controleer wat uw huidige context window gebruikt en gebruik sub agents om taken te delegeren waarvoor u alleen het antwoord nodig heeft.