⚙️ 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.
| Variable | Description | Default Path |
|---|---|---|
PICOCLAW_CONFIG | Overrides the path to the configuration file. This directly tells picoclaw which config.json to load, ignoring all other locations. | ~/.picoclaw/config.json |
PICOCLAW_HOME | Overrides 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 bypower.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 ofgateway.hot_reload, on the shared Gateway HTTP server. It requires the Gateway auth token (Authorization: Bearer <token>) when one is configured and returns202 Acceptedas soon as the reload is scheduled. The reload itself runs asynchronously; watch thegateway.reload.started/gateway.reload.completed/gateway.reload.failedruntime events, or the logs, for the outcome.GET /reload/statusreports 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.mdandmemory/MEMORY.mdare 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": []
}
}
| Field | Default | Description |
|---|---|---|
enabled | false | Enables learning-record capture for completed agent turns. Heartbeat turns are ignored. |
mode | observe | observe 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_count | 2 | Minimum related task records required before a pattern is eligible for draft generation. |
min_success_ratio | 0.7 | Minimum success ratio for a task cluster. Use a value greater than 0 and up to 1. |
cold_path_trigger | after_turn | Runs 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 bymin_task_count) andmin_success_rate(replaced bymin_success_ratio) are still accepted inconfig.jsonfor 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:
| Mode | Meaning |
|---|---|
default | Keep PicoClaw's normal behavior for that block. Missing blocks and missing mode fields are treated as default. |
off | Disable that block for the turn. |
custom | Use 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:
| Block | What it controls |
|---|---|
history | Whether the turn reads prior session history and summary, writes user/assistant/tool messages, ingests context, and runs compaction or summarization. |
system_prompt | Whether PicoClaw injects its default identity, workspace instructions, memory, runtime context, and summary. External request system prompts are still allowed when this is off. |
skills | Whether the skill catalog and active skill prompt content are loaded. custom.allow keeps only the listed skill names in prompt context. |
tools | Which 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 byPICOCLAW_CONFIG). The launcher-specific file islauncher-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 inlauncher-config.json. - Legacy migration: Older
launcher_tokenvalues 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, andAuthorization: Bearerdashboard auth are no longer supported. - Sign-out: Use
POST /api/auth/logoutwithContent-Type: application/json(body may be{}). Do not rely on a GET URL for logout (CSRF-safe pattern). - Brute-force:
POST /api/auth/loginis 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:
~/.picoclaw/workspace/skills(workspace)~/.picoclaw/skills(global)<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 skillsshows the installed skill names available to the current agent./list mcpshows configured MCP servers with enabled/deferred/connected status./list pluginsshows 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 clearcancels 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,/useat 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.dimensionsfor the global default. - Use
session_dimensionson 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.
| Field | Default | Description |
|---|---|---|
enabled | false | Master switch. Nothing is deleted until this is true. |
max_age_days | 0 (disabled) | Delete sessions whose last activity is older than this many days. |
max_sessions | 0 (disabled) | Keep at most this many of the most recently active sessions. |
max_db_size_mb | 0 (disabled) | When the Seahorse SQLite database exceeds this size in MiB, prune the oldest sessions until it fits and then vacuum. |
check_interval_minutes | 0 (effective 60) | How often the background prune pass runs. Zero uses the default of 60 minutes. |
vacuum | true when omitted | Run 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:
channelaccountspacechattopicsendermentioned
Match values use the same scope vocabulary as the session system:
space:workspace:t001,guild:123456chat:direct:user123,group:-100123,channel:c123topic:topic:42sender: 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:
| Field | Default | Description |
|---|---|---|
escalation_prompt_tokens | 32768 | Switch 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_iterations | 3 | Switch 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.mdare 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:
| Field | Meaning |
|---|---|
id | Stable agent id |
name | Agent identity name from AGENT.md frontmatter |
description | Agent identity description from AGENT.md frontmatter |
Important behavior:
- The discovery section appears only when the current agent has the
spawntool and includes only peer agents it is permitted to spawn viasubagents.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, anddescription. config.jsonremains the infrastructure layer: workspace, default agent selection, routing, and subagent permissions. Those permissions also gate discovery visibility.AGENT.mdremains the identity layer. Runtime/tool code can still use itstools,skills,mcpServers, andmodelfields 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
}
}
}
| Option | Default | Description |
|---|---|---|
workspace | ~/.picoclaw/workspace | Working directory for the agent |
restrict_to_workspace | true | Restrict file/command access to workspace |
Protected Tools
When restrict_to_workspace: true, the following tools are sandboxed:
| Tool | Function | Restriction |
|---|---|---|
read_file | Read files | Only files within workspace |
write_file | Write files | Only files within workspace |
list_dir | List directories | Only directories within workspace |
search_files | Search file contents or filenames | Uses the same read-path restrictions; paginated, bounded results |
edit_file | Edit files | Only files within workspace |
append_file | Append to files | Only files within workspace |
exec | Execute commands | Command 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 Key | Type | Default | Description |
|---|---|---|---|
isolation.enabled | bool | false | Sandbox child processes: exec, CLI providers, process hooks, MCP stdio servers and plugins |
isolation.expose_paths | array | [] | Host paths exposed inside the sandbox as {source, target, mode}, where mode is ro or rw |
isolation.block_network | bool | false | Isolate 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_networkdefaults tofalse, so an isolated command can still reach127.0.0.1, scan the LAN and brute-force the host or other devices. Set it totrueunlessexec, MCP servers or CLI providers needcurl,wget,gitor 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 (Unixrmis risk-classified: plainrmismedium,rm -rishigh,rm -rfiscritical)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_HOMEorPICOCLAW_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_workspaceis enabled,~/$HOMEpath expansion, bare..incd/pushd/-Ctargets,cd/pushdchanges, dynamic redirection targets and nestedsh -c/exec/find -execscripts are validated against the workspace, including symlink escapes;env -C,eval,trap,file:URIs andHOME/PWD/OLDPWD/CDPATHassignments 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 Key | Type | Default | Description |
|---|---|---|---|
tools.allow_read_paths | string[] | [] | Additional paths allowed for read-only filesystem tools outside workspace; exec does not inherit them |
tools.allow_write_paths | string[] | [] | Additional paths allowed for writing outside workspace, including exec |
tools.search_files.enabled | bool | true | Enables regex content search and glob/substring filename search |
tools.message.media_enabled | bool | false | Allows 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 Key | Type | Default | Description |
|---|---|---|---|
tools.read_file.enabled | bool | true | Enables the read_file tool |
tools.read_file.mode | string | auto | Selects the read_file implementation: auto, bytes, or lines |
tools.read_file.max_read_file_size | int | 65536 | Maximum bytes returned by read_file |
tools.read_file.max_lines | int | 2000 | Upper bound on lines returned by a single line-mode read; larger max_lines requests are clamped |
tools.read_file.max_line_length | int | 2000 | Maximum 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_linesselect line mode for text filesoffset/lengthselect 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
offsetandlengthreads the defaultmax_read_file_sizerange - 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 pathoffset(optional): Starting byte offset, default0length(optional): Maximum number of bytes to read, defaultmax_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 pathstart_line(optional): Starting line number, 1-indexed and inclusive, default1max_lines(optional): Maximum number of lines to read, default = all remaining lines until EOF or byte budget; requests abovetools.read_file.max_linesare clamped
Behavior notes:
- Binary-looking files are rejected with guidance to switch
read_filetomode = bytesormode = auto - Extremely long single lines are cut after
tools.read_file.max_line_lengthcharacters 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 Key | Type | Default | Description |
|---|---|---|---|
tools.exec.allow_remote | bool | false | Allow exec tool from remote channels (Telegram/Discord etc.) |
tools.exec.enable_deny_patterns | bool | true | Enable built-in dangerous command interception (hardline and custom deny rules still apply when off) |
tools.exec.unknown_command_policy | string | "ask" | ask (default) requests user approval for commands the risk classifier cannot resolve, allow runs them, block rejects them |
tools.exec.approval_timeout_seconds | int | 300 | Seconds an unknown-command approval prompt waits before the command is denied |
tools.exec.custom_deny_patterns | string[] | [] | Custom regex patterns to block; always enforced |
tools.exec.custom_allow_patterns | string[] | [] | 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.EvalSymlinksbefore 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 Path | Security Boundary |
|---|---|
| Main Agent | restrict_to_workspace ✅ |
| Subagent / Spawn | Inherits same restriction ✅ |
| Heartbeat tasks | Inherits 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:
| Feature | Description |
|---|---|
| spawn | Creates async subagent, doesn't block heartbeat |
| Independent context | Subagent has its own context, no session history |
| message tool | Subagent communicates with user directly via message tool |
| Non-blocking | After 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
}
}
| Option | Default | Description |
|---|---|---|
enabled | true | Enable/disable heartbeat |
interval | 30 | Check interval in minutes (min: 5) |
Environment variables:
PICOCLAW_HEARTBEAT_ENABLED=falseto disablePICOCLAW_HEARTBEAT_INTERVAL=60to 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.
| Provider | Purpose | Get API Key |
|---|---|---|
gemini | LLM (Gemini direct) | aistudio.google.com |
zhipu | LLM (Zhipu direct) | bigmodel.cn |
volcengine | LLM (Volcengine direct) | volcengine.com |
openrouter | LLM (recommended, access to all models) | openrouter.ai |
anthropic | LLM (Claude direct) | console.anthropic.com |
openai | LLM (GPT direct) | platform.openai.com |
deepseek | LLM (DeepSeek direct) | platform.deepseek.com |
qwen | LLM (Qwen direct) | dashscope.console.aliyun.com |
groq | LLM + Voice transcription (Whisper) | console.groq.com |
cerebras | LLM (Cerebras direct) | cerebras.ai |
vivgrid | LLM (Vivgrid direct) | vivgrid.com |
Model Configuration (model_list)
What's New? PicoClaw now prefers explicit
provider+ nativemodelconfiguration (for example"provider": "zhipu", "model": "glm-4.7"). The legacy single-fieldprovider/modelform remains supported for compatibility whenprovideris 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
enabledfield to temporarily disable a model without removing its configuration
🔒 Security Configuration (Recommended)
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.ymlto.gitignore - Flexible deployment: Different environments can use different security files
Quick Setup:
- Create
~/.picoclaw/.security.ymlwith 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"
- Set proper permissions:
chmod 600 ~/.picoclaw/.security.yml
- 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.ymlare automatically mapped to config fields - No special syntax needed — just omit sensitive fields from config.json
- If a field exists in both files,
.security.ymlvalue takes precedence - You can mix direct values in config.json with security values
For complete documentation, see ../security/security_configuration.md.
All Supported Vendors
| Vendor | provider Value | Default API Base | Protocol | API Key |
|---|---|---|---|---|
| OpenAI | openai | https://api.openai.com/v1 | OpenAI | Get Key |
| Anthropic | anthropic | https://api.anthropic.com/v1 | Anthropic | Get Key |
| 智谱 AI (GLM) | zhipu | https://open.bigmodel.cn/api/paas/v4 | OpenAI | Get Key |
| DeepSeek | deepseek | https://api.deepseek.com/v1 | OpenAI | Get Key |
| Google Gemini | gemini | https://generativelanguage.googleapis.com/v1beta | Gemini | Get Key |
| Groq | groq | https://api.groq.com/openai/v1 | OpenAI | Get Key |
| Moonshot | moonshot | https://api.moonshot.cn/v1 | OpenAI | Get Key |
| 通义千问 (Qwen) | qwen | https://dashscope.aliyuncs.com/compatible-mode/v1 | OpenAI | Get Key |
| NVIDIA | nvidia | https://integrate.api.nvidia.com/v1 | OpenAI | Get Key |
| Ollama | ollama | http://localhost:11434/v1 | OpenAI | Local (no key needed) |
| LM Studio | lmstudio | http://localhost:1234/v1 | OpenAI | Optional (local default: no key) |
| OpenRouter | openrouter | https://openrouter.ai/api/v1 | OpenAI | Get Key |
| LiteLLM Proxy | litellm | http://localhost:4000/v1 | OpenAI | Your LiteLLM proxy key |
| VLLM | vllm | http://localhost:8000/v1 | OpenAI | Local |
| Cerebras | cerebras | https://api.cerebras.ai/v1 | OpenAI | Get Key |
| VolcEngine (Doubao) | volcengine | https://ark.cn-beijing.volces.com/api/v3 | OpenAI | Get Key |
| 神算云 | shengsuanyun | https://router.shengsuanyun.com/api/v1 | OpenAI | — |
| BytePlus | byteplus | https://ark.ap-southeast.bytepluses.com/api/v3 | OpenAI | Get Key |
| Vivgrid | vivgrid | https://api.vivgrid.com/v1 | OpenAI | Get Key |
| LongCat | longcat | https://api.longcat.chat/openai | OpenAI | Get Key |
| ModelScope (魔搭) | modelscope | https://api-inference.modelscope.cn/v1 | OpenAI | Get Token |
| Antigravity | antigravity | Google Cloud | Custom | OAuth only |
| GitHub Copilot | github-copilot | localhost:4321 | gRPC | — |
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_keysfields from your config and store them in.security.ymlinstead. See Security Configuration above for details.Note: The
enabledfield can be set tofalseto disable a model entry without removing it. When omitted, it defaults totrueduring migration for models that have API keys.
Resolution rules:
- Prefer explicit
"provider": "openai", "model": "gpt-5.4". - If
provideris set, PicoClaw sendsmodelunchanged. - If
provideris omitted, PicoClaw treats the first/segment inmodelas 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 sendsopenai/gpt-5.4to 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
}
}
}
}
}
| Field | Type | Default | Description |
|---|---|---|---|
channel_list.<name>.settings.streaming.enabled | bool | false | Allows this channel to display provider streaming output |
channel_list.<name>.settings.streaming.throttle_seconds | int | Pico default after enabling: 0 | Minimum interval for intermediate updates; final content is always flushed |
channel_list.<name>.settings.streaming.min_growth_chars | int | Pico default after enabling: 1 | Minimum character growth before sending an intermediate update; final content is always flushed |
model_list[].streaming.enabled | bool | false | Allows this model entry to try provider streaming requests |
Per-model sampling parameters: each
model_listentry also acceptsmax_tokens,temperature, andcontext_window, which override the matchingagents.defaultsvalues 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_keyfields and store them in.security.ymlfor 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 anthropicto 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-messageswhen the endpoint requires Anthropic's native/v1/messagesformat 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/*:generateContentandmodels/*:streamGenerateContentendpoints. - 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
providersformat is deprecated. Use the newmodel_listformat with.security.ymlfor 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 ausermessage 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 "reachedmax_tool_iterations" message is returned instead.
max_tool_budget_warning_ratio: Share ofmax_tool_iterationsafter which the model gets one checkpoint notice (default0.75; strictly between0and1, 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 asystemorusermessage; tools stay available and the task continues. It is sent once per turn and re-armed on the next turn. The threshold isround(ratio × max_tool_iterations); when it falls on the last iteration (for examplemax_tool_iterations: 2) no notice is sent.
run_budget_seconds/run_budget_warning_threshold: wall-clock budget of one turn, separate frommax_tool_iterations(default off;0ornulldisables it). Every new user message starts a fresh count; it is not a cumulative session limit. Oncethreshold × run_budget_secondshas elapsed (default0.8; strictly between0and1, 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 asystemorusermessage, 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 explicitrequest_timeoutare also capped at the budget still left, never below 60 s; explicitrequest_timeoutvalues 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.4is the default;0or1= 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(defaulttrue) injectsmemory/MEMORY.md(USER.mdis injected either way) and registers thememorytool (add/replace/removeonMEMORY.mdorUSER.md).memory_char_limit(2200) anduser_char_limit(1375) cap those files; a write past the cap is refused withsuccess: false, the characters to free and the current entries, and nothing is truncated or dropped silently.daily_notes_enabled(true) injects the lastrecent_daily_notes_count(3) daily notes (memory/YYYYMM/YYYYMMDD.md), each capped atdaily_notes_char_limit(1000). A file that is already over its cap (for example a hand-editedMEMORY.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_fileandappend_filerefuse any write toMEMORY.mdandUSER.md(reading them is fine), so the limits cannot be bypassed: only thememorytool changes them. Theexectool 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.mdor legacyAGENTS.md,SOUL.md, andIDENTITY.md). Defaults are20000characters per file and24000characters 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 aread_filehint for the full content. Files are read from disk with a 2 MiB hard limit regardless of these settings.USER.mdis not part of the cached bootstrap block; it is injected through the memory block and is capped bymemory.user_char_limit.
max_parallel_turns: Controls concurrent processing of messages from different sessions.5is the default;0or1= 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", envPICOCLAW_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 dedicatedmodel_listentry instead of the agent's own model. Each slot is amodel_name; leave it empty to keep the agent's model.compactionis used when old history is summarized (so a cheap model can do it);visionhandles turns with images and takes precedence overimage_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_levelandmax_tokens. A slot naming a model that is not inmodel_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, defaultfalse, envPICOCLAW_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 bysummarize_token_percentinstead.
llm_retry_on_empty_content(agents.defaults, defaulttrue): 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 (seemax_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 offinish_reasonvalues 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, default2, envPICOCLAW_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 byllm_retry_on_empty_contentorllm_retry_on_finish_reasons.0disables retries.
llm_retry_backoff_secs(agents.defaults, default2, envPICOCLAW_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 of2the 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.ymlfor 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
}
}
}
}
| Field | Default | Description |
|---|---|---|
enabled | false | Enable loop detection. Disabled by default to preserve existing behavior. |
repeat_threshold | 3 | Number of consecutive identical tool calls that triggers a turn-local warning message to the model. |
critical_threshold | 6 | Number 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_size | 20 | Size 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
| Topic | Description |
|---|---|
| Security Configuration | Store API keys and secrets in separate .security.yml file |
| Sensitive Data Filtering | Defense-in-depth redaction of exact configured secrets from tool results; not a DLP boundary |
| Hook System | Event-driven hooks: observers, interceptors, approval hooks |
| Steering | Inject messages into a running agent loop between tool calls |
| SubTurn | Subagent coordination, concurrency control, lifecycle |
| Context Management | Context boundary detection, proactive budget check, compression |
| Tools Configuration | Tool-result artifact settings: max_inline_result_chars (default 16384), artifact_max_files (default 128), artifact_max_age_hours (default 24) |