agents.defaults.* keys for filesystem scope, bootstrap context injection, the context budget map, inbound image handling, and the agent timezone.
agents.defaults.workspace
Default: OPENCLAW_WORKSPACE_DIR when set, otherwise <state-dir>/workspace. This is ~/.openclaw/workspace for the default install and ~/.openclaw-<profile>/workspace for a named profile. A custom OPENCLAW_STATE_DIR keeps the workspace under that state directory.
agents.defaults.workspace value takes precedence over OPENCLAW_WORKSPACE_DIR. A sole agent uses this path directly. In a multi-agent fleet, agents without their own workspace use an agent-id subdirectory so no implicit owner claims the shared root.
agents.defaults.cwd
Optional working directory for agent reply runs. Use it to run coding tools in an
existing repository while bootstrap files (AGENTS.md, SOUL.md) and memory stay
in the managed agent workspace.
agents.entries.*.cwd,
then agents.defaults.cwd. When none is set, tools use the agent workspace.
Paths expand ~ like workspace; relative paths resolve against the Gateway
process working directory. A distinct working directory requires an unsandboxed
run; sandboxed runs reject it. When the directories differ, the system prompt
identifies their separate roles so deliverables stay in the working directory.
agents.defaults.repoRoot
Optional repository root shown in the system prompt’s Runtime line. If unset, OpenClaw auto-detects by walking upward from the workspace.
agents.defaults.skills
Optional default skill allowlist for agents that do not set
agents.entries.*.skills.
- Omit
agents.defaults.skillsfor unrestricted skills by default. - Omit
agents.entries.*.skillsto inherit the defaults. - Set
agents.entries.*.skills: []for no skills. - A non-empty
agents.entries.*.skillslist is the final set for that agent; it does not merge with defaults.
agents.defaults.skipBootstrap
Disables automatic creation of workspace bootstrap files (AGENTS.md, SOUL.md, IDENTITY.md, USER.md, BOOTSTRAP.md), not injection of existing files. For the embedded runtime, use contextInjection: "never" to disable injection, unless overridden per agent.
agents.defaults.skipOptionalBootstrapFiles
Skips creation of selected optional workspace files while still writing required bootstrap files (AGENTS.md, BOOTSTRAP.md). Valid values: SOUL.md, USER.md, and IDENTITY.md (HEARTBEAT.md is accepted but a no-op since heartbeat context moved to cron monitor scratch).
agents.defaults.contextInjection
Controls workspace bootstrap-file injection in the embedded runtime. Default: "always". These modes do not control CLI-backed prompt preparation or prevent an agent from reading files with tools.
"always": use normal workspace bootstrap injection, subject to the run’s context mode and file filters."continuation-skip": eligible continuation turns after a recorded full-bootstrap turn skip workspace bootstrap re-injection, reducing prompt size. Heartbeat runs, pending full-bootstrap setup, and post-compaction retries still use normal context resolution."never": disable workspace bootstrap and context-file injection on every turn, including heartbeat and compaction-recovery turns. Use this for embedded agents with specialized bootstrap-free workflows.
agents.entries.*.contextInjection. Omitted values inherit
agents.defaults.contextInjection.
agents.defaults.bootstrapMaxChars
Max characters per workspace bootstrap file before truncation. Default: 20000.
Exception: USER.md has a fixed 4,000-character cap; this setting can only
lower it for USER.md, never raise it. See User model.
agents.entries.*.bootstrapMaxChars. Omitted values inherit
agents.defaults.bootstrapMaxChars.
agents.defaults.bootstrapTotalMaxChars
Max total characters injected across all workspace bootstrap files. Default: 60000.
agents.entries.*.bootstrapTotalMaxChars. Omitted values
inherit agents.defaults.bootstrapTotalMaxChars.
Per-agent bootstrap profile overrides
Use per-agent bootstrap profile overrides when one agent needs different prompt injection behavior from the shared defaults. Omitted fields inherit fromagents.defaults.
Bootstrap truncation notice
When bootstrap context is truncated, OpenClaw always injects a concise agent-visible notice into the system prompt saying some bootstrap files were truncated and to read the affected files directly. This notice is built in and not configurable, and it deliberately omits per-file diagnostics: file names, raw vs injected counts, and limit causes stay in diagnostics such as context/status reports and logs.Context budget ownership map
OpenClaw has multiple high-volume prompt/context budgets, and they are intentionally split by subsystem instead of all flowing through one generic knob.
Matching per-agent overrides:
agents.entries.*.skillsLimits.maxSkillsPromptCharsagents.entries.*.contextInjectionagents.entries.*.bootstrapMaxCharsagents.entries.*.bootstrapTotalMaxCharsagents.entries.*.contextLimits.*
agents.defaults.startupContext
Controls the first-turn startup prelude injected on reset/startup model runs.
Bare chat /new and /reset commands acknowledge the reset without invoking
the model, so they do not load this prelude.
agents.defaults.contextLimits
Shared defaults for bounded runtime context surfaces.
memoryGetMaxChars: defaultmemory_getexcerpt cap before truncation metadata and continuation notice are added.- When
memory_getomitslines, OpenClaw uses a built-in 120-line window and then appliesmemoryGetMaxChars. - Live tool results use a model-context auto cap:
16000chars below 100K tokens,32000chars at 100K+ tokens, and64000chars at 200K+ tokens. postCompactionMaxChars: AGENTS.md excerpt cap used during post-compaction refresh injection.
agents.entries.*.contextLimits
Per-agent override for the shared contextLimits knobs. Omitted fields inherit
from agents.defaults.contextLimits.
skills.limits.maxSkillsPromptChars
Global cap for the compact skills list injected into the system prompt. This
does not affect reading SKILL.md files on demand.
agents.entries.*.skillsLimits.maxSkillsPromptChars
Per-agent override for the skills prompt budget.
agents.defaults.imageMaxDimensionPx
Max pixel size for the longest image side in transcript/tool image blocks before provider calls.
Default: 1200.
Lower values usually reduce vision-token usage and request payload size for screenshot-heavy runs.
Higher values preserve more visual detail.
agents.defaults.imageQuality
Image-tool compression/detail preference for images loaded from file paths, URLs, and media references.
Default: auto.
OpenClaw adapts the resize ladder to the selected image model. For example, Claude Opus 4.8, OpenAI GPT-6 Astra, Qwen VL, and hosted Llama 4 vision models can use larger images than older/default high-detail vision paths, while multi-image turns are compressed more aggressively in auto mode to control token and latency cost.
Values:
auto: adapt to model limits and image count.efficient: prefer smaller images for lower token and byte usage.balanced: use the standard middle-ground ladder.high: preserve more detail for screenshots, diagrams, and document images.