forked from Selig/openclaw-skill
6 custom skills (assign-task, dispatch-webhook, daily-briefing, task-capture, qmd-brain, tts-voice) with technical documentation. Compatible with Claude Code, OpenClaw, Codex CLI, and OpenCode.
1.7 KiB
1.7 KiB
Context
OpenClaw's "Context" represents everything the model receives for a run, constrained by the model's token limit. It encompasses the system prompt, conversation history, tool calls, and attachments.
Key Components
The system breaks down into several parts:
- System prompt (built by OpenClaw): includes rules, tools, skills, time/runtime data, and workspace files
- Conversation history: user and assistant messages within the session
- Tool results and attachments: command outputs, file reads, media
Context Inspection Commands
Users can monitor context usage via:
| Command | Description |
|---|---|
/status |
Shows window fullness and session settings |
/context list |
Displays injected files with approximate token counts |
/context detail |
Provides granular breakdown by file and tool schemas |
/usage tokens |
Appends token usage to replies |
/compact |
Summarizes older messages to free space |
What Counts Toward the Window
Everything sent to the model consumes tokens:
- System prompt sections
- Conversation history
- Tool calls and results
- Attachments and transcripts
- Compaction summaries
- Provider wrappers
Workspace File Injection
OpenClaw automatically injects these files (if present):
AGENTS.mdSOUL.mdTOOLS.mdIDENTITY.mdUSER.mdHEARTBEAT.mdBOOTSTRAP.md
Files exceeding bootstrapMaxChars (default 20,000) are truncated, with truncation status indicated in context reports.
Skills and Tools
Skills include metadata in the system prompt but load instruction details only when the model calls /read on the skill file.
Tools incur dual costs:
- Text descriptions in the system prompt
- JSON schemas that count toward context separately