Context
기준일: 2026-07-26
공식 기준: Context
Context 문서는 OpenClaw 공식 문서(concepts/context)를 한국어로 정리한 가이드입니다. Context: what the model sees, how it is built, and how to inspect it 명령·설정 키·코드 예시는 공식 문서를 그대로 보존하며, 해석과 절차 안내는 한국어로 제공합니다. 최종 동작은 설치된 CLI 버전과 공식 원문을 확인하세요.
핵심 요약
Context: what the model sees, how it is built, and how to inspect it
한국어 가이드 범위: concepts/context 경로의 설정·명령·제약·예시를 학습용으로 재구성합니다.
문서 구성
공식 문서의 주요 섹션은 다음과 같습니다.
- Quick start (inspect context)
- Example output
- /context list
- /context detail
- /context map
- What counts toward the context window
- How OpenClaw builds the system prompt
- Injected workspace files (Project Context)
- Skills: injected vs loaded on-demand
- Tools: there are two costs
- Commands, directives, and "inline shortcuts"
- Sessions, compaction, and pruning (what persists)
- What /context actually reports
- 관련 문서
상세 내용
본문
"Context" is everything OpenClaw sends to the model for a run. It is bounded by the model's context window (token limit).
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- System prompt (OpenClaw-built): rules, tools, skills list, time/runtime, and injected workspace files.
- Conversation history: your messages + the assistant's messages for this session.
- Tool calls/results + attachments: command output, file reads, images/audio, etc.
Quick start (inspect context)
함께 보기: Slash commands, Token use & costs, Compaction.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
/status→ quick "how full is my window?" view + session settings./context list→ what's injected + rough sizes (per file + totals)./context detail→ deeper breakdown: per-file, per-tool schema sizes, per-skill entry sizes, system prompt size, and compactable transcript message counts./context map→ WinDirStat-style treemap image of the current session's tracked context contributors./usage tokens→ append per-reply usage footer to normal replies./compact→ summarize older history into a compact entry to free window space.
Example output
Values vary by model, provider, tool policy, and what's in your workspace.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
/context list
주요 항목:
- AGENTS.md: OK | raw 1,742 chars (
436 tok) | injected 1,742 chars (436 tok) - SOUL.md: OK | raw 912 chars (
228 tok) | injected 912 chars (228 tok) - TOOLS.md: TRUNCATED | raw 54,210 chars (
13,553 tok) | injected 20,962 chars (5,241 tok) - IDENTITY.md: OK | raw 211 chars (
53 tok) | injected 211 chars (53 tok) - USER.md: OK | raw 388 chars (
97 tok) | injected 388 chars (97 tok) - HEARTBEAT.md: MISSING | raw 0 | injected 0
- BOOTSTRAP.md: OK | raw 0 chars (
0 tok) | injected 0 chars (0 tok)
🧠 Context breakdown
Workspace: <workspaceDir>
Bootstrap max/file: 12,000 chars
Sandbox: mode=non-main sandboxed=false
System prompt (run): 38,412 chars (~9,603 tok) (Project Context 23,901 chars (~5,976 tok))
Injected workspace files:
- AGENTS.md: OK | raw 1,742 chars (~436 tok) | injected 1,742 chars (~436 tok)
- SOUL.md: OK | raw 912 chars (~228 tok) | injected 912 chars (~228 tok)
- TOOLS.md: TRUNCATED | raw 54,210 chars (~13,553 tok) | injected 20,962 chars (~5,241 tok)
- IDENTITY.md: OK | raw 211 chars (~53 tok) | injected 211 chars (~53 tok)
- USER.md: OK | raw 388 chars (~97 tok) | injected 388 chars (~97 tok)
- HEARTBEAT.md: MISSING | raw 0 | injected 0
- BOOTSTRAP.md: OK | raw 0 chars (~0 tok) | injected 0 chars (~0 tok)
Skills list (system prompt text): 2,184 chars (~546 tok) (12 skills)
Tools: read, edit, write, exec, process, browser, message, sessions_send, …
Tool list (system prompt text): 1,032 chars (~258 tok)
Tool schemas (JSON): 31,988 chars (~7,997 tok) (counts toward context; not shown as text)
Tools: (same as above)
Session tokens (cached): 14,250 total / ctx=32,000
/context detail
주요 항목:
- frontend-design: 412 chars (~103 tok)
- oracle: 401 chars (~101 tok)
- browser: 9,812 chars (~2,453 tok)
- exec: 6,240 chars (~1,560 tok)
🧠 Context breakdown (detailed)
…
Top skills (prompt entry size):
- frontend-design: 412 chars (~103 tok)
- oracle: 401 chars (~101 tok)
… (+10 more skills)
Top tools (schema size):
- browser: 9,812 chars (~2,453 tok)
- exec: 6,240 chars (~1,560 tok)
… (+N more tools)
/context map
Sends an image generated from the latest cached run report plus the session transcript. Before a normal message has produced a run report in the session, /context map returns an unavailable message instead of rendering an estimate. Rectangle area is proportional to tracked prompt characters:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- conversation transcript (user messages, assistant replies, tool results, compaction summaries), plus per-turn runtime context and hook prompt additions that reach only the model
- injected workspace files
- base system prompt text
- skill prompt entries
- tool JSON schemas
What counts toward the context window
Everything the model receives counts, including:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- System prompt (all sections).
- Conversation history.
- Tool calls + tool results.
- Attachments/transcripts (images/audio/files).
- Compaction summaries and pruning artifacts.
- Provider "wrappers" or hidden headers (not visible, still counted).
How OpenClaw builds the system prompt
The system prompt is OpenClaw-owned and rebuilt each run. It includes:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Tool list + short descriptions.
- Skills list (metadata only; see below).
- Workspace location.
- Time (UTC + converted user time if configured).
- Runtime metadata (host/OS/model/thinking).
- Injected workspace bootstrap files under Project Context.
Injected workspace files (Project Context)
By default, OpenClaw injects a fixed set of workspace files (if present):
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
AGENTS.mdSOUL.mdTOOLS.mdIDENTITY.mdUSER.mdHEARTBEAT.mdBOOTSTRAP.md(first-run only)
Skills: injected vs loaded on-demand
The system prompt includes a compact skills list (name + description + location). This list has real overhead.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Tools: there are two costs
- Tool list text in the system prompt (what you see as "Tooling"). 2. Tool schemas (JSON). These are sent to the model so it can call tools. They count toward context even though you don't see them as plain text.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Commands, directives, and "inline shortcuts"
Slash commands are handled by the Gateway. There are a few different behaviors:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Standalone commands: a message that is only
/...runs as a command. - Directives:
/think,/fast,/verbose,/trace,/reasoning,/elevated,/exec,/model,/queueare stripped before the model sees the message. - Directive-only messages persist session settings.
- Inline directives in a normal message act as per-message hints.
- Inline shortcuts (allowlisted senders only): certain
/...tokens inside a normal message can run immediately (example: "hey /status"), and are stripped before the model sees the remaining text.
Sessions, compaction, and pruning (what persists)
What persists across messages depends on the mechanism:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Normal history persists in the session transcript until compacted/pruned by policy.
- Compaction persists a summary into the transcript and keeps recent messages intact.
- Pruning drops old tool results from the in-memory prompt to free context-window space, but does not rewrite the session transcript - the full history is still inspectable on disk.
What /context actually reports
/context prefers the latest run-built system prompt report when available:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
System prompt (run)= captured from the last embedded (tool-capable) run and persisted in the session store.System prompt (estimate)= computed on the fly when no run report exists (or when running via a CLI backend that doesn't generate the report).
관련 문서
Summarizing long conversations to keep them inside the model window.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
실습 체크리스트
- 공식 문서와 로컬 버전을 대조합니다:
https://docs.openclaw.ai/concepts/context - 관련 CLI는
openclaw --help및 하위 명령--help로 옵션을 확인합니다. - 설정 변경 시
openclaw config/openclaw doctor로 유효성을 검사합니다. - Gateway·채널·플러그인 변경 후에는 필요 시 Gateway를 재시작합니다.
자주 쓰는 명령·설정 예시
🧠 Context breakdown
Workspace: <workspaceDir>
Bootstrap max/file: 12,000 chars
Sandbox: mode=non-main sandboxed=false
System prompt (run): 38,412 chars (~9,603 tok) (Project Context 23,901 chars (~5,976 tok))
Injected workspace files:
- AGENTS.md: OK | raw 1,742 chars (~436 tok) | injected 1,742 chars (~436 tok)
- SOUL.md: OK | raw 912 chars (~228 tok) | injected 912 chars (~228 tok)
- TOOLS.md: TRUNCATED | raw 54,210 chars (~13,553 tok) | injected 20,962 chars (~5,241 tok)
- IDENTITY.md: OK | raw 211 chars (~53 tok) | injected 211 chars (~53 tok)
- USER.md: OK | raw 388 chars (~97 tok) | injected 388 chars (~97 tok)
- HEARTBEAT.md: MISSING | raw 0 | injected 0
- BOOTSTRAP.md: OK | raw 0 chars (~0 tok) | injected 0 chars (~0 tok)
Skills list (system prompt text): 2,184 chars (~546 tok) (12 skills)
Tools: read, edit, write, exec, process, browser, message, sessions_send, …
Tool list (system prompt text): 1,032 chars (~258 tok)
Tool schemas (JSON): 31,988 chars (~7,997 tok) (counts toward context; not shown as text)
Tools: (same as above)
Session tokens (cached): 14,250 total / ctx=32,000
🧠 Context breakdown (detailed)
…
Top skills (prompt entry size):
- frontend-design: 412 chars (~103 tok)
- oracle: 401 chars (~101 tok)
… (+10 more skills)
Top tools (schema size):
- browser: 9,812 chars (~2,453 tok)
- exec: 6,240 chars (~1,560 tok)
… (+N more tools)
관련 링크
- 공식 원문: concepts/context
- OpenClaw 문서 홈
이 가이드는 공식 문서를 한국어 학습용으로 재구성한 것입니다. 옵션 기본값·플래그 이름은 설치 버전에 따라 달라질 수 있습니다.