Skip to content

DotCraft Full Configuration Reference

This page collects configuration fields, defaults, JSON examples, and advanced references in one place. For first-time setup, read Project Workspace. For product-level explanations, start from the matching Feature page and come back here for exact fields.

DotCraft reads global ~/.craft/config.json first, then overlays workspace .craft/config.json; workspace fields win. String values support $VAR and ${VAR} environment variable placeholders. If a variable is not set, the original placeholder is preserved.

Basic Model and Provider

FieldDescriptionDefault
ProviderIdCurrent personal provider id. Empty means no provider is selectedEmpty
ModelDefault model namegpt-4o-mini
NetworkTimeoutSecondsGlobal model request timeout in seconds; providers can override it600
ProvidersPersonal model provider dictionary, usually stored in ~/.craft/config.jsonEmpty
SubagentMaxConcurrencyMaximum concurrent subagents3
MaxSessionQueueSizeMaximum queued requests per session; 0 means unlimited3
ConsolidationModelMemory consolidation model. Empty uses the main modelEmpty
DebugModePrints untruncated tool arguments in the consolefalse
EnabledToolsGlobally enabled tool names. Empty enables all tools[]

Personal provider example:

json
{
  "Providers": {
    "anthropic": {
      "DisplayName": "Anthropic",
      "Protocol": "anthropic",
      "ApiKey": "${ANTHROPIC_API_KEY}"
    },
    "openrouter": {
      "DisplayName": "OpenRouter",
      "Protocol": "openai-chat-completions",
      "ApiKey": "${OPENROUTER_API_KEY}",
      "EndPoint": "https://openrouter.ai/api/v1"
    }
  }
}

Workspace model selection example:

json
{
  "ProviderId": "anthropic",
  "Model": "claude-sonnet-4-5"
}

Provider object fields:

FieldDescriptionDefault
DisplayNameUser-facing provider name; falls back to the provider id when emptyEmpty
ProtocolProvider protocol: anthropic, openai-chat-completions, or openai-responses. Empty values and legacy openai are treated as openai-chat-completions.openai-chat-completions
ApiKeyProvider API key; prefer ${ENV_NAME} environment variable referencesEmpty
EndPointProvider base URL; empty values use the protocol default endpointOpenAI protocols: https://api.openai.com/v1; anthropic: https://api.anthropic.com
NetworkTimeoutSecondsPer-provider request timeout, overriding the global NetworkTimeoutSecondsEmpty
StreamMaxRetriesPer-provider streaming reconnection attempts for dropped or idle provider streams; 0 disables stream retry5
StreamIdleTimeoutMsPer-provider idle timeout for streaming responses, in milliseconds300000

Workspace Memory and Skills

FieldDescriptionDefault
Memory.AutoConsolidateEnabledEnables automatic long-term memory consolidationtrue
Memory.ConsolidateEveryNTurnsSuccessful turns per thread between long-term memory consolidation attempts5
Skills.SelfLearning.EnabledMaster switch for agent skill self-learning; off hides skill editing from the modeltrue
Skills.SelfLearning.MaxSkillContentCharsMax chars for a single SKILL.md written through self-learning100000
Skills.SelfLearning.MaxSupportingFileBytesMax bytes for a single supporting file written through self-learning1048576

Self-learning example:

json
{
  "Skills": {
    "SelfLearning": {
      "Enabled": true,
      "MaxSkillContentChars": 100000,
      "MaxSupportingFileBytes": 1048576
    }
  }
}

SkillManage(action, ...) reference:

ActionRequired parametersPurpose
createname, contentCreate a new workspace skill
patchname, oldString, newStringLocal patch of SKILL.md or supporting file
editname, contentReplace an existing workspace skill's SKILL.md
write_filename, filePath, fileContentWrite a supporting file
remove_filename, filePathDelete a supporting file

create triggers a kind: skill approval; destructive delete operations also require approval. Self-learning writes only the current workspace's skill directory. System and personal skills are read-only, supporting files may only live under scripts/ or assets/, and absolute paths or .. traversal are rejected.

Compaction

FieldDescriptionDefault
Compaction.AutoCompactEnabledEnables threshold-based auto compactiontrue
Compaction.ReactiveCompactEnabledEnables reactive compaction for prompt_too_long errorstrue
Compaction.ContextWindowModel context window in tokens. When unset, DotCraft infers it from the current effective modelModel catalog value / 256000
Compaction.MaxContextWindowUpper bound used for inferred model catalog context windows; explicit values are preserved256000
Compaction.SummaryReserveTokensTokens reserved for summary output20000
Compaction.AutoCompactBufferTokensToken buffer below the hard limit that triggers auto compaction13000
Compaction.WarningBufferTokensToken buffer before auto threshold that emits warning20000
Compaction.ErrorBufferTokensToken buffer before auto threshold that emits error10000
Compaction.ManualCompactBufferTokensToken buffer below the hard limit where manual /compact remains allowed3000
Compaction.KeepRecentMinTokensMinimum recent tail tokens after partial summary10000
Compaction.KeepRecentMinGroupsMinimum recent API groups after partial summary3
Compaction.KeepRecentMaxTokensMaximum recent tail tokens after partial summary40000
Compaction.MicrocompactEnabledEnables micro-compactiontrue
Compaction.MicrocompactTriggerCountCompressible tool-result count that triggers micro-compaction30
Compaction.MicrocompactKeepRecentRecent tool results kept during micro-compaction8
Compaction.MicrocompactGapMinutesAlso triggers after this many minutes since last assistant message; 0 disables it20
Compaction.MaxConsecutiveFailuresConsecutive failures before circuit breaking compaction3

Model Context-Window Catalog

DotCraft ships a built-in context-window catalog for common models and uses it when Compaction.ContextWindow is not explicitly configured. You can extend or override the catalog with:

  • Global: ~/.craft/model-context-windows.json
  • Workspace: .craft/model-context-windows.json
json
{
  "defaultContextWindow": 256000,
  "models": {
    "my-256k-model": 256000,
    "custom-long-context-": 1048576
  }
}

Reasoning and Prompt Caching

FieldDescriptionDefault
Reasoning.EnabledRequests provider reasoning supportfalse
Reasoning.EffortReasoning depth: None / Low / Medium / High / ExtraHighMedium
Reasoning.OutputReasoning visibility: None / Summary / FullFull
PromptCaching.EnabledInject prompt cache markers for matching modelstrue
PromptCaching.ModelPatternsCase-insensitive model name fragments. Empty matches no models["claude"]
PromptCaching.PlacementMarker placement strategy. Currently only ConversationTail is supportedConversationTail
PromptCaching.TtlAnthropic cache TTL. Empty uses the default 5 minutes; 1h requests the long cacheEmpty

Deep-thinking adapter catalog files:

  • Global: ~/.craft/model-thinking-adapters.json
  • Workspace: .craft/model-thinking-adapters.json

The built-in catalog exposes full reasoning choices for unlisted Anthropic-protocol models, but does not assume they support Anthropic adaptive request shaping. Add anthropicThinking entries for models or endpoints that explicitly support that shape.

json
{
  "deepThinking": {
    "models": ["deepseek", "mimo", "my-thinking-model-"],
    "endpoints": ["deepseek", "my-thinking-gateway"]
  },
  "anthropicThinking": {
    "adapters": [
      {
        "models": ["my-adaptive-anthropic-model-"],
        "thinking": { "type": "adaptive", "display": "fromReasoningOutput" },
        "outputConfig": { "effort": "fromReasoningEffort" }
      }
    ]
  }
}

Tools Security and Sandbox

FieldDescriptionDefault
Security.BlacklistedPathsPaths the agent must not access; subpaths are also checked[]
Tools.File.RequireApprovalOutsideWorkspaceApprove file ops outside workspacetrue
Tools.File.MaxFileSizeMax readable file size in bytes10485760
Tools.File.RipgrepPathOptional rg path; empty tries DOTCRAFT_RG_PATH, PATH, then fallback""
Tools.File.SearchTimeoutSecondsMax GrepFiles content-search time before timeout30
Tools.Shell.RequireApprovalOutsideWorkspaceApprove shell commands outside workspacetrue
Tools.Shell.TimeoutShell timeout in seconds300
Tools.Shell.MaxOutputLengthMax shell output length in characters10000
Tools.Web.MaxCharsMax chars for web fetch50000
Tools.Web.TimeoutWeb request timeout in seconds300
Tools.Web.SearchMaxResultsDefault search result count5
Tools.Web.SearchProviderBing / ExaExa
Tools.Lsp.EnabledEnables built-in LSP toolsfalse
Tools.Lsp.MaxFileSizeMax LSP file size10485760
Tools.Sandbox.EnabledEnable sandboxfalse
Tools.Sandbox.DomainOpenSandbox service addresslocalhost:5880
Tools.Sandbox.ApiKeyOpenSandbox API keyEmpty
Tools.Sandbox.UseHttpsUse HTTPSfalse
Tools.Sandbox.ImageContainer Docker imageubuntu:latest
Tools.Sandbox.TimeoutSecondsSandbox timeout in seconds600
Tools.Sandbox.CpuContainer CPU limit1
Tools.Sandbox.MemoryContainer memory limit512Mi
Tools.Sandbox.NetworkPolicydeny / allow / customallow
Tools.Sandbox.AllowedEgressDomainsCustom allowed egress domains[]
Tools.Sandbox.IdleTimeoutSecondsIdle timeout in seconds300
Tools.Sandbox.SyncWorkspaceSync workspace into containertrue

Personal local hardening example:

json
{
  "Security": {
    "BlacklistedPaths": [
      "~/.ssh",
      "~/.gnupg",
      "~/.aws"
    ]
  },
  "Tools": {
    "File": {
      "RequireApprovalOutsideWorkspace": true
    },
    "Shell": {
      "RequireApprovalOutsideWorkspace": true,
      "Timeout": 300
    }
  }
}

Tool allow-list example:

json
{
  "EnabledTools": ["ReadFile", "GrepFiles", "WebSearch"]
}

OpenSandbox example:

json
{
  "Tools": {
    "Sandbox": {
      "Enabled": true,
      "Domain": "localhost:5880",
      "Image": "ubuntu:latest",
      "NetworkPolicy": "allow",
      "SyncWorkspace": true
    }
  }
}

Automations Goals and Hooks

FieldDescriptionDefault
Automations.EnabledEnables the Automations orchestratortrue
Automations.LocalTasksRootLocal task root. Empty uses .craft/tasks/Empty
Automations.PollingIntervalPolling interval00:00:30
Automations.MaxConcurrentTasksMaximum concurrent local tasks3
Automations.TurnTimeoutSingle-turn timeout00:30:00
Automations.StallTimeoutStall timeout without response00:10:00
Automations.MaxRetriesMaximum retry count3
Automations.RetryInitialDelayInitial retry delay00:00:30
Automations.RetryMaxDelayMaximum retry delay00:10:00
Automations.WorktreeRetentionEnabledEnables retention cleanup for idle automation task worktreestrue
Automations.WorktreeRetentionIdlePeriodIdle period before a clean automation task worktree is eligible for cleanup21.00:00:00
Goals.EnabledEnables goal storage, AppServer methods, goal context injection, usage accounting, and model goal toolstrue
Goals.AutoContinueEnabledAllows active goals to continue when a Thread is idletrue
Hooks.EnabledEnables Hookstrue
Hooks.EventsHook lists grouped by event name[]
Cron.EnabledEnables Cron scheduled taskstrue
Heartbeat.EnabledEnables heartbeat servicefalse
Heartbeat.IntervalSecondsCheck interval in seconds1800
Heartbeat.NotifyAdminSends results to admin in social channelstrue

Automations.WorktreeRetentionIdlePeriod must be at least 14.00:00:00. The retention sweep only removes managed automation task worktrees that are idle, clean, and have no commits ahead of their base.

Automation AppServer methods:

MethodDescription
automation/task/listList local tasks
automation/task/readRead one local task
automation/task/createCreate a local task
automation/task/runRun a local task immediately
automation/task/updateBindingUpdate or clear thread binding
automation/task/discardWorktreeRemove a task's managed worktree and branch while keeping the task
automation/task/deleteDelete a local task
automation/template/listList templates
automation/template/saveSave a user template
automation/template/deleteDelete a user template

Goal AppServer methods:

MethodDescription
thread/goal/setSet, replace, pause, or resume a Thread goal
thread/goal/getRead current Thread goal state
thread/goal/clearClear current Thread goal

Hook quick start:

json
{
  "Hooks": {
    "Enabled": true,
    "Events": {
      "AfterToolCall": [
        {
          "name": "log-tool-call",
          "type": "command",
          "command": "node .craft/hooks/log-tool-call.js",
          "matcher": ".*",
          "timeoutSeconds": 10
        }
      ]
    }
  }
}

Hook item fields:

FieldDescription
nameHook name for logs and troubleshooting
typeSupports "command"
commandShell command to run
matcherRegex for matching tool names. Empty matches all tool-related events
timeoutSecondsHook timeout

Lifecycle events:

EventPurpose
BeforeToolCallCheck or block before tool calls
AfterToolCallLog, format, or notify after tool calls
BeforeTurnPrepare context before an Agent turn
AfterTurnRecord results or notify after an Agent turn
BeforeAutomationTaskCheck before an automation task runs
AfterAutomationTaskSync state after an automation task completes

Tool-related Hook stdin usually includes:

json
{
  "event": "BeforeToolCall",
  "workspace": "F:\\project",
  "sessionId": "thread-id",
  "toolName": "Exec",
  "arguments": {
    "command": "dotnet test"
  }
}

Turn-related Hook stdin usually includes:

json
{
  "event": "AfterTurn",
  "workspace": "F:\\project",
  "sessionId": "thread-id",
  "summary": "Agent completed the turn"
}

Exit code semantics:

Exit codeMeaning
0Success, continue
Non-zeroHook failed; Before* events can block the current operation

Matcher examples:

matcherMatches
WriteFile|EditFileFile writes and edits
ExecShell commands
.*All tools

Entry Points and Services

FieldDescriptionDefault
Acp.EnabledEnables ACP modefalse
DashBoard.EnabledEnables Dashboardfalse
DashBoard.HostDashboard listen address127.0.0.1
DashBoard.PortDashboard listen port8080
Gateway.EnabledEnables Gateway Hostfalse
AppServer.ModeAppServer transport mode, such as stdio or WebSocketEmpty
AppServer.WebSocket.HostWebSocket listen host127.0.0.1
AppServer.WebSocket.PortWebSocket listen port9100
AppServer.WebSocket.TokenToken required by remote WebSocket clientsEmpty
ExternalChannelsExternal channel registration map{}

Dashboard example:

json
{
  "DashBoard": {
    "Enabled": true,
    "Host": "127.0.0.1",
    "Port": 8080
  }
}

External channel registration example:

json
{
  "AppServer": {
    "Mode": "WebSocket",
    "WebSocket": {
      "Host": "127.0.0.1",
      "Port": 9100,
      "Token": ""
    }
  },
  "ExternalChannels": {
    "qq": {
      "enabled": true,
      "transport": "subprocess",
      "builtinModule": "channel-qq"
    },
    "wecom": {
      "enabled": true,
      "transport": "websocket"
    }
  }
}

Platform connections, allowlists, and approval timeouts live in adapter-specific files such as .craft/qq.json and .craft/wecom.json.

Plugins MCP and LSP

FieldDescriptionDefault
Plugins.PluginRootsExtra plugin root directories maintained outside .craft/plugins/[]
McpServersMCP server configuration map{}
Tools.DeferredLoading.StrategyDeferred tool loading strategy: Off, Auto, Simulated, or NativeAuto
Tools.DeferredLoading.AlwaysLoadedToolsMCP tool names always loaded upfront[]
Tools.DeferredLoading.DeferThresholdMinimum MCP tool count before MCP tools are deferred10
Tools.DeferredLoading.MaxSearchResultsMaximum deferred tool search results per query5
LspServersLSP server configuration map{}
Tools.Lsp.EnabledEnables built-in LSP toolsfalse

External plugin root example:

json
{
  "Plugins": {
    "PluginRoots": ["./samples/plugins"]
  }
}

MCP example:

json
{
  "McpServers": {
    "everything": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-everything"]
    }
  },
  "Tools": {
    "DeferredLoading": {
      "Strategy": "Auto",
      "DeferThreshold": 10
    }
  }
}

With Tools.DeferredLoading.Strategy = Auto, openai-responses uses native client-executed tool_search, while chat-completions and Anthropic use simulated SearchTools.

SubAgent and External CLI Profiles

For the beginner path, read SubAgents.

FieldDescriptionDefault
SubAgent.MaxDepthMaximum session-backed SubAgent spawn depth; the first child is depth 11
SubAgent.ModelModel used by DotCraft native SubAgents; empty inherits the current thread's effective main modelEmpty
SubAgent.MinWaitTimeoutMsMinimum accepted WaitAgent.timeoutMs value in milliseconds15000
SubAgent.DefaultWaitTimeoutMsWaitAgent.timeoutMs used when the tool call omits a timeout60000
SubAgent.MaxWaitTimeoutMsMaximum accepted WaitAgent.timeoutMs value in milliseconds3600000
SubAgent.EnableExternalCliSessionResumeAllows external CLI profiles that support resume to reuse saved external sessionsfalse
SubAgent.DisabledProfilesSubAgent profile names hidden and disabled for this workspace[]
SubAgent.RolesWorkspace-defined SubAgent roles; entries with built-in names override built-in roles[]

Role example:

json
{
  "SubAgent": {
    "MaxDepth": 2,
    "Roles": [
      {
        "Name": "docs-explorer",
        "Description": "Read-only documentation and code explorer.",
        "ToolAllowList": ["ReadFile", "GrepFiles", "FindFiles", "WebSearch", "WebFetch", "SkillView"],
        "AgentControlToolAccess": "Disabled",
        "PromptProfile": "subagent-light",
        "Instructions": "Inspect files and web sources only. Do not edit files, execute shell commands, manage skills, or spawn agents."
      }
    ]
  }
}

Fields inside each SubAgent.Roles entry:

FieldDescription
NameRole name, also the value used by SpawnAgent.agentRole
DescriptionShort role description exposed to the main Agent
ToolAllowListExact tool allow-list; empty means no additional restriction on eligible tools
ToolDenyListExact tool deny-list removed after the tool set is assembled
AgentControlToolAccessAgentTools policy: Disabled / Full / AllowList
AllowedAgentControlToolsAgentTools names allowed when AgentControlToolAccess is AllowList
PromptProfileNative SubAgent prompt profile: subagent-light / full
InstructionsRole instructions appended to the SubAgent prompt
ModeOptional mode override
ModelOptional model override
OverrideBasePromptReplaces the base prompt with Instructions; by default instructions are appended

Custom external CLI profiles live under SubAgentProfiles. Workspace config overrides same-named global profiles.

json
{
  "SubAgent": {
    "EnableExternalCliSessionResume": true
  },
  "SubAgentProfiles": {
    "my-cli": {
      "runtime": "cli-oneshot",
      "bin": "my-cli",
      "workingDirectoryMode": "workspace",
      "inputMode": "arg",
      "outputFormat": "text",
      "supportsResume": true,
      "resumeArgTemplate": "--resume {sessionId}",
      "resumeSessionIdJsonPath": "session_id"
    }
  }
}

Fields inside each SubAgentProfiles entry:

FieldDescription
runtimeRuntime type; external short-process CLIs use cli-oneshot
binCLI executable name or absolute path
argsFixed argument list
workingDirectoryModeworkspace / specified
inputModestdin / arg / arg-template / env
inputArgTemplateTemplate for arg-template mode
inputEnvKeyEnv-var name receiving task text in env mode
envFixed env vars injected into the subprocess
envPassthroughNames of env vars to copy from parent
outputFormattext or json
outputJsonPathJSON path to extract the final result in json mode
readOutputFilePrefer reading the output file as the final result
outputFileArgTemplateOutput-file argument template, supports {path}
supportsResumeAllow DotCraft to store and reuse the external session id
resumeArgTemplateResume argument template, supports {sessionId}
resumeSessionIdJsonPathJSON path to extract session id from stdout
resumeSessionIdRegexRegex fallback when stdout is not a single JSON object
timeoutPer-run timeout in seconds
maxOutputBytesMaximum captured output bytes
trustLeveltrusted / prompt / restricted
permissionModeMappingMap DotCraft approval modes to CLI arguments

Vendor headless notes:

ProfileBehavior
cursor-cliDotCraft injects -p --output-format json and appends --resume {sessionId} when resuming
codex-cliDotCraft injects exec plus output-file arguments; resume becomes exec resume {sessionId}

Custom Commands

CustomCommands stores reusable prompts or workflows as commands. Command content usually lives under workspace .craft/commands/ or the corresponding configuration entry, then can be reused from CLI, Desktop, and other entry points.

Apache License 2.0