팟캐스트로 돌아가기Claude
Claude Code 101
Context Management in Claude Code
is Claw's working memory.
은 Claude의 작업 메모리입니다.
Every file it reads, every command it runs, every message you send, it all takes up space in the context window.
Claude가 읽는 모든 파일, 실행하는 모든 명령어, 당신이 보내는 모든 메시지가 context window의 공간을 차지합니다.
Think of the context window as the amount of space that Claude could hold in his memory.
context window를 Claude가 메모리에 담을 수 있는 공간의 양이라고 생각하세요.
Whenever you enter a prompt, Claude reads a file, runs a tool call, gets a tool call result.
프롬프트를 입력할 때마다, Claude는 파일을 읽고, 도구 호출을 실행하고, 도구 호출 결과를 받습니다.
This is added on to the context window.
이것이 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.
context window에 넣을 수 있는 양이 유한하기 때문에, 이를 최대한 최적화하는 것이 매우 중요해집니다.
Now, when you approach this limit, the context window is automatically compacted.
이 한도에 가까워지면 context window가 자동으로 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는 중요한 세부 사항을 요약하고 불필요한 도구 호출 결과를 제거하여 context window에서 많은 공간을 확보합니다.
Do note though that this could potentially lose details in your previous conversation.
다만 이 과정에서 이전 대화의 세부 사항이 손실될 수 있다는 점에 유의하세요.
You can run the compaction manually as well with the /compact command.
/compact 명령어로 수동으로 compact를 실행할 수도 있습니다.
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.
이는 지금까지 작업한 모든 것을 compact하므로, context 공간을 확보하면서도 이전에 작업한 내용에 대한 기억을 유지하고 싶을 때 유용합니다.
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.
이전에 작업한 내용에 대한 기억 없이 완전히 처음부터 시작하고 싶다면, /clear를 실행하면 모든 것이 제거되고 처음부터 시작됩니다.
To check the state of your context, run the /context command.
context 상태를 확인하려면 /context 명령어를 실행하세요.
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.
여기서 context 크기의 전체적인 그림, 가장 많은 context를 차지하는 다양한 카테고리, 그리고 이 모든 것을 보여주는 그래픽을 확인할 수 있습니다.
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.
일반적인 경험 법칙은, 특정 기능을 작업하다가 context window를 초과할 것 같지만 계속해야 할 때는 compact를 사용하는 것입니다.
Keeping the context relevant for this feature is important when continuing development.
개발을 계속할 때 이 기능과 관련된 context를 유지하는 것이 중요합니다.
If you have finished the plan and want to start on a new feature, then clear.
계획을 마치고 새로운 기능을 시작하고 싶다면 clear를 사용하세요.
You don't want the previous conversation to present bias in anything new that you want to create.
이전 대화가 새로 만들고 싶은 것에 편향을 주지 않길 바랍니다.
For things that you do want Claude to remember in other sessions, put it in the claw.md file.
다른 세션에서도 Claude가 기억하기를 원하는 사항은 claude.md 파일에 넣어두세요.
That way, it doesn't have to rediscover things from scratch all over again.
그러면 Claude가 매번 처음부터 다시 발견할 필요가 없습니다.
Be specific.
구체적으로 명시하세요.
The irony behind writing a smaller prompt is that it in the long run, it will take up more context.
짧은 프롬프트를 작성하는 것의 아이러니는 장기적으로 더 많은 context를 소비한다는 것입니다.
Without being explicit, Claude is forced to look around your codebase more and do its own thinking, which takes up a lot more context.
명시적으로 지정하지 않으면 Claude는 코드베이스를 여기저기 살펴보고 스스로 생각해야 하며, 이는 훨씬 더 많은 context를 차지합니다.
window space than if you were just a little bit more clear with a sentence or two.
한두 문장으로 더 명확하게 설명했을 때보다 훨씬 많은 창 공간을 차지합니다.
MCP servers load all of the tools available into context by default.
MCP 서버는 기본적으로 사용 가능한 모든 도구를 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.
따라서 프로젝트와 무관한 MCP 서버가 많다면 이를 꺼두는 것이 좋을 수 있습니다.
You can also try out skills, which works similarly to MCP servers, but doesn't put the entire thing into context, saving you space.
MCP 서버와 유사하게 작동하지만 전체 내용을 context에 넣지 않아 공간을 절약할 수 있는 skills도 사용해 보세요.
Sub agents run in parallel with your main agent but has a complete separate context window.
Sub agents는 메인 에이전트와 병렬로 실행되지만 완전히 독립된 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.
따라서 인증 엔드포인트가 어디에 있는지와 같이 과정 없이 답만 필요한 작업의 경우, sub agent에게 작업을 맡기고 메인 에이전트에게는 요약만 반환하도록 할 수 있습니다.
Managing context within cloud code is crucial.
Claude Code 내에서 context를 관리하는 것은 매우 중요합니다.
Use slash compact to summarize long sessions and slashclear to start fresh.
/compact를 사용하여 긴 세션을 요약하고 /clear를 사용하여 처음부터 새로 시작하세요.
To use your context window effectively, be specific with what you want.
context window를 효과적으로 사용하려면 원하는 것을 구체적으로 명시하세요.
Check what's using your current context window and use sub agents to delegate tasks you only need the answer for.
현재 context window를 무엇이 사용하고 있는지 확인하고, 답변만 필요한 작업은 sub agents에게 위임하세요.