Skip to main content

⚙️ Configuration Guide

Back to Guides

⚙️ Configuration​

Config file: ~/.picoclaw/config.json

Security Configuration: For storing API keys, tokens, and other sensitive data, see the Security Configuration Guide.

Environment Variables​

You can override default paths using environment variables. This is useful for portable installations, containerized deployments, or running picoclaw as a system service. These variables are independent and control different paths.

VariableDescriptionDefault Path
PICOCLAW_CONFIGOverrides the path to the configuration file. This directly tells picoclaw which config.json to load, ignoring all other locations.~/.picoclaw/config.json
PICOCLAW_HOMEOverrides the root directory for picoclaw data. This changes the default location of the workspace and other data directories.~/.picoclaw

Examples:

# Run picoclaw using a specific config file
# The workspace path will be read from within that config file
PICOCLAW_CONFIG=/etc/picoclaw/production.json picoclaw gateway

# Run picoclaw with all its data stored in /opt/picoclaw
# Config will be loaded from the default ~/.picoclaw/config.json
# Workspace will be created at /opt/picoclaw/workspace
PICOCLAW_HOME=/opt/picoclaw picoclaw agent

# Use both for a fully customized setup
PICOCLAW_HOME=/srv/picoclaw PICOCLAW_CONFIG=/srv/picoclaw/main.json picoclaw gateway

Gateway Log Level​

gateway.log_level controls Gateway log verbosity and is configurable in config.json.

{
"gateway": {
"log_level": "warn",
"log_max_size_mb": 2,
"log_max_backups": 3
}
}

When omitted, the default is warn. Supported values: debug, info, warn, error, fatal.

log_max_size_mb sets the maximum size of each active log before rotation (default 2, allowed 1–1024). log_max_backups sets how many numbered archives to keep (default 3, allowed 0–100; 0 disables archives). Approximate disk usage per log is (log_max_backups + 1) × log_max_size_mb. These settings apply to logs/gateway.log, the workspace heartbeat.log, and any file selected with PICOCLAW_LOG_FILE; the panic log is trimmed to the configured size at startup. Existing oversized logs are trimmed to their latest content on startup. Environment overrides are PICOCLAW_GATEWAY_LOG_MAX_SIZE_MB and PICOCLAW_GATEWAY_LOG_MAX_BACKUPS. Restart the Gateway for changed rotation settings to take effect.

You can also override this with the environment variable PICOCLAW_LOG_LEVEL.

Gateway Hot Reload​

The Gateway can reload config.json without a restart. Two independent triggers are available:

  • Config file watching — opt in with gateway.hot_reload:

    {
    "gateway": {
    "hot_reload": true
    }
    }

    The default is false. When enabled, PicoClaw polls the config file (every 60 seconds, scaled by power.poll_interval_multiplier) and reloads after a change is written and validated. An invalid or partially written file is ignored and retried on the next poll; the last valid configuration stays in effect.

  • POST /reload — always available, regardless of gateway.hot_reload, on the shared Gateway HTTP server. It requires the Gateway auth token (Authorization: Bearer <token>) when one is configured and returns 202 Accepted as soon as the reload is scheduled. The reload itself runs asynchronously; watch the gateway.reload.started / gateway.reload.completed / gateway.reload.failed runtime events, or the logs, for the outcome. GET /reload/status reports the latest reload generation and outcome so callers can wait for completion.

Saving model settings from the Web UI triggers a reload automatically and clears the dashboard's restart-required banner once the reload succeeds. Failed reloads leave the previous configuration active and keep the banner visible.

A reload swaps the provider and the agent registry/configuration, restarts the cron, heartbeat, media, device and voice services, and restarts only the channels whose configuration changed. In-flight requests are allowed to drain before the previous provider is closed.

Not reloadable: changing gateway.host, gateway.port, the log rotation settings (log_max_size_mb, log_max_backups) or the singleton PID file requires a full Gateway restart. Environment-variable overrides are also read only at startup.

gateway.hot_reload can also be set with the environment variable PICOCLAW_GATEWAY_HOT_RELOAD.

Workspace Layout​

PicoClaw stores data in your configured workspace (default: ~/.picoclaw/workspace):

~/.picoclaw/workspace/
├── sessions/ # Conversation sessions and history
├── memory/ # Long-term memory (MEMORY.md)
├── state/ # Persistent state (last channel, etc.)
├── cron/ # Scheduled jobs database
├── commands/ # Custom prompt commands (*.md)
├── skills/ # Custom skills
├── AGENT.md # Agent behavior guide
├── HEARTBEAT.md # Periodic task prompts (checked every 30 min)
├── IDENTITY.md # Agent identity
├── SOUL.md # Agent soul
└── USER.md # User preferences

Note: Changes to AGENT.md, SOUL.md, USER.md and memory/MEMORY.md are automatically detected at runtime via file modification time (mtime) tracking. You do not need to restart the gateway after editing these files — the agent picks up the new content on the next request.

Agent Self-Evolution​

The evolution block controls PicoClaw's self-evolution runtime. When enabled, the agent records completed turns as learning records. In higher modes it can group repeated successful patterns, generate skill drafts, and optionally apply accepted drafts into workspace skills.

{
"evolution": {
"enabled": false,
"mode": "observe",
"state_dir": "",
"min_task_count": 2,
"min_success_ratio": 0.7,
"cold_path_trigger": "after_turn",
"cold_path_times": []
}
}
FieldDefaultDescription
enabledfalseEnables learning-record capture for completed agent turns. Heartbeat turns are ignored.
modeobserveobserve records data only. draft can generate candidate skill drafts. apply can apply accepted drafts to workspace skills.
state_dir""Optional directory for evolution state. Leave empty to use the default under the workspace.
min_task_count2Minimum related task records required before a pattern is eligible for draft generation.
min_success_ratio0.7Minimum success ratio for a task cluster. Use a value greater than 0 and up to 1.
cold_path_triggerafter_turnRuns draft generation after_turn, on a scheduled cadence, or disables automatic cold-path runs when set to manual. There is no user-facing manual trigger yet. Applies only in draft and apply modes.
cold_path_times[]Scheduled run times used when cold_path_trigger is scheduled, written as HH:MM strings.

Deprecated aliases: min_case_count (replaced by min_task_count) and min_success_rate (replaced by min_success_ratio) are still accepted in config.json for backward compatibility but are deprecated. If both the new and the old name are set, the new name takes precedence. Use the new names for all new configuration.

Use observe first if you want to inspect learning records without generating skill changes. Use draft when you want PicoClaw to prepare reviewable improvements. Use apply only when you are comfortable letting accepted drafts update workspace skills.

Request Context Policy​

turn_profile is an optional request context policy under agents.defaults.turn_profile. Leave it unset or set "enabled": false to keep PicoClaw's normal behavior. When "enabled": true, the same policy applies to every new turn.

Each block uses the same mode values:

ModeMeaning
defaultKeep PicoClaw's normal behavior for that block. Missing blocks and missing mode fields are treated as default.
offDisable that block for the turn.
customUse an allow list. In this version, custom is supported only for skills and tools; using it for history or system_prompt is a validation error.

Profile blocks:

BlockWhat it controls
historyWhether the turn reads prior session history and summary, writes user/assistant/tool messages, ingests context, and runs compaction or summarization.
system_promptWhether PicoClaw injects its default identity, workspace instructions, memory, runtime context, and summary. External request system prompts are still allowed when this is off.
skillsWhether the skill catalog and active skill prompt content are loaded. custom.allow keeps only the listed skill names in prompt context.
toolsWhich callable tools are exposed to the model and allowed at execution time. custom.allow keeps only listed registered tool names.

When system_prompt.mode is off, tools are still visible, and no external system prompt is supplied, PicoClaw uses its existing tool-use rule as the minimal fallback prompt. If tools.mode is off, no fallback prompt is added.

Example clean web policy:

{
"agents": {
"defaults": {
"turn_profile": {
"enabled": true,
"history": { "mode": "off" },
"system_prompt": { "mode": "off" },
"skills": { "mode": "off" },
"tools": {
"mode": "custom",
"allow": ["web_search", "web_fetch"]
}
}
}
}
}

Web launcher dashboard​

picoclaw-launcher serves a browser UI that requires password sign-in first. On first run, open /launcher-setup to create the dashboard password. Later manual sign-ins use /launcher-login.

  • Config file: Same directory as config.json (or the file pointed to by PICOCLAW_CONFIG). The launcher-specific file is launcher-config.json.
  • Password storage: On supported platforms, the password is stored as a bcrypt hash in launcher-auth.db. On platforms where the SQLite password store is unavailable, the bcrypt hash is stored in launcher-config.json.
  • Legacy migration: Older launcher_token values are migrated once into password login and removed from saved launcher config.
  • Local auto-login: When the launcher auto-opens a local browser after startup, it uses a one-shot loopback-only bootstrap endpoint to set the session cookie automatically.
  • Unsupported auth paths: URL token login (?token=...), PICOCLAW_LAUNCHER_TOKEN, and Authorization: Bearer dashboard auth are no longer supported.
  • Sign-out: Use POST /api/auth/logout with Content-Type: application/json (body may be {}). Do not rely on a GET URL for logout (CSRF-safe pattern).
  • Brute-force: POST /api/auth/login is rate-limited per client IP per minute (HTTP 429 when exceeded).
  • Session lifetime: The HttpOnly session cookie lasts about 31 days by default, but sessions are invalidated when the launcher process restarts.

Skill Sources​

By default, skills are loaded from:

  1. ~/.picoclaw/workspace/skills (workspace)
  2. ~/.picoclaw/skills (global)
  3. <binary-embedded-path>/skills (builtin, set at build time)

For advanced/test setups, you can override the builtin skills root with:

export PICOCLAW_BUILTIN_SKILLS=/path/to/skills

Using Skills From Chat Channels​

Once skills are installed, and MCP servers are configured, you can inspect and force them directly from a chat channel:

  • /list skills shows the installed skill names available to the current agent.
  • /list mcp shows configured MCP servers with enabled/deferred/connected status.
  • /list plugins shows installed plugin packages with their state (ready, degraded, failed, disabled, not enabled) and path.
  • /show mcp <server> shows the active tools exposed by a connected MCP server.
  • /use <skill> <message> forces a specific skill for a single request.
  • /use <skill> arms that skill for your next message in the same chat session.
  • /use clear cancels a pending skill override created by /use <skill>.

Examples:

/list skills
/list mcp
/show mcp github
/use git explain how to squash the last 3 commits
/use italiapersonalfinance
dammi le ultime news

Unified Command Execution Policy​

  • Generic slash commands are executed through a single path in the agent loop via commands.Executor.
  • Channel adapters no longer consume generic commands locally; they forward inbound text to the bus/agent path. Telegram still auto-registers supported commands such as /start, /help, /show, /list, /use at startup.
  • Custom prompt commands from <workspace>/commands/ and <PICOCLAW_HOME>/commands/ are expanded into a user prompt and continue through the normal agent turn. See Custom Prompt Commands.
  • Unknown slash commands (for example /foo) pass through to normal LLM processing.

Enable or Disable All Commands on One Channel​

Set commands_enabled to false on a channel_list entry to disable every slash command for that configured channel. The option is binary: all commands are enabled or all commands are disabled. An omitted value defaults to true.

{
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"commands_enabled": false,
"settings": {
"token": "YOUR_TELEGRAM_BOT_TOKEN"
}
},
"discord": {
"enabled": true,
"type": "discord",
"commands_enabled": true,
"settings": {
"token": "YOUR_DISCORD_BOT_TOKEN"
}
}
}
}

When disabled, built-in commands, aliases, custom prompt commands, and /stop during an active turn are rejected with an explicit notice. The commands are removed from /help, the Web UI command palette when applicable, and Telegram/Discord command menus. Normal chat messages continue to work, and other configured channels are unaffected.

This setting applies to the whole channel_list.<name> integration, not to an individual group, thread, or Discord text channel. Use the channel allow_from list when you need to restrict who can interact with the channel.

Session Isolation​

Session scope controls how much memory is shared between chats, users, threads, and spaces.

  • Use session.dimensions for the global default.
  • Use session_dimensions on a dispatch rule for one routed exception.

For step-by-step recipes and isolation patterns, see the Session Guide.

Session Write Durability​

session.durable_writes (default true, env PICOCLAW_SESSION_DURABLE_WRITES) controls whether session writes are fsynced before they are acknowledged. When true, each message append and metadata update is fsynced, so the session file survives a power failure without data loss. When false, PicoClaw still uses atomic temp-and-rename writes so session files stay consistent after a crash, but the most recent writes may be lost on power failure. Disabling durability trades some crash safety for lower write latency and reduced flash wear on constrained devices.

Context Manager (Seahorse)​

By default PicoClaw uses the legacy context manager, which summarizes history inside the session store. Setting context_manager to seahorse enables the optional SQLite-backed manager:

{
"agents": {
"defaults": {
"context_manager": "seahorse"
}
}
}

Seahorse keeps sessions/seahorse.db in the default agent workspace, builds an FTS5 index over session history, compacts old turns into multi-level summaries, and registers the short_grep and short_expand retrieval tools. The context_manager_config field is accepted but ignored by Seahorse, so the database path and session filters are not configurable.

Pruning under session.prune only runs when Seahorse is active. With the legacy manager the pruning configuration is accepted but does nothing.

For activation and fallback rules, storage schema, compaction algorithms, retrieval semantics, pruning, security properties, and implementation gaps, see Seahorse Memory.

Session Pruning​

session.prune configures automatic deletion of old chat sessions. Pruning only runs when the Seahorse context manager is active; with the legacy manager the block is accepted but does nothing. Pruning is opt-in (enabled: false by default) because it permanently deletes session data. Sessions are deleted oldest-first by last activity; the single most recently active session is never deleted, whatever the thresholds are.

FieldDefaultDescription
enabledfalseMaster switch. Nothing is deleted until this is true.
max_age_days0 (disabled)Delete sessions whose last activity is older than this many days.
max_sessions0 (disabled)Keep at most this many of the most recently active sessions.
max_db_size_mb0 (disabled)When the Seahorse SQLite database exceeds this size in MiB, prune the oldest sessions until it fits and then vacuum.
check_interval_minutes0 (effective 60)How often the background prune pass runs. Zero uses the default of 60 minutes.
vacuumtrue when omittedRun VACUUM after a prune pass that deleted sessions. The database-size guard always vacuums.

Environment overrides use the prefix PICOCLAW_SESSION_PRUNE_. For the full settings table with environment keys, see Seahorse Memory.

Routing​

Routing is configured through agents.dispatch.rules.

Each rule matches against the normalized inbound context produced by channels. Rules are evaluated from top to bottom. The first matching rule wins. If no rule matches, PicoClaw falls back to the configured default agent.

Supported match fields:

  • channel
  • account
  • space
  • chat
  • topic
  • sender
  • mentioned

Match values use the same scope vocabulary as the session system:

  • space: workspace:t001, guild:123456
  • chat: direct:user123, group:-100123, channel:c123
  • topic: topic:42
  • sender: a normalized sender identifier for the platform

Rules may optionally override the global session.dimensions value through session_dimensions. This allows routing and session allocation to stay aligned without reintroducing the old bindings or dm_scope formats.

Example:

{
"agents": {
"list": [
{ "id": "main", "default": true },
{ "id": "support" },
{ "id": "sales" }
],
"dispatch": {
"rules": [
{
"name": "vip in support group",
"agent": "sales",
"when": {
"channel": "telegram",
"chat": "group:-1001234567890",
"sender": "12345"
},
"session_dimensions": ["chat", "sender"]
},
{
"name": "telegram support group",
"agent": "support",
"when": {
"channel": "telegram",
"chat": "group:-1001234567890"
},
"session_dimensions": ["chat"]
}
]
}
},
"session": {
"dimensions": ["chat"]
}
}

In the example above, the VIP rule must appear before the broader group rule. Because routing is strictly ordered, more specific rules should be placed earlier and broader fallback rules later.

The model-routing config also supports two mid-turn escalation guards inside agents.defaults.routing:

FieldDefaultDescription
escalation_prompt_tokens32768Switch to the primary model for the rest of the turn when a light-model response reports more prompt tokens than this. 0 uses the default.
escalation_tool_iterations3Switch to the primary model for the rest of the turn after this many consecutive light-model responses that requested tools. 0 uses the default.

Escalation happens at most once per turn.

For more complete routing and model-tier examples, see the Routing Guide.

Agent Tool Allowlist​

Per-agent tool declarations live in AGENT.md frontmatter, not in config.json.

If tools is omitted from frontmatter, the agent gets the normal globally enabled tool set. If tools is present, PicoClaw registers only the listed runtime tools for that agent.

---
name: Research Agent
description: Specialist for web research and in-depth analysis.
tools: [read_file, write_file, web_search, web_fetch, message]
skills: [deep-research]
mcpServers: [web-index]
---

You are the research agent.

Notes:

  • This is an allowlist, not a preference hint.
  • Tool names are matched against the runtime tool name 1:1.
  • Use runtime tool names such as web_search, web_fetch, spawn, subagent, send_file.
  • Tool declarations in AGENT.md are used by runtime/tooling, but they are not injected into the discovery prompt.

Agent Discovery (Automatic)​

When an agent has spawnable peers and can call spawn, PicoClaw injects a structured agent registry into that agent's system prompt on every turn. No extra list_agents tool call is required.

This registry is intended to make delegation concrete and reliable, especially when using spawn with a target agent_id.

Each entry includes:

FieldMeaning
idStable agent id
nameAgent identity name from AGENT.md frontmatter
descriptionAgent identity description from AGENT.md frontmatter

Important behavior:

  • The discovery section appears only when the current agent has the spawn tool and includes only peer agents it is permitted to spawn via subagents.allow_agents.
  • The current agent and non-spawnable peers are omitted, so the model does not plan against unavailable agents.
  • Discovery is intentionally lightweight. It gives the model only the identity it needs to choose a peer: id, name, and description.
  • config.json remains the infrastructure layer: workspace, default agent selection, routing, and subagent permissions. Those permissions also gate discovery visibility.
  • AGENT.md remains the identity layer. Runtime/tool code can still use its tools, skills, mcpServers, and model fields when delegation happens.

Example injected shape:

{
"agents": [
{
"id": "research",
"name": "Research Agent",
"description": "Specialist for long-form investigation and web work."
}
]
}

In practice, this means a generalist agent can choose a peer based on its role description, then call spawn with the peer's agent_id. The runtime resolves the rest.

🔒 Security Sandbox​

PicoClaw runs in a sandboxed environment by default. The agent can only access files and execute commands within the configured workspace.

Default Configuration​

{
"agents": {
"defaults": {
"workspace": "~/.picoclaw/workspace",
"restrict_to_workspace": true
}
}
}
OptionDefaultDescription
workspace~/.picoclaw/workspaceWorking directory for the agent
restrict_to_workspacetrueRestrict file/command access to workspace

Protected Tools​

When restrict_to_workspace: true, the following tools are sandboxed:

ToolFunctionRestriction
read_fileRead filesOnly files within workspace
write_fileWrite filesOnly files within workspace
list_dirList directoriesOnly directories within workspace
search_filesSearch file contents or filenamesUses the same read-path restrictions; paginated, bounded results
edit_fileEdit filesOnly files within workspace
append_fileAppend to filesOnly files within workspace
execExecute commandsCommand paths must be within workspace

The workspace restriction is a static path policy, not an OS sandbox. It validates command paths, home expansion and directory changes, but child processes and script contents remain outside its reach. Use containers, VMs, or a dedicated user for untrusted workloads.

Process Isolation​

The workspace restriction only controls paths. To confine child processes at the OS level, enable the optional top-level isolation block:

{
"isolation": {
"enabled": true,
"expose_paths": [
{ "source": "/opt/toolchains/go", "target": "/opt/toolchains/go", "mode": "ro" }
],
"block_network": false
}
}
Config KeyTypeDefaultDescription
isolation.enabledboolfalseSandbox child processes: exec, CLI providers, process hooks, MCP stdio servers and plugins
isolation.expose_pathsarray[]Host paths exposed inside the sandbox as {source, target, mode}, where mode is ro or rw
isolation.block_networkboolfalseIsolate child processes from the host network namespace; Linux only. When false, sandboxed commands still reach host loopback, the LAN and cloud metadata endpoints

Linux requires bwrap (bubblewrap); macOS uses Seatbelt through sandbox-exec; Windows applies process-level restrictions. When isolation is enabled, HOME, TMPDIR and the XDG directories are redirected to the instance root, and only an allowlist of environment variables is inherited. The workspace restriction and process isolation complement each other and do not replace each other.

⚠️ Warning: block_network defaults to false, so an isolated command can still reach 127.0.0.1, scan the LAN and brute-force the host or other devices. Set it to true unless exec, MCP servers or CLI providers need curl, wget, git or other outbound network access. See Network isolation.

For platform support, expose_paths rules, bubblewrap requirements, network isolation and troubleshooting, see Subprocess Isolation.

Additional Exec Protection​

By default, the exec tool blocks these dangerous commands (the hardline subset stays blocked even when enable_deny_patterns is false):

  • del /f, rmdir /s — Bulk deletion (Unix rm is risk-classified: plain rm is medium, rm -r is high, rm -rf is critical)
  • format, mkfs, diskpart — Disk formatting (always-on for disk formats)
  • dd if= — Disk imaging (always-on)
  • Writing to /dev/sd[a-z] — Direct disk writes (always-on)
  • shutdown, reboot, poweroff — System shutdown (always-on)
  • Self-protection: killing the PicoClaw process or service, deleting its state directory (~/.picoclaw, $HOME/.picoclaw, $PICOCLAW_HOME or PICOCLAW_HOME), or deleting the running executable — Always-on
  • Hardline and custom deny matching resolves $IFS, ANSI-C $'...' strings, backslash-newline continuations and AST quote splicing before applying the patterns — Always-on
  • Exec (Unix) workspace boundary: when restrict_to_workspace is enabled, ~/$HOME path expansion, bare .. in cd/pushd/-C targets, cd/pushd changes, dynamic redirection targets and nested sh -c/exec/find -exec scripts are validated against the workspace, including symlink escapes; env -C, eval, trap, file: URIs and HOME/PWD/OLDPWD/CDPATH assignments are rejected — Static best effort; use OS isolation for untrusted workloads
  • Windows PowerShell: recursive Remove-Item, Clear-Disk, Format-Volume, vssadmin delete shadows, bcdedit /set, reg delete, icacls /grant Everyone, iwr ... | iex, taskkill /F, Stop-Process -Force
  • Fork bomb :(){ :|:& };: — Always-on

File Access Control​

Config KeyTypeDefaultDescription
tools.allow_read_pathsstring[][]Additional paths allowed for read-only filesystem tools outside workspace; exec does not inherit them
tools.allow_write_pathsstring[][]Additional paths allowed for writing outside workspace, including exec
tools.search_files.enabledbooltrueEnables regex content search and glob/substring filename search
tools.message.media_enabledboolfalseAllows the message tool to attach local media files by path. This is separate from tools.send_file.enabled; enable it only when unified text/media/caption delivery is intended.

Read File Mode​

read_file has three modes selected by config. PicoClaw registers exactly one implementation at startup:

Config KeyTypeDefaultDescription
tools.read_file.enabledbooltrueEnables the read_file tool
tools.read_file.modestringautoSelects the read_file implementation: auto, bytes, or lines
tools.read_file.max_read_file_sizeint65536Maximum bytes returned by read_file
tools.read_file.max_linesint2000Upper bound on lines returned by a single line-mode read; larger max_lines requests are clamped
tools.read_file.max_line_lengthint2000Maximum characters per line in the line-numbered view; the remainder is replaced by a ... [truncated] marker

Mode: auto (default)​

Inspects the first 512 bytes. Text files use the line-numbered behavior below, while binary-looking files fall back to raw byte output instead of being rejected. The tool exposes both parameter sets:

  • start_line / max_lines select line mode for text files
  • offset / length select byte mode; supplying either one forces byte mode even for text files (useful for minified files with very long lines)
  • For binary files, omitting both offset and length reads the default max_read_file_size range
  • Mixing the two parameter sets in one call is rejected
  • An empty file returns [file is empty (0 bytes); do not retry] in every mode

Mode: bytes​

Optimized for arbitrary files and binary-safe pagination.

Parameters:

  • path (required): File path
  • offset (optional): Starting byte offset, default 0
  • length (optional): Maximum number of bytes to read, default max_read_file_size

Use bytes when:

  • You may read binary files
  • You want deterministic byte-range pagination

Mode: lines​

Text-oriented behavior, optimized for source files, markdown, logs, and configs. The tool reads sequentially by line and stops when the configured byte budget is reached.

Parameters:

  • path (required): File path
  • start_line (optional): Starting line number, 1-indexed and inclusive, default 1
  • max_lines (optional): Maximum number of lines to read, default = all remaining lines until EOF or byte budget; requests above tools.read_file.max_lines are clamped

Behavior notes:

  • Binary-looking files are rejected with guidance to switch read_file to mode = bytes or mode = auto
  • Extremely long single lines are cut after tools.read_file.max_line_length characters with a ... [truncated] marker, and the read continues with the next line; if the byte budget runs out mid-line, the header reports that cut instead

Use mode = lines when:

  • The agent mostly reads text files
  • You want line-based pagination in prompts and tool calls
  • You want cleaner chunks for code review, logs, and documentation

Example​

{
"tools": {
"read_file": {
"enabled": true,
"mode": "auto",
"max_read_file_size": 65536,
"max_lines": 2000,
"max_line_length": 2000
}
}
}

Exec Security​

Config KeyTypeDefaultDescription
tools.exec.allow_remoteboolfalseAllow exec tool from remote channels (Telegram/Discord etc.)
tools.exec.enable_deny_patternsbooltrueEnable built-in dangerous command interception (hardline and custom deny rules still apply when off)
tools.exec.unknown_command_policystring"ask"ask (default) requests user approval for commands the risk classifier cannot resolve, allow runs them, block rejects them
tools.exec.approval_timeout_secondsint300Seconds an unknown-command approval prompt waits before the command is denied
tools.exec.custom_deny_patternsstring[][]Custom regex patterns to block; always enforced
tools.exec.custom_allow_patternsstring[][]Full-command regex patterns that exempt only the default deny set; anchored automatically

The AST risk classifier (risk_threshold), unknown-command approval (unknown_command_policy) and the child-process environment (env_set, env_allowlist) are documented in the exec tool reference; see risk classification.

Security Note: Symlink protection is enabled by default — all file paths are resolved through filepath.EvalSymlinks before whitelist matching, preventing symlink escape attacks.

Known Limitation: Child Processes From Build Tools​

The exec safety guard only inspects the command line PicoClaw launches directly. It does not recursively inspect child processes spawned by allowed developer tools such as make, go run, cargo, npm run, or custom build scripts.

That means a top-level command can still compile or launch other binaries after it passes the initial guard check. In practice, treat build scripts, Makefiles, package scripts, and generated binaries as executable code that needs the same level of review as a direct shell command.

For higher-risk environments:

  • Review build scripts before execution.
  • Prefer approval/manual review for compile-and-run workflows.
  • Run PicoClaw inside a container or VM if you need stronger isolation than the built-in guard provides.

Error Examples​

[ERROR] tool: Tool execution failed
{tool=exec, error=Command blocked by safety guard (path outside working dir)}
[ERROR] tool: Tool execution failed
{tool=exec, error=Command blocked by safety guard (dangerous pattern detected)}

Disabling Restrictions (Security Risk)​

If you need the agent to access paths outside the workspace:

Method 1: Config file

{
"agents": {
"defaults": {
"restrict_to_workspace": false
}
}
}

Method 2: Environment variable

export PICOCLAW_AGENTS_DEFAULTS_RESTRICT_TO_WORKSPACE=false

⚠️ Warning: Disabling this restriction allows the agent to access any path on your system. Use with caution in controlled environments only.

Security Boundary Consistency​

The restrict_to_workspace setting applies consistently across all execution paths:

Execution PathSecurity Boundary
Main Agentrestrict_to_workspace ✅
Subagent / SpawnInherits same restriction ✅
Heartbeat tasksInherits same restriction ✅

All paths share the same workspace restriction — there's no way to bypass the security boundary through subagents or scheduled tasks.

Heartbeat (Periodic Tasks)​

PicoClaw can perform periodic tasks automatically. Create a HEARTBEAT.md file in your workspace:

# Periodic Tasks

- Check my email for important messages
- Review my calendar for upcoming events
- Check the weather forecast

The agent will read this file every 30 minutes (configurable) and execute any tasks using available tools.

Tasks are read from the content that follows the Add your heartbeat tasks below this line: marker. If the marker is missing, the whole file is treated as a task list. The auto-generated template leaves that section empty, so an untouched HEARTBEAT.md keeps the heartbeat idle. Quick answers are delivered back to the last active channel; long tasks should use spawn (see below), and the subagent reports its own result with the message tool.

Async Tasks with Spawn​

For long-running tasks (web search, API calls), use the spawn tool to create a subagent:

# Periodic Tasks

## Quick Tasks (respond directly)

- Report current time

## Long Tasks (use spawn for async)

- Search the web for AI news and summarize
- Check email and report important messages

Key behaviors:

FeatureDescription
spawnCreates async subagent, doesn't block heartbeat
Independent contextSubagent has its own context, no session history
message toolSubagent communicates with user directly via message tool
Non-blockingAfter spawning, heartbeat continues to next task

How Subagent Communication Works​

Heartbeat triggers
↓
Agent reads HEARTBEAT.md
↓
For long task: spawn subagent
↓ ↓
Continue to next task Subagent works independently
↓ ↓
All tasks done Subagent uses "message" tool
↓ ↓
Respond HEARTBEAT_OK User receives result directly

The subagent has access to tools (message, web_search, etc.) and can communicate with the user independently without going through the main agent.

Configuration:

{
"heartbeat": {
"enabled": true,
"interval": 30
}
}
OptionDefaultDescription
enabledtrueEnable/disable heartbeat
interval30Check interval in minutes (min: 5)

Environment variables:

  • PICOCLAW_HEARTBEAT_ENABLED=false to disable
  • PICOCLAW_HEARTBEAT_INTERVAL=60 to change interval

For constrained devices, enable the static low-power profile:

{
"power": {
"low_power": true,
"low_power_heartbeat_interval": 120,
"poll_interval_multiplier": 5
}
}

With low_power enabled, the heartbeat interval defaults to 120 minutes (or the larger configured normal interval), and the agent loop blocks on inbound events instead of waking every 100 ms. poll_interval_multiplier scales maintenance intervals: 5 turns a 30-minute media cleanup interval into 150 minutes, a 10-second channel-maintenance interval into 50 seconds, and a 60-second config-file check into 300 seconds when hot reload is enabled. Set low_power_heartbeat_interval and poll_interval_multiplier to tune the profile. Channel protocol keepalives remain unchanged so connected integrations stay available.

Providers​

Note

Groq provides free voice transcription via Whisper. If configured, audio messages from any channel will be automatically transcribed at the agent level.

ProviderPurposeGet API Key
geminiLLM (Gemini direct)aistudio.google.com
zhipuLLM (Zhipu direct)bigmodel.cn
volcengineLLM (Volcengine direct)volcengine.com
openrouterLLM (recommended, access to all models)openrouter.ai
anthropicLLM (Claude direct)console.anthropic.com
openaiLLM (GPT direct)platform.openai.com
deepseekLLM (DeepSeek direct)platform.deepseek.com
qwenLLM (Qwen direct)dashscope.console.aliyun.com
groqLLM + Voice transcription (Whisper)console.groq.com
cerebrasLLM (Cerebras direct)cerebras.ai
vivgridLLM (Vivgrid direct)vivgrid.com

Model Configuration (model_list)​

What's New? PicoClaw now prefers explicit provider + native model configuration (for example "provider": "zhipu", "model": "glm-4.7"). The legacy single-field provider/model form remains supported for compatibility when provider is omitted.

This design also enables multi-agent support with flexible provider selection:

  • Different agents, different providers: Each agent can use its own LLM provider
  • Model fallbacks: Configure primary and fallback models for resilience
  • Load balancing: Distribute requests across multiple endpoints or keys
  • Centralized configuration: Manage all providers in one place
  • Model enable/disable: Use the enabled field to temporarily disable a model without removing its configuration

PicoClaw supports separating sensitive data (API keys, tokens, secrets) from your main configuration by storing them in a .security.yml file.

Key Benefits:

  • Security: Sensitive data is never in your main config file
  • Easy sharing: Share config.json without exposing API keys
  • Version control: Add .security.yml to .gitignore
  • Flexible deployment: Different environments can use different security files

Quick Setup:

  1. Create ~/.picoclaw/.security.yml with your API keys:
model_list:
gpt-5.4:
api_keys:
- "sk-proj-your-actual-openai-key"
claude-sonnet-4.6:
api_keys:
- "sk-ant-your-actual-anthropic-key"
channels:
telegram:
token: "your-telegram-bot-token"
web:
brave:
api_keys:
- "BSAyour-brave-api-key"
glm_search:
api_key: "your-glm-search-api-key"
  1. Set proper permissions:
chmod 600 ~/.picoclaw/.security.yml
  1. Remove sensitive fields from config.json (recommended):
{
"model_list": [
{
"model_name": "gpt-5.4",
"provider": "openai",
"model": "gpt-5.4"
// api_key loaded from .security.yml
}
],
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
// token loaded from .security.yml
}
}
}

How it works:

  • Values from .security.yml are automatically mapped to config fields
  • No special syntax needed — just omit sensitive fields from config.json
  • If a field exists in both files, .security.yml value takes precedence
  • You can mix direct values in config.json with security values

For complete documentation, see ../security/security_configuration.md.

All Supported Vendors​

Vendorprovider ValueDefault API BaseProtocolAPI Key
OpenAIopenaihttps://api.openai.com/v1OpenAIGet Key
Anthropicanthropichttps://api.anthropic.com/v1AnthropicGet Key
智谱 AI (GLM)zhipuhttps://open.bigmodel.cn/api/paas/v4OpenAIGet Key
DeepSeekdeepseekhttps://api.deepseek.com/v1OpenAIGet Key
Google Geminigeminihttps://generativelanguage.googleapis.com/v1betaGeminiGet Key
Groqgroqhttps://api.groq.com/openai/v1OpenAIGet Key
Moonshotmoonshothttps://api.moonshot.cn/v1OpenAIGet Key
通义千问 (Qwen)qwenhttps://dashscope.aliyuncs.com/compatible-mode/v1OpenAIGet Key
NVIDIAnvidiahttps://integrate.api.nvidia.com/v1OpenAIGet Key
Ollamaollamahttp://localhost:11434/v1OpenAILocal (no key needed)
LM Studiolmstudiohttp://localhost:1234/v1OpenAIOptional (local default: no key)
OpenRouteropenrouterhttps://openrouter.ai/api/v1OpenAIGet Key
LiteLLM Proxylitellmhttp://localhost:4000/v1OpenAIYour LiteLLM proxy key
VLLMvllmhttp://localhost:8000/v1OpenAILocal
Cerebrascerebrashttps://api.cerebras.ai/v1OpenAIGet Key
VolcEngine (Doubao)volcenginehttps://ark.cn-beijing.volces.com/api/v3OpenAIGet Key
神算云shengsuanyunhttps://router.shengsuanyun.com/api/v1OpenAI—
BytePlusbyteplushttps://ark.ap-southeast.bytepluses.com/api/v3OpenAIGet Key
Vivgridvivgridhttps://api.vivgrid.com/v1OpenAIGet Key
LongCatlongcathttps://api.longcat.chat/openaiOpenAIGet Key
ModelScope (魔搭)modelscopehttps://api-inference.modelscope.cn/v1OpenAIGet Token
AntigravityantigravityGoogle CloudCustomOAuth only
GitHub Copilotgithub-copilotlocalhost:4321gRPC—

Basic Configuration​

{
"model_list": [
{
"model_name": "ark-code-latest",
"provider": "volcengine",
"model": "ark-code-latest",
"api_keys": ["sk-your-api-key"]
},
{
"model_name": "gpt-5.4",
"provider": "openai",
"model": "gpt-5.4",
"api_keys": ["sk-your-openai-key"]
},
{
"model_name": "claude-sonnet-4.6",
"provider": "anthropic",
"model": "claude-sonnet-4.6",
"api_keys": ["sk-ant-your-key"]
},
{
"model_name": "glm-4.7",
"provider": "zhipu",
"model": "glm-4.7",
"api_keys": ["your-zhipu-key"]
}
],
"agents": {
"defaults": {
"model": "gpt-5.4"
}
}
}

Security Note: You can remove api_keys fields from your config and store them in .security.yml instead. See Security Configuration above for details.

Note: The enabled field can be set to false to disable a model entry without removing it. When omitted, it defaults to true during migration for models that have API keys.

Resolution rules:

  • Prefer explicit "provider": "openai", "model": "gpt-5.4".
  • If provider is set, PicoClaw sends model unchanged.
  • If provider is omitted, PicoClaw treats the first / segment in model as the provider and everything after that first / as the runtime model ID.
  • This means "model": "openrouter/openai/gpt-5.4" still works as a compatibility form and sends openai/gpt-5.4 to OpenRouter.

Streaming Configuration​

Provider streaming uses a double opt-in and is disabled by default. The agent only tries streaming when the current channel has settings.streaming.enabled: true, the active model entry has streaming.enabled: true, and both the provider and channel support streaming. If any condition is missing, PicoClaw uses the normal non-streaming request path.

Pico WebUI is the first fully wired channel. Pico creates the first assistant message with the existing message.create wire message, then updates that same message with message.update; no new Pico wire message type is introduced.

Leave streaming unset when you do not want streaming. An omitted streaming block means disabled; you do not need to write "streaming": {"enabled": false}.

Opt-in example:

{
"model_list": [
{
"model_name": "gpt-5.4",
"provider": "openai",
"model": "gpt-5.4",
"api_keys": ["sk-your-openai-key"],
"streaming": {
"enabled": true
}
}
],
"channel_list": {
"pico": {
"enabled": true,
"type": "pico",
"settings": {
"token": "YOUR_PICO_TOKEN",
"streaming": {
"enabled": true
}
}
}
}
}
FieldTypeDefaultDescription
channel_list.<name>.settings.streaming.enabledboolfalseAllows this channel to display provider streaming output
channel_list.<name>.settings.streaming.throttle_secondsintPico default after enabling: 0Minimum interval for intermediate updates; final content is always flushed
channel_list.<name>.settings.streaming.min_growth_charsintPico default after enabling: 1Minimum character growth before sending an intermediate update; final content is always flushed
model_list[].streaming.enabledboolfalseAllows this model entry to try provider streaming requests

Per-model sampling parameters: each model_list entry also accepts max_tokens, temperature, and context_window, which override the matching agents.defaults values for requests routed to that entry. See Providers & Model Configuration for the full field reference and override semantics.

Legacy Telegram environment variables remain compatible: PICOCLAW_CHANNELS_TELEGRAM_STREAMING_ENABLED, PICOCLAW_CHANNELS_TELEGRAM_STREAMING_THROTTLE_SECONDS, and PICOCLAW_CHANNELS_TELEGRAM_STREAMING_MIN_GROWTH_CHARS. They only apply to Telegram settings and do not enable or modify Pico settings.streaming.

Failure behavior is intentionally conservative: if streaming fails before any visible chunk is sent, PicoClaw retries once through the normal Chat() path. If a chunk has already been shown to the user, PicoClaw does not send a second non-streaming answer, because that would duplicate visible output.

For model-specific TTS request fields such as custom speech voice names or response_format: "mp3", use model_list[].extra_body.

Vendor-Specific Examples​

Tip: You can omit api_key fields and store them in .security.yml for better security. See Security Configuration.

OpenAI
{
"model_name": "gpt-5.4",
"provider": "openai",
"model": "gpt-5.4"
// api_key: set in .security.yml
}
OpenRouter TTS (MAI Voice 2)
{
"model_name": "mai-voice-2",
"provider": "openrouter",
"model": "microsoft/mai-voice-2",
"api_base": "https://openrouter.ai/api/v1",
"extra_body": {
"voice": "en-US-Harper:MAI-Voice-2",
"response_format": "mp3"
}
// api_key: set in .security.yml
}

Pair this with:

{
"voice": {
"tts_model_name": "mai-voice-2"
}
}
VolcEngine (Doubao)
{
"model_name": "ark-code-latest",
"provider": "volcengine",
"model": "ark-code-latest"
// api_key: set in .security.yml
}
智谱 AI (GLM)
{
"model_name": "glm-4.7",
"provider": "zhipu",
"model": "glm-4.7"
// api_key: set in .security.yml
}
DeepSeek
{
"model_name": "deepseek-chat",
"provider": "deepseek",
"model": "deepseek-chat"
// api_key: set in .security.yml
}
Anthropic
{
"model_name": "claude-sonnet-4.6",
"provider": "anthropic",
"model": "claude-sonnet-4.6"
// api_key: set in .security.yml
}

Run picoclaw auth login --provider anthropic to paste your API token.

For direct Anthropic API access or custom endpoints that only support Anthropic's native message format:

{
"model_name": "claude-opus-4-6",
"provider": "anthropic-messages",
"model": "claude-opus-4-6",
"api_keys": ["sk-ant-your-key"],
"api_base": "https://api.anthropic.com"
}

Use anthropic-messages when the endpoint requires Anthropic's native /v1/messages format instead of OpenAI-compatible /v1/chat/completions.

Ollama (local)
{
"model_name": "llama3",
"provider": "ollama",
"model": "llama3"
}
LM Studio (local)
{
"model_name": "lmstudio-local",
"provider": "lmstudio",
"model": "openai/gpt-oss-20b"
}

api_base defaults to http://localhost:1234/v1. API key is optional unless your LM Studio server enables authentication.
With explicit provider, PicoClaw sends openai/gpt-oss-20b unchanged to LM Studio. The legacy compatibility form "model": "lmstudio/openai/gpt-oss-20b" still resolves to the same upstream model ID when provider is omitted.

Custom Proxy / LiteLLM
{
"model_name": "my-custom-model",
"provider": "openai",
"model": "custom-model",
"api_base": "https://my-proxy.com/v1"
// api_key: set in .security.yml
}

With explicit provider, PicoClaw sends model unchanged. That means "provider": "litellm", "model": "lite-gpt4" sends lite-gpt4, while "provider": "litellm", "model": "openai/gpt-4o" sends openai/gpt-4o. The legacy compatibility forms litellm/lite-gpt4 and litellm/openai/gpt-4o still resolve the same way when provider is omitted.

Load Balancing​

Configure multiple endpoints for the same model name — PicoClaw will automatically round-robin between them:

Option 1: Multiple API Keys in .security.yml (Recommended)

# .security.yml
model_list:
gpt-5.4:
api_keys:
- "sk-proj-key-1"
- "sk-proj-key-2"
// config.json
{
"model_list": [
{
"model_name": "gpt-5.4",
"provider": "openai",
"model": "gpt-5.4",
"api_base": "https://api.openai.com/v1"
// api_keys loaded from .security.yml
}
]
}

Option 2: Multiple Model Entries

{
"model_list": [
{
"model_name": "gpt-5.4",
"provider": "openai",
"model": "gpt-5.4",
"api_base": "https://api1.example.com/v1",
"api_keys": ["sk-key1"]
},
{
"model_name": "gpt-5.4",
"provider": "openai",
"model": "gpt-5.4",
"api_base": "https://api2.example.com/v1",
"api_keys": ["sk-key2"]
}
]
}

Migration from Legacy providers Config​

The old providers configuration is deprecated and has been removed in V2. Existing V0/V1 configs are auto-migrated. See docs/migration/model-list-migration.md for the full guide.

Provider Architecture​

PicoClaw routes providers by protocol family:

  • OpenAI-compatible: OpenRouter, Groq, Zhipu, vLLM-style endpoints, and most others.
  • Gemini native: Google Gemini via the native models/*:generateContent and models/*:streamGenerateContent endpoints.
  • Anthropic: Claude-native API behavior.
  • Codex/OAuth: OpenAI OAuth/token authentication route.

This keeps the runtime lightweight while making new OpenAI-compatible backends mostly a config operation (api_base + api_keys).

Zhipu (legacy providers format)
{
"agents": {
"defaults": {
"workspace": "~/.picoclaw/workspace",
"model": "glm-4.7",
"max_tokens": 8192,
"temperature": 0.7,
"max_tool_iterations": 20,
"max_parallel_turns": 5
}
},
"providers": {
"zhipu": {
"api_key": "Your API Key",
"api_base": "https://open.bigmodel.cn/api/paas/v4"
}
}
}

Note: The providers format is deprecated. Use the new model_list format with .security.yml for better security.

max_tool_iterations: Cap on LLM+tool rounds per turn. If the model still wants tools when the cap is hit, PicoClaw makes one extra tool-less call with the history plus a user message asking for a final summary of what was done, and returns that reply (the request itself is not saved to the session). It closes the turn; it does not grant more iterations or guarantee the task finished. If that call fails or returns nothing, the canned "reached max_tool_iterations" message is returned instead.

max_tool_budget_warning_ratio: Share of max_tool_iterations after which the model gets one checkpoint notice (default 0.75; strictly between 0 and 1, otherwise the config is rejected; 0/unset means the default). On the iteration that reaches it (75 of 100), PicoClaw appends [SYSTEM NOTICE — iteration budget checkpoint] You have used 75 of 100 iterations. Checkpoint durable progress now, then continue the task; do not stop solely because of this warning. to the last tool result of that iteration. It is plain text, not a system or user message; tools stay available and the task continues. It is sent once per turn and re-armed on the next turn. The threshold is round(ratio × max_tool_iterations); when it falls on the last iteration (for example max_tool_iterations: 2) no notice is sent.

run_budget_seconds / run_budget_warning_threshold: wall-clock budget of one turn, separate from max_tool_iterations (default off; 0 or null disables it). Every new user message starts a fresh count; it is not a cumulative session limit. Once threshold × run_budget_seconds has elapsed (default 0.8; strictly between 0 and 1, otherwise the config is rejected), the next batch of tool results gets a plain-text wrap-up notice appended to its last result: SYSTEM NOTICE — Run time budget nearly exhausted. Stop new discovery/verification work now. Produce the required final answer from the state you already have, completing only mandatory writes. It is not a system or user message, rewrites no persisted message, and is sent once per turn. It is only a warning: nothing is interrupted or terminated when the budget runs out, tools stay available, and the process is not stopped, so an external deadline still has to be enforced by whoever sets it. The notice is checked when tool results are handled, so a long model call cannot receive it mid-flight; if the threshold passes while there is no tool result to carry it (for example, the model answers without tools), nothing is sent and it is retried at the next batch. While a budget is set, non-streaming model calls whose model entry has no explicit request_timeout are also capped at the budget still left, never below 60 s; explicit request_timeout values and streaming calls are never touched. Sub-turns are not budgeted.

max_parallel_tool_calls: Maximum number of tool calls from one model response that may run concurrently. 4 is the default; 0 or 1 = sequential. Only consecutive, compatible calls (read-only web tools and non-conflicting file operations) run together; see Parallel tool calls.

memory (agents.defaults.memory): bounds the persistent memory injected into the system prompt. memory_enabled (default true) injects memory/MEMORY.md (USER.md is injected either way) and registers the memory tool (add / replace / remove on MEMORY.md or USER.md). memory_char_limit (2200) and user_char_limit (1375) cap those files; a write past the cap is refused with success: false, the characters to free and the current entries, and nothing is truncated or dropped silently. daily_notes_enabled (true) injects the last recent_daily_notes_count (3) daily notes (memory/YYYYMM/YYYYMMDD.md), each capped at daily_notes_char_limit (1000). A file that is already over its cap (for example a hand-edited MEMORY.md) is never rewritten: the prompt gets the newest sections whole, older ones reduced to their headings, and a footer pointing to the full file. The prompt carries a snapshot frozen when the session starts, so memory written mid-session reaches the file at once but shows up from the next session (or after /clear), which keeps the provider prompt cache warm. While memory is enabled, write_file, edit_file and append_file refuse any write to MEMORY.md and USER.md (reading them is fine), so the limits cannot be bypassed: only the memory tool changes them. The exec tool is not covered. Limits count characters, not bytes; a non-positive limit means the default.

max_bootstrap_chars / max_bootstrap_total_chars (agents.defaults): cap the workspace bootstrap files injected into the system prompt (AGENT.md or legacy AGENTS.md, SOUL.md, and IDENTITY.md). Defaults are 20000 characters per file and 24000 characters for the rendered block as a whole, including headings. A file that exceeds its cap is cut on a UTF-8 boundary, and the prompt gets a short notice with the original size and a read_file hint for the full content. Files are read from disk with a 2 MiB hard limit regardless of these settings. USER.md is not part of the cached bootstrap block; it is injected through the memory block and is capped by memory.user_char_limit.

max_parallel_turns: Controls concurrent processing of messages from different sessions. 5 is the default; 0 or 1 = sequential; >1 = parallel. Messages from the same session are always serialized. See Steering docs for details.

steering_mode (agents.defaults, default "one-at-a-time", env PICOCLAW_AGENTS_DEFAULTS_STEERING_MODE): controls how many queued steering messages are injected between tool calls. "one-at-a-time" injects one steering message per inter-tool check; "all" drains the whole steering queue at once. See Steering for the full injection model.

auxiliary (agents.defaults.auxiliary): sends background LLM work to a dedicated model_list entry instead of the agent's own model. Each slot is a model_name; leave it empty to keep the agent's model. compaction is used when old history is summarized (so a cheap model can do it); vision handles turns with images and takes precedence over image_model, which keeps working on its own. The entry's own settings apply to the work routed to it: api_base, request_timeout, extra_body, custom_headers, rpm, thinking_level and max_tokens. A slot naming a model that is not in model_list, or the agent's own primary model, is ignored with a warning and the agent's model is used. Example: "auxiliary": {"compaction": "gpt-4o-mini", "vision": "gemini-flash"}.

split_on_marker (agents.defaults, default false, env PICOCLAW_AGENTS_DEFAULTS_SPLIT_ON_MARKER): when enabled, PicoClaw injects a system-prompt directive instructing the model to place <|[SPLIT]|> between distinct parts of its response. At runtime the assistant reply is split on that marker and delivered as multiple messages. This can improve readability on platforms that render long messages poorly, but it relies on the model following the instruction.

summarize_message_threshold (agents.defaults): Deprecated and ignored. This field is accepted in config for compatibility but has no effect. Summarization is driven by summarize_token_percent instead.

llm_retry_on_empty_content (agents.defaults, default true): when the model returns a successful response with no text content and no tool calls, PicoClaw retries the request using the same budget as transient provider errors (see max_llm_retries). Responses that include tool calls are never retried on this condition; an empty text body is intentional when the model is requesting tools.

llm_retry_on_finish_reasons (agents.defaults, default ["length"]): list of finish_reason values that cause an otherwise-successful response to be retried. The built-in entry "length" also covers "truncated", which some provider paths use for the same condition. Set to [] to disable finish-reason retries. Both fields share the same retry budget and backoff as transient provider errors.

max_llm_retries (agents.defaults, default 2, env PICOCLAW_AGENTS_DEFAULTS_MAX_LLM_RETRIES): number of additional attempts after the first LLM call fails with a transient error (rate limit, 5xx, timeout, network issue) or with a semantic condition covered by llm_retry_on_empty_content or llm_retry_on_finish_reasons. 0 disables retries.

llm_retry_backoff_secs (agents.defaults, default 2, env PICOCLAW_AGENTS_DEFAULTS_LLM_RETRY_BACKOFF_SECS): base wait in seconds between retry attempts. The actual wait before retry n (0-based) is (n + 1) × llm_retry_backoff_secs, so with the default of 2 the waits are 2 s, 4 s, …

Full config example
{
"agents": {
"defaults": {
"model_name": "claude-opus-4-5"
}
},
"session": {
"dm_scope": "per-channel-peer",
"backlog_limit": 20
},
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
// token: set in .security.yml
"allow_from": ["123456789"]
}
},
"tools": {
"web": {
"duckduckgo": {
"enabled": true,
"max_results": 5
}
}
},
"heartbeat": {
"enabled": true,
"interval": 30
}
}

Note: Sensitive fields (api_key, token, etc.) can be omitted and stored in .security.yml for better security.

Tool Loop Detection​

Loop detection is an optional guard against consecutive identical tool calls within one turn:

{
"agents": {
"defaults": {
"loop_detection": {
"enabled": true,
"repeat_threshold": 3,
"critical_threshold": 6,
"window_size": 20
}
}
}
}
FieldDefaultDescription
enabledfalseEnable loop detection. Disabled by default to preserve existing behavior.
repeat_threshold3Number of consecutive identical tool calls that triggers a turn-local warning message to the model.
critical_threshold6Number of consecutive identical tool calls that stops the loop and returns a final response. Must be greater than repeat_threshold; if not, the default is used.
window_size20Size of the per-turn call-hash ring buffer. Must be at least as large as critical_threshold.

Calls are compared using the tool name and complete arguments, so legitimate pagination and different paths or IDs remain distinct. spawn_status polling is excluded because the same request can return a new task status; it also resets any preceding repeat streak. The feature is disabled by default and complements, rather than replaces, max_tool_iterations.

Scheduled Tasks / Reminders​

PicoClaw supports cron-style scheduled tasks via the cron tool. The agent can set, list, and cancel reminders or recurring jobs that trigger at specified times.

{
"tools": {
"cron": {
"enabled": true,
"exec_timeout_minutes": 5,
"allow_command": true,
"command_allowed_remotes": []
}
}
}

Scheduled tasks persist across restarts and are stored in ~/.picoclaw/workspace/cron/.

Command cron jobs can execute shell commands. By default, remote channels cannot schedule command jobs. To allow specific remote channels, set command_allowed_remotes to entries such as "telegram" or "telegram:1234567890"; use "*" only if every non-empty channel should be allowed. The "*" wildcard is potentially dangerous because any remote channel that can talk to PicoClaw can schedule shell commands. This does not bypass allow_command, command_confirm, or exec safety checks. command_allowed_remotes is independent of tools.exec.allow_remote, which controls direct exec calls: remote cron command jobs do not require allow_remote, and PicoClaw re-checks the cron allowlist when a job fires.

Advanced Topics​

TopicDescription
Security ConfigurationStore API keys and secrets in separate .security.yml file
Sensitive Data FilteringDefense-in-depth redaction of exact configured secrets from tool results; not a DLP boundary
Hook SystemEvent-driven hooks: observers, interceptors, approval hooks
SteeringInject messages into a running agent loop between tool calls
SubTurnSubagent coordination, concurrency control, lifecycle
Context ManagementContext boundary detection, proactive budget check, compression
Tools ConfigurationTool-result artifact settings: max_inline_result_chars (default 16384), artifact_max_files (default 128), artifact_max_age_hours (default 24)