Claude Code의 컨텍스트 창이 어떻게 채워지는지에 대한 대화형 시뮬레이션

hackernews | | 🔬 연구
#ai 개발도구 #claude #claude code #context window #review #시뮬레이션 #토큰
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

클로드 코드(Cloude Code)의 컨텍스트 창이 작업 과정에서 어떻게 채워지고 관리되는지 보여주는 상호작용 시뮬레이션이 공개되었습니다. 시스템 시작 시 CLAUDE.md와 메모리 파일 등이 로드되며, 파일 읽기 및 편집 작업이 진행될 때마다 훅(hook) 규칙이 작동하여 컨텍스트가 누적됩니다. 특히 하위 에이전트(Subagent)는 별도의 창에서 연구를 수행해 대용량 파일 조회로 인한 메인 컨텍스트의 과부하를 방지하고 요약본만 전달하며, 마지막에는 '/compact' 명령을 통해 대화를 구조화된 요약으로 대체하여 공간을 최적화합니다. 사용자는 '/context' 및 '/memory' 명령을 통해 실시간으로 현재 컨텍스트 사용량과 최적화 방안을 직접 확인할 수 있습니다.

본문

What the timeline shows The session walks through a realistic flow with representative token counts:- Before you type anything: CLAUDE.md, auto memory, MCP tool names, and skill descriptions all load into context. Your own setup may add more here, like an output style or text from --append-system-prompt , which both go into the system prompt the same way. - As Claude works: each file read adds to context, path-scoped rules load automatically alongside matching files, and a PostToolUse hook fires after each edit. - The follow-up prompt: a subagent handles the research in its own separate context window, so the large file reads stay out of yours. Only the summary and a small metadata trailer come back. - At the end: /compact replaces the conversation with a structured summary. Most startup content reloads automatically. The skill listing is the one exception. Check your own session The visualization uses representative numbers. To see your actual context usage at any point, run/context for a live breakdown by category with optimization suggestions. Run /memory to check which CLAUDE.md and auto memory files loaded at startup. Related resources For deeper coverage of the features shown in the timeline, see these pages:- Extend Claude Code: when to use CLAUDE.md vs skills vs rules vs hooks vs MCP - Store instructions and memories: CLAUDE.md hierarchy and auto memory - Subagents: delegate research to a separate context window - Best practices: managing context as your primary constraint - Reduce token usage: strategies for keeping context usage low

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →