PasClaw is an ultra-lightweight personal AI agent written in Delphi Object Pascal. It is a Delphi/FPC port inspired by picoclaw, with a command-line assistant, tool calling, MCP integration, an HTTP gateway, an OpenAI-compatible API surface, a small embedded web UI, scheduled tasks, skills, and channel integrations.
The main program lives at src/pasclaw/PasClaw.dpr. It initializes terminal color handling, prints the banner, applies timezone configuration, and dispatches into the command tree implemented under src/cmd/.
Docker — the fastest way to try PasClaw without building anything locally:
docker pull fmxexpress/pasclaw
# HTTP gateway + web UI on http://localhost:8088 -- onboard right in the browser.
# The image's default command already runs the gateway, so no arguments needed.
docker run -p 8088:8088 fmxexpress/pasclaw
# Interactive CLI agent (run `pasclaw onboard` inside, or set a provider key)
docker run -it fmxexpress/pasclaw agentThe image's entrypoint runs pasclaw for you, so pass only the subcommand (agent, serve, …) — or nothing, which starts the gateway. The gateway's web UI has a first-boot onboarding wizard, so you pick a provider and paste a key in the browser — nothing on the command line. To keep config + workspace across runs, add -v "$HOME/.pasclaw:/home/pasclaw/.pasclaw" (the container's PASCLAW_HOME, owned by its pasclaw user). See docker/README.md for more. (This runs PasClaw itself in a container — distinct from the optional Docker shell-backend, which runs the model's shell_exec calls inside a throwaway container for a stronger sandbox.)
Native binary — build the single ~4–5 MB binary (no runtime deps beyond libsqlite3 and OpenSSL):
make get-indy get-taurustls && make # FPC -> build/pasclaw
pasclaw onboard # pick a provider, paste a key, choose options
pasclaw agent # start chattingSee Build for Delphi / cross-compile / Windows-on-ARM.
The web UI that pasclaw serve / pasclaw gateway serves on the same port as the API. It follows the OS theme until you pick one.
| Light theme | Context breakdown |
|---|---|
![]() |
![]() |
| Workflow editor | Phone width |
![]() |
![]() |
More, and how they are made, in docs/screenshots; every web UI tab, redesigned (Chat, Stats, MCP, Cron, Files, Relay, Memory, KB, Skills, Vault, Logs, Checkpoints, Workflow), in dark, light and phone width in screenshots. The web UI's content is fixture data written by the capture script, not a real session.
MS-DOS: PCLAW.EXE (docs/dos.md) |
Windows XP: the full pasclaw.exe (docs/windows-xp.md) |
|---|---|
![]() |
![]() |
Both are real runs. On DOS (DOSBox-X), the request went down COM1 to pasclaw bridge, then through a gateway to Gemini (gemini-3.5-flash); the model's read_file ran on the DOS drive. On Windows XP SP2 (VirtualXP), the exe is the make xp build. That emulator has no network, so the XP shot shows a local command, not an agent turn.
LLM providers — ~26-entry catalog covering Anthropic Messages, OpenAI Chat Completions, Google Gemini generateContent, plus OpenAI-protocol-compatible providers (Groq, DeepSeek, Mistral, Cerebras, OpenRouter, Zhipu, Qwen, Moonshot, MiniMax, NVIDIA NIM, Novita, MiMo, VolcEngine, xAI/Grok, Perplexity, Ollama, LM Studio, vLLM, LiteLLM) and three Cloudflare AI Gateway fronts (cloudflare, cloudflare-anthropic, cloudflare-gemini). The full list lives in src/pkg/providers/PasClaw.Providers.Catalog.pas; adding a provider is a one-record append. Streaming SSE on all three protocol families; native search grounding on Gemini; citation collation on Perplexity. Code-driven SetProvider('anthropic', $ANTHROPIC_API_KEY) for embedders so no ~/.pasclaw/config.json is required.
Fallback chain + per-model fallback — "fallbacks": ["openai", "gemini"] walks the list when the primary returns 429 / 5xx / network error. "fallback_models": ["gpt-4o", "gemini-2.0-flash"] (parallel by index) pins a model per fallback — including the same provider with a cheaper model, so "Opus rate-limited → Sonnet on one key" works (per-model rate/capacity limits are real on both the subscription and the API).
Auto-router (opt-in) — classifies each turn's difficulty with a deterministic, offline, no-model-call structural score (estimated tokens, code fences, lists, headings + keyword/tool signals; Wayfinder-shaped) and routes easy turns to a cheaper easy_provider / easy_model (which can be a smaller model on your existing provider), keeping the primary on the fallback chain so a routing-fooled turn drops back cleanly. Weights + threshold are tunable under auto_router.weights; Plan-mode turns always stay on the primary. Off until you configure an easy tier (pasclaw onboard offers it).
Built-in tools — exposed to the model on every turn:
| Tool | What it does |
|---|---|
read_file / write_file / append_file / list_dir |
sandboxed filesystem access (append_file builds large files incrementally) |
grep_files |
recursive substring search, returns line-numbered matches |
code_outline |
a map of the code, made on demand: symbol= finds where a name is declared (not every use), a file gives its declarations with line numbers, a directory each file's purpose and names. Pascal, Python, JS/TS (and .html scripts), Go, Rust, Ruby, PHP — measured in bench/codenav |
edit_file |
old_text→new_text string replacement (default); optional hashline patch mode for line-anchored, hash-verified edits |
apply_patch |
multi-file, context-anchored patch (Codex/OpenClaw format: add/update/delete/move in one atomic call) |
shell_exec |
/bin/sh -c (or cmd.exe), output capped at 1 MiB, denylist-gated |
web_search |
DuckDuckGo / Brave / Tavily / SearXNG / Perplexity / Gemini-grounding — 6 providers |
web_fetch |
HTTP GET → readable plain text (HTML stripped, entities decoded), SSRF-guarded |
memory_search |
SQLite FTS5 BM25 over workspace/memory/*.md and MEMORY.md (including fetched-*.md written by memory_fetch). When vector_search_enabled is on (default yes), the hybrid backend in src/pkg/memory/PasClaw.Memory.Vector.pas runs a local sentence-transformer embedder (MiniLM by default — embeddings never leave the host) over the same notes, fuses keyword + vector ranks via Reciprocal Rank Fusion, and falls back to FTS-only silently when the runtime artifacts (sqlite-vec extension, ONNX Runtime, model weights) aren't yet provisioned under $PASCLAW_HOME/cache/localvector/. |
session_search |
SQLite FTS5 BM25 over the full text of every saved session under workspace/sessions/. Searches PAST conversations, not just the current one — returns session id + title + snippet + score with a pasclaw resume <id> hint. Index at workspace/sessions/.search.db, lazily rebuilt (reindexes a session only when its UpdatedAt advances). Gateway stat buckets excluded. |
vault_search / vault_get |
search + read pasclaw.dev Code Vault entries (Object Pascal samples + components); opt-in via vault_tools_enabled |
send_message |
post a message to a named, operator-configured channel mid-task (progress updates, alerts) — Discord / Slack / Teams / generic webhook / LINE / WhatsApp, same senders pasclaw post uses. Registers only when config.json declares "channels": [{"name","kind","target"}]; the model addresses channels strictly by name, so it can only reach endpoints the operator pre-declared (no model-supplied URLs) |
execute_code |
run a code snippet (Python / JS / Bash / …) through the active shell backend; can call back into PasClaw tools via the __tool RPC channel |
memory_fetch |
fetch a URL and write it to workspace/memory/ for later recall (body never enters context); gated on web_fetch_enabled |
kb_search / kb_get |
FTS5 + optional local-vector search over your registered knowledgebase sources (text / markdown / code / PDF) |
tool_search |
progressive disclosure: load schemas for deferred MCP tools on demand (keeps the prompt small when you have 50+ MCP tools); on by default |
tool_output_get |
retrieve full output stashed when a large tool result was truncated/condensed (gated on tool_output_cap or condense_reversible) |
cron |
model-scheduled background jobs (opt-in via cron_tool_enabled) |
delphi_build |
self-registers only when RAD Studio is found on the host |
spawn / spawn_background / spawn_status / spawn_wait / spawn_cancel |
fan out to specialist subagents (sync + background) — see Subagents below |
advisor |
ask a second model for a second opinion mid-task; listed only while an advisor model is set — see Advisor below |
skill_<name> |
Pascal-side tools registered from kind: shell / kind: prompt skills |
skills_list / skills_view / skill_manage |
self-improving skills (progressive disclosure + model-authored skills; opt-in) |
| MCP-bridged | every tool a configured MCP server exports — see below |
Parallel dispatch — when the model returns multiple tool_use blocks in one turn, read-only tools (web_search, web_fetch, read_file/grep_files/list_dir, memory_search) fan out on worker threads; mutating tools (write_file, append_file, edit_file, shell_exec) stay serial. ~50% wall-clock win on multi-network-tool turns. (The former fs_read/fs_write/fs_list/fs_grep/fs_edit_hashline names remain as hidden back-compat aliases.)
MCP — both transports. Stdio MCP via spawned subprocess + JSON-RPC over pipes, and Streamable HTTP MCP (handles SSE-framed responses, Bearer-token auth). The client speaks MCP 2026-07-28 (server/discover, per-request _meta, no sessions) and falls back to the initialize handshake for older servers; it answers servers that ask the user for input (elicitation: forms and URLs, at the keyboard in the REPL, declined with a note to the model elsewhere) and follows long-running tool calls that become tasks. pasclaw mcp auth checks the authorization response's issuer and supports Client ID Metadata Documents (mcp_oauth_client_metadata_url). pasclaw mcp catalog queries the pasclaw.dev MCP registry (GET /api/public/v1/mcp) with a 5 s timeout and falls back to the bundled 5-entry list (replicate, digitalocean-apps, digitalocean-databases, runpod-docs, huggingface) when the hub is unreachable — source attribution (hub / built-in) shown in the output. pasclaw mcp search <q> searches the hub directly (no fallback — bundled list is too small to search). pasclaw mcp install <slug> tries the hub first so any registered server is installable, falls back to the bundled catalog when the hub doesn't have it. Reads the right env var, writes the right Authorization header, never preloaded. Progressive disclosure (on by default, mcp_progressive_disclosure) keeps fat catalogs cheap: MCP tools register deferred (name-only in the prompt), and the model loads schemas on demand via tool_search — a one-turn cost only on turns that actually touch MCP, instead of paying for every schema every turn. PasClaw is also an MCP server (POST /mcp), exposing memory_search / kb_search / session_search to other MCP clients (Claude Desktop, Cursor, Codex).
Editors (ACP) — pasclaw acp runs PasClaw as an Agent Client Protocol agent over stdio, so Zed, JetBrains IDEs and other ACP clients can drive it in their own agent panel. It uses the same loop, tools, permissions rules, sessions and modes. Tool calls arrive with their diffs, todo_write becomes the editor's plan, an ask rule becomes the editor's permission prompt, and the stop button cancels at the next safe point. See docs/acp.md.
Decision models — Gemini Decision 1, TypeSafe's Jev and the self-hosted OpenJev answer typed questions (yes/no, one of N, a scale) with a probability for each answer instead of text. PasClaw speaks both wire formats (google, systemone) and can put one at a decision point — today /v1/rerank — but only after pasclaw decision-model bench records a run in which it beat the exact reranker that point uses now; a newer losing run takes it out again. A 60-question labeled set over PasClaw's own docs ships in bench/decision-models/. See docs/decision-models.md.
Advisor — a second model the agent can consult mid-task. Set "advisor": {"provider": "...", "model": "..."} (or --advisor [provider:]model on agent, tui, gateway, serve; /advisor in the REPL and TUI) and the agent gets an advisor tool: the advisor is sent a condensed transcript of the conversation and the agent's question, with no tools, and its answer comes back as the tool result. Read-only (plan mode, parallel batches), at most max_calls_per_turn (3) calls a turn, inherited by subagents, its tokens counted under its own model in /v1/stats. See docs/advisor.md.
Skills — markdown manifests under $PASCLAW_HOME/workspace/skills/ advertised in the system prompt; the model loads the body via read_file on demand. Install from GitHub (pasclaw skills install owner/repo[/path][@ref] — codeload zip, FPC's Zipper.TUnZipper or Delphi's System.Zip.TZipFile); from the pasclaw.dev hub (pasclaw skills install hub:<slug>[@<version>], or just pasclaw skills install <slug> which tries pasclaw.dev first then falls back to ClawHub); or from ClawHub directly (pasclaw skills install clawhub:<slug>[@<version>]). pasclaw skills search <q> queries both hubs and aggregates the results (pasclaw.dev first, ClawHub deduped). Malware-flagged skills refused; suspicious-flagged install with a warning.
Code Vault — the pasclaw.dev Code Vault hosts Object Pascal source code (sample programs, reusable components, libraries) as GitHub-backed entries. pasclaw vault search <q> and pasclaw vault show <slug> discover; pasclaw vault install <slug> [<dest>] git clones the entry's repoUrl into $PASCLAW_HOME/workspace/vault/<slug> (or a path you pass). The agent gets two opt-in tools — vault_search and vault_get — registered only when vault_tools_enabled: true in config.json; pasclaw onboard asks during setup with a default-yes prompt. Both tools are read-only HTTP GETs against the vault registry; obtaining the code itself is a separate shell_exec git clone call the model makes after vault_get returns the repoUrl.
HTTP gateway — pasclaw gateway and pasclaw serve. OpenAI-compatible /v1/chat/completions (streaming + non-streaming) and /v1/responses (tool-passthrough so Codex CLI can drive its own tools). Embedded web UI (vanilla ES2020, single HTML file, no JS toolchain) with tabs including Chat (SSE-streamed, tool activity surfaced inline), Background (running and finished background jobs), Memory, Files, MCP, Cron, Skills, Logs (live tail via SSE from the in-process ring buffer), Settings. Read-only inspection endpoints (/v1/mcp, /v1/cron, /v1/skills, /v1/memory, /v1/fs, /v1/config, /v1/logs) backed by the gateway's sandbox + secret-masking.
Desktop — a desktop-paradigm client where the agent's deliverable is software, not text: ask it to filter your email and it builds a small app that opens in a window. Two frontends over one surface — a single-file web UI the gateway serves at /desktop (window manager, project dock, taskbar with a workspace pager, the web UI's own look in dark and light by default, and all 27 retro styles) and a FireMonkey app in desktop/ built on Cross-Platform-Retro-OS-Styles, whose window manager and styles are vendored so the project builds and runs from a plain checkout. Adds Workspaces (multiple isolated agent worlds; the original workspace/ is #1), Projects → Tasks → Jobs as plain JSON manifests the agent edits through project / task tools, an app factory (page / html / python / fpc / delphi kinds, per-app state store, sandbox + CSP containment, blueprint export that carries the software but never the data), and answer pages — search rendered as an HTML document whose sources strip PasClaw writes itself. Process apps (python/fpc/delphi) are built and spawned by a runner that refuses to start anything without explicit per-run consent and shows the command first. /v1/desktop/events pushes board changes over SSE. Structured agent output renders as period furniture — a plan arrives as a Win95-style wizard whose Finish button turns its steps into real tasks, a decision as a message box with buttons — and each style carries its own voice. pasclaw project seed installs a starter suite (Notes, To Do, Brain, Calendar, Library, Cookbook, Mail) that are themselves ordinary, remakeable projects. See docs/desktop.md.
Chrome extension — chrome-extension/ puts PasClaw in Chrome's side panel. It streams chat over the gateway with tool cards and attaches the page you are reading (or a selection, via right-click). Each chat is a server-held session you can pasclaw resume, and the full web UI runs in a second tab. Load it unpacked from chrome://extensions; there is no build step.
Chat channels — bidirectional (inbound message → agent loop → outbound reply): Telegram (long-poll bot), Discord (bot polling), LINE (webhook), WhatsApp (Cloud API webhook), Slack (Events API webhook + Incoming Webhook reply), Matrix (REST /sync long-poll, federated, self-hostable), IRC (TIdIRC), Email (SMTP send + IMAP poll, --email flag, env-var configured). Outbound-only: Microsoft Teams (Incoming Webhook), generic Webhook sink.
Cron — pasclaw cron add daily-summary "0 9 * * *" summarize "workspace/memory". Last-fired timestamp persisted to workspace/cron/state.json so a missed slot (gateway down, laptop closed) catches up on the next tick instead of being silently skipped. At-least-once delivery — the state file is written after the skill runs, so a crash in the window between the skill's side effects and the timestamp persist will replay the job on restart; idempotent skills are safe, side-effecting skills should self-deduplicate. Per-entry channel sink (--channel <kind>:<target>) posts skill output; output also appended to workspace/memory/<today>.md for the model to recall later.
Memory — SQLite FTS5 BM25 index over workspace/memory/*.md and MEMORY.md. pasclaw migrate (re-)indexes; pasclaw membench --records N benchmarks. Conversation history compaction (pasclaw compaction.threshold_tokens) kicks in mid-loop, summarises the older portion via the same provider, folds the summary into the system prompt, falls back to verbatim on summariser failure (no silent context loss). memory_fetch(url, name?) (registered when web_fetch_enabled: true) fetches a URL and writes it to workspace/memory/fetched-<sanitised>.md with a 4-line provenance header — the body never enters context; the next memory_search indexes it via SyncDir. Auto-dedup: a second memory_fetch against the same URL within 24h short-circuits the HTTP and returns "already indexed (cached Nh ago)" — the existing cached file's source: and fetched_at: header lines are matched against the request before any network round-trip. Inspired by chopratejas/headroom's cross-agent memory dedup.
Working-state snapshot — each session's meta.working_state records the last 8 file paths edited via write_file/append_file/edit_file, the most recent shell_exec command, and the most recent tool-call error. Persisted under the session JSON's meta.working_state object; rebuilt after every successful tool loop and re-injected as a system-prompt prefix on the next turn. Survives /quit-and-resume, compaction, and pasclaw agent --session <id> so the agent picks up with structured edit/shell/error context even when the conversation transcript no longer carries it.
Sandbox + safety — read/write path allowlists, shell-command denylist (separate restrict_to_workspace denylist + shell_deny_enabled global), SSRF guard on web_fetch (IPv4 blocklist incl. 169.254.169.254, redirect re-check), hashline patches require matching file-hash header (stale patches abort without writing). TLS required for HTTPS provider/MCP calls (Linux: the system's OpenSSL 3/4 through TaurusTLS, a bundled OpenSSL 1.0.2, or libcurl, with certificate checks on the first and last; elsewhere Indy's OpenSSL 1.0.2 handler).
Embedding — TPasClawAgent and TPasClawServer as TComponents in PasClaw.Agent:
uses PasClaw.Agent, PasClaw.Tools;
Agent := TPasClawAgent.Create('claude-opus-4-7');
Agent.SetProvider('anthropic', GetEnvironmentVariable('ANTHROPIC_API_KEY'));
Agent.RegisterTool(TWebSearchTool.Create);
Agent.RegisterTool(TFileSystemTool.Create);
WriteLn(Agent.Run('Summarize the latest Delphi release notes.'));
Agent.Free;Form-designable with published properties for the VCL/FMX path; code-driven OOP API for everything else. Custom tools subclass TPasClawTool and override Name / Description / Schema / Run / Category. Single-process server: TPasClawServer.Create('0.0.0.0', 8088); Server.Run; blocks until Stop is signalled from another thread.
Interactive chat — pasclaw agent and pasclaw tui ship slash commands: /help lists them; /status shows model + provider + message count + thinking state; /new starts a fresh session (new id, history cleared); /reset clears history in the current session; /compact forces a summariser pass; /think toggles extended-thinking mode for the next turn (Anthropic Claude); /tools lists registered tools; /quit exits.
Persistent sessions — pasclaw agent serialises conversation history to $PASCLAW_HOME/workspace/sessions/<id>.json after every turn (messages + tool_calls + tool_results + model + provider + compaction summary). Persistence is on by default — every interactive pasclaw agent run auto-allocates a fresh id and the conversation survives Ctrl-C / crash without any flag. Resume with pasclaw resume <id> or pasclaw agent --session <id>; an id that doesn't yet exist starts a fresh session at that id (handy for scripts pre-seeding e.g. daily-2026-06-01). pasclaw session list / show / delete / export manages saved sessions. Session ids are yyyymmddTHHMMSS-<8 hex> — sortable and collision-safe. On the Delphi build of pasclaw tui the same persistence is wired through a positioned two-pane TUI (session list on the left, chat on the right) — see Chat and UI below. The FPC build of tui keeps history in-memory.
Prompt caching — on by default for Anthropic and OpenAI. The Anthropic request builder emits cache_control: { type: "ephemeral" } on the system prompt and the trailing tools-array entry (uses 2 of the 4-breakpoint budget; caches the largest stable prefix on every turn), with optional ttl: "1h" extended-TTL hint. OpenAI gets prompt_cache_key anchored to the persistent session id so each conversation routes to its own cache bucket. Cache hit / write tokens roll up in /status (cache: on, N read / M written (X% hit on input so far)) and surface inline in the per-turn [tokens in=… out=… cache_r=… cache_w=…] summary. Disable via prompt_cache.enabled: false in config.json; extend the TTL via prompt_cache.ttl: "1h". Gemini caching not yet wired — implicit caching applies automatically on supported models.
Sender identity — every channel tags inbound messages with a canonical <platform>:<id> (e.g. slack:U12345, telegram:5551234, matrix:@eli:matrix.org, email:[email protected], irc:eli, discord:9876543210, cli:$USER). Identity rides on TToolLoopConfig.Identity from the channel boundary down through hooks and audit logs, so embedder hooks can gate behaviour per-sender. Configure an allowlist in config.json:
"allow_senders": ["slack:U-eli", "telegram:*", "cli:*"]Patterns are exact ids or <platform>:* wildcards; * allows anyone (escape hatch). Empty array (default) = no gate. Each channel calls IsAllowedSender before invoking the agent — non-matching senders are dropped at the boundary with a log line, the model never sees them. Ports picoclaw's pkg/identity pattern.
Mid-loop steering — push a follow-up into a running agent without waiting for the current tool loop to finish. From another terminal:
pasclaw steer 20260601T093015-1a2b3c4d "actually skip X, focus on Y"
pasclaw steer <session-id> --list # show pending count
pasclaw steer <session-id> --clear # drop the queueThe running pasclaw agent --session <id> drains the queue at the top of its NEXT tool-loop iteration and folds each pending message into history as a [user steering] ... system note before the next LLM round-trip. Up to 4 messages per iteration are applied (MaxSteeringPerTurn, matching nanobot's _MAX_INJECTIONS_PER_TURN); extras are dropped with a warning so a runaway pusher can't grow history unbounded. /steer <msg> inside an interactive session is the same mechanism (handy for testing). /reset, /new, and pasclaw session delete clear the queue. Storage is one append-only JSONL file per session under $PASCLAW_HOME/workspace/steering/<id>.jsonl — atomic per-line POSIX appends + rename-to-tmp-on-drain so concurrent push/drain doesn't lose messages. Currently only CLI sessions wire SteeringKey; channels can opt in by passing their own per-conversation key on TToolLoopConfig.SteeringKey once they restructure to non-blocking poll loops.
Hooks + steering — TPasClawHook (in PasClaw.Agent.Hooks) is the typed callback surface for embedders to observe, transform, or veto agent events. Four virtuals: BeforeTurn(var ContinueTurn, var Messages) — set ContinueTurn := False to abort cleanly; BeforeToolCall(call, var Cancel, var SyntheticResult) — Cancel := True bypasses the real tool handler and uses SyntheticResult as the tool_result (the approval-gate pattern); AfterToolResult(call, var ResultText, var ErrMsg, var SteeringMessage) — rewrite results inline AND inject a system note before the next LLM round (picoclaw's steering); OnError(Stage, Msg) — observe failures. Register via Agent.RegisterHook(THook.Create); multiple hooks form an ordered chain in registration order.
Subagents — fan-out to focused specialists via a spawn(agent, prompt) tool. Declare them in config.json's subagents: array (name + description + system prompt + tool allowlist + optional model / max-iterations override). Each spawn runs a short RunToolLoop against the parent's provider + fallback chain with a registry filtered to the named tools and a specialist system prompt; result lands back as the parent's tool_result. Implementation in src/pkg/agent/PasClaw.Agent.Subagent.pas — picoclaw's SubTurn pattern, nanobot's subagent module, openclaw's multi-agent routing, ~300 LOC.
"subagents": [
{ "name": "researcher",
"description": "Web search + summary specialist",
"system_prompt": "You search the web and produce a 3-bullet summary...",
"tools": ["web_search", "web_fetch"],
"max_iterations": 4 },
{ "name": "coder",
"description": "Code editor",
"system_prompt": "You edit code precisely using hashline patches...",
"tools": ["read_file", "write_file", "grep_files", "edit_file"] }
]A spawn can also run in the background (spawn_background → handle; spawn_status / spawn_wait / spawn_cancel), so the parent keeps working while a slow research/analysis task runs; completion is pushed into the next loop iteration as a system note (PasClaw.Agent.SubagentBg, cap 4 concurrent).
Background work view — the web UI's Background tab lists every chat's background jobs (subagents from spawn_background, commands from shell_background) under Running and Finished, with a running count on the tab. Open one to read the subagent's transcript, drawn like the chat with its tool cards, or the command's output; Stop cancels a running job, and a finished subagent takes a follow-up message that continues its conversation as a new, linked job. Served by GET /v1/background, GET /v1/background/<handle>, POST …/cancel and POST …/message (token-gated; the last 50 finished jobs are kept). /tasks in pasclaw agent and the TUI lists the same jobs. See docs/gateway.md.
Knowledgebase (RAG) — pasclaw kb add <path> registers a file or directory; the index (SQLite FTS5 + the same optional local-vector backend memory uses) is built in place and incrementally re-synced on mtime change. Native PDF text extraction (FlateDecode + /ToUnicode, no OCR). The model reaches it via kb_search / kb_get; pasclaw kb search/get/status and the web UI KB tab mirror it. See Knowledgebase.
Distilled memory + durable facts — opt-in (memory_distill_enabled): after a qualifying turn a small background pass extracts durable facts from the exchange and stores them in a semantic fact store (exact + paraphrase dedup via local embeddings), budget-capped into the system prompt so the agent carries forward what matters without re-reading transcripts. Manage via /v1/memory/facts* and the web UI. Inspired by cross-agent memory-dedup work.
Self-improving skills — opt-in: a post-turn distiller (self_improving_skills.distiller) can mine a non-trivial tool trace into a draft SKILL.md, staged under workspace/skills/.pending/ for pasclaw skills approve/reject (or auto-committed). skill_manage lets the model author skills directly; skills_list / skills_view add progressive disclosure so skill bodies load on demand. A denylist guards model-authored shell skills. pasclaw learn mines past sessions for recurring tool failures and proposes skill candidates.
Checkpoints + undo — opt-in (checkpoints_enabled): every turn snapshots the pre-edit bytes of files the model touches under workspace/checkpoints/<session>/ (zpaq-compressed on the FPC build). /undo in the TUI and /v1/checkpoints/undo|redo rewind/replay edits turn-by-turn; checkpoints_keep_last auto-prunes.
Profiles — named config layers (pasclaw profile list/show/use/diff/bench). Built-ins baseline | low-token | security | max-build | all-on plus user JSON under $PASCLAW_HOME/profiles/ with _inherits composition. Precedence: --profile > $PASCLAW_PROFILE > config.json's profile > none. profile bench A/B-runs a task across profiles and prints a turn/token/tool-call table.
Plan / Build mode — --mode plan (or pasclaw plan) is a read-only lens: read_file / grep_files / memory / kb / session work, but write_file / edit_file / shell_exec / execute_code are blocked, and a plan_write tool drafts workspace/PLAN.md. --mode build (default) is full access. The auto-router never downgrades Plan-mode turns. pasclaw build / pasclaw plan add a workspace.zip in/out handshake for CI / cloud (Replicate, k8s) runs.
Heartbeat — pasclaw heartbeat is a proactive daemon: on an interval it feeds workspace/heartbeat.md to the model, runs a loop, and posts the result to a named channel (or logs it) — agendas, monitors, periodic digests without an inbound trigger.
Relay / bring-your-own-compute — the relay provider + /v1/relay/* endpoints invert the usual flow: external workers (a browser WebGPU tab, a phone with llama.cpp, a desktop with mlc-llm) connect inbound over SSE, advertise the models they serve, pull inference jobs off the gateway's queue, run them on their own hardware, and POST results back. pasclaw relay is the CLI worker. The web UI's Relay tab shows the queue and the connected workers, hands out ready-to-paste worker snippets, and can run a WebGPU worker in the browser tab itself.
Observability — OpenTelemetry traces (diagnostics.otel.* or OTEL_EXPORTER_OTLP_ENDPOINT): per-turn / per-tool / per-provider spans over OTLP HTTP-JSON with W3C trace-context propagation and Bernoulli sampling. Stream-reliability knobs (stream_reliability.*) cover empty-turn retry, idle-stream timeout, and tool-call repair. Token / cache / tool-byte stats roll up in /status, the TUI /stats overlay, and /v1/stats.
Onboarding + scaffolding — pasclaw onboard is an interactive wizard (provider + key, default model, and the zero-prompt-cost behavioural toggles). pasclaw init / pasclaw runbook bootstrap an AGENTS.md (one-shot vs. tool-driven repo probe); pasclaw export renders memory/skills/sandbox into AGENTS.md / CLAUDE.md / Cursor / Gemini / Zed formats.
Cross-platform — Linux x86_64 + aarch64 under FPC 3.2+; macOS x86_64 + arm64 under FPC (Homebrew unit paths autodetected); Windows x64 + Linux + macOS under Delphi 12 / RAD Studio. Windows-on-ARM64 builds via FPC are supported through the Makefile's CROSS_TARGET=aarch64-win64 override (pair with FPC_UNITS_DIR pointing at the cross-build's unit tree); the updater emits windows_arm64.exe as the release-asset suffix on those builds. The Delphi 13 WinArm64EC target isn't wired into PasClaw.dproj yet — add the platform via the IDE's Project Manager when you're ready to ship for it. Three sample binaries under samples/component-console/ plus matching .dproj files for RAD Studio and dcc32.cfg / dcc64.cfg for cmdline Delphi builds. FreePascalOS (x86-64 UEFI, written in Free Pascal): make fpos builds pasclaw with that system's own compiler target; the gateway and its web UI run there (on Indy over the system's sockets), the TUI is left out, and a binary built for it links GPLv3 libraries -- see docs/freepascalos.md.
Notable feature additions, newest first. Bug fixes and review follow-ups are in the full git log.
- 2026-12-04 — Studio has the web UI's look. The palette is the web's, value for value, dark and light:
PasclawDark.styleand the Pascal tokens takewebui.html's:root, andscripts/retone-light.pynow retones the light book ontohtml.lite(cool greys, the web's blue) instead of the warm paper it had. The header is the web's app bar: the PasClaw logo, the tabs as flat text with an accent underline (the tab control's own strip is gone), and the status as a pill with a dot for the connection. The sessions column sits on the web's surface with plain rows and a quiet active row. Replies read at 15px (the scale moves up a step everywhere else), the user's turn is a rounded bubble as wide as what was said, the per-turn "turn 3/8 · Copy" strip became a copy button that shows on hover, and a tool use is one card,name(args)with a dot, instead of a call card, a result card and the stream's⏺lines repeated in the text. The composer is one rounded card holding the message, its bar and a filled Send, its border the accent while it has the focus. Buttons are flat (the gradient also hid their hover). See Studio UI plan → Web look. Checked bymake lint-studio(the icon generator and both books agree, the light book is a fixed point of the retone). - 2026-12-03 — Send a running subagent to the background. While a chat turn waits on a
spawn, a bar under the reply names the subagent and offers Send to background: the turn stops waiting and carries on (the model is told the subagent is still at work as jobbg-…and that its result will come), the subagent runs on as a background job, and when it is done the chat carries on by itself with its result, or the turn still running gets it at its next step. Where the background tools are registered (the gateway,serve,pasclaw agent),spawnnow runs as a job its turn waits on: same call, same result, listed in its turn on the Background tab, which can send it too.POST /v1/background/detach({"session"}) andPOST /v1/background/<handle>/detachdo it over HTTP; a waiting spawn takes no background slot, and sending one is refused atbackground_jobs_max. Stopping the turn now stops the subagent it waits on. The FMX desktop's chats and Studio's composer have the button too (beside Stop, while the turn waits on a subagent; Studio's Background tab can send it from a job's detail), and so does the TUI: Ctrl-G, or/bgin the FPC build's line REPL. Each carries on the chat by itself when the job is done. A subagent's tools also run as the agent that started it and in its workspace pin, forspawn_backgroundtoo: a team agent's background subagent used to write outside the agent's lane. See Tools → spawn and Gateway → /v1/background. Covered bymake test-subagent-bg,make test-background-view,make test-client-api(the desktop's client calls),make test-webui-background-e2e(a fake model: Send to background, the turn ending, the chat carrying on with the result, in headless Chromium) andmake test-tui-bg-e2e(the same through/bgin a pty). - 2026-12-03 — Make a workflow an app. Make app in the Workflow editor,
pasclaw workflow app <id> [--kind html|python|fpc|delphi] [--project NAME]orPOST /v1/workflows/<id>/appmakes a new project (a taken name gets-2,-3, ...) whose app runs the workflow, opened on the desktop like any other app (/desktop?open=<project>; open desktops are told).html, the default, is a self-contained page with a form for the workflow's inputs whose Run calls a new app action,workflow: it runs only the workflow the app's ownapp.jsonnames, as saved now (edit the workflow and the app follows, no re-export), through the same gates as the gateway's run route, bounded at 10 minutes and one run at a time; nothing in the request can name another workflow or send steps.pythonis the Python export plus amain.pythat serves the same form on{port}, withpermissions.networkandpermissions.env(key names only) declared from what the workflow needs.fpcanddelphiare the Object Pascal export built against PasClaw's source tree (PASCLAW_SRC, else the checkout the binary was built in), its inputs ininputs.json— read with the new--inputs-file, whichpasclaw workflow runtakes too. No key is written into any app. The app SDK now waits up to 15 minutes for an action's answer instead of 10 s. See Workflows → Make it an app and Desktop → Apps made from a workflow. Covered bymake test-workflow-app,make test-workflow-app-e2e(a fake provider: the action, a python app the gateway runs, an fpc app it builds) andmake test-webui-workflow-app-e2e(Make app to a run on the desktop, in headless Chromium). - 2026-12-03 — An MCP host can ask PasClaw's agent a question and get its answer back. The gateway's
/mcp(pasclaw gateway,pasclaw serve, and the--mcp-portlistener) now offers anask_agenttool by default: the question runs a full turn, with the agent's tools, memory, workspace andAGENTS.mdrules, and the agent's final answer is the result.sessioncontinues an earlier conversation (they live inmcp-*sessions),agentasks a standing agent by name,timeout_sec(default 120, at most 600) bounds the wait.--no-mcp-ask-agent, orgateway.mcp_ask_agent: falseinconfig.json, turns it off. It reaches exactly what/v1/chat/completionsalready reaches, behind the same gate, so it needs no protection of its own: protect the gateway with a token, or keep it on loopback. It is separate from--mcp-allow-write, which stays off: the turn can write and run things, but through the operator's permission rules, so anaskrule goes to the desktop if one is watching and is refused at once if not. A call that runs out of time is a tool error, and the turn stops at its next step.pasclaw mcp stdiodoes not offer it. See MCP → ask_agent. Covered bymake test-mcp-serverandmake test-mcp-ask-agent-e2e(the real gateway and a scripted model). - 2026-12-02 — The desktop (
/desktop) has the web UI's look, and opens in it. A new style, PasClaw, carries the web UI's design tokens value for value, with its font, corner radii, flat bordered panels and buttons, menus, list rows, tool cards and code blocks, in a dark and a light theme, and it is now the default; the 27 retro styles follow it in Display Properties. Light or dark follows the web UI's rule and setting (pasclaw.theme.v1): the choice made with the web UI's theme button or the desktop's new Appearance row in Display Properties (Match the system, Light, Dark), else the OS setting, live. A change in either page shows in the other at once; the web UI now also follows the setting when another page changes it, so the Agent Console window keeps up. A style is saved only when it is picked (pasclaw.desktop.style.v2). A pick made before is kept, except a saved Synthwave: that was the old default, which the desktop saved for every browser that opened it. The style is web-only; the FireMonkey client keeps the retro styles. See Desktop → Styles. Covered bymake test-desktop-style-e2e. - 2026-12-02 — A free-tier Gemini key works out of the box, and a rate limit's retry waits as long as the provider asks. Google Search grounding is on by default for Gemini, and a free-tier key has none: Gemini refused every grounded request from it with a 429 naming no quota, PasClaw retried twice and gave up, and the key could not chat until the operator found
gemini_server_tools.google_search. Now a request withgoogle_searchthat is refused that way is sent once more without it; if that one goes through, the key is remembered for the process and later requests go without from the start (said once in the log; the web page path stops counting on native grounding for it). And the same-provider retry on 408/429/5xx waited 750 ms then 1.5 s whatever the provider said, so both tries landed inside a per-minute limit. It now waits what the provider asks when that is longer: Gemini'sRetryInfo.retryDelay, or aRetry-After/retry-after-msheader (OpenAI and Anthropic). A wait longer thanprovider_retry_max_wait_ms(default 60000) — a daily quota asks for hours — gets no retry, so the fallback walk or the error comes at once; and Stop ends the wait. See Providers → Retries. Covered bymake test-gemini-free-key,make test-provider-retryandmake test-gemini-free-key-e2e(the real gateway and a fake Gemini answering with the refusals a free-tier key gets). - 2026-12-01 — The compaction trigger counts what each call sends, as the Context panel does: the tool definitions and each tool call's arguments as well as the system prompt and message text. Before, the trigger left out the tool definitions (a few thousand tokens on every call) and tool-call arguments (a written file's whole text), so the panel could read 102% of the compaction point on a conversation that had not compacted, and near a model's window the call could be larger than the trigger thought. Both now use one pair of estimators (
ToolDefTokens,MessageTokens), and/v1/context'scompaction.counted_tokensis itstotal_tokensless the turn clock. Covered bymake test-context-usage,make test-context-usage-e2eandmake test-compact-window. - 2026-12-01 — A compacted conversation's earlier turns can be looked up instead of guessed.
session_searchnow indexes each session's record, the transcript log<id>.log.jsonlthat compaction never touches, one row per message. A hit names the message's number and thesession_readcall that opens it, andsession_readreads the same record with the same numbering, so a summarised-away turn is found and read word for word. The compaction summary ends with a pointer to the record, naming the conversation's id, written fresh each time and never fed to the summariser. After a compaction, and on any later turn of a compacted conversation,session_searchandsession_readare loaded instead of waiting behindtool_search. A server-held gateway conversation (session_context) now carries its compaction summary into the next turn's prompt. Before, only the working-state snapshot came back, and the summary was saved but never read again. See Sessions → Compaction. Covered bymake test-session-search,make test-compactandmake test-compacted-recall-e2e(a real gateway and a scripted model: a fact from a compacted-away turn is found by search and read, in a turn that doesn't compact and again after a restart). - 2026-12-01 — Compaction follows the model's context window. The threshold was a fixed 80K — 40% of a 200K window, and more than an 8K or 32K local model holds.
compaction.threshold_tokensnow defaults to0: the window less a fifth (at least 16K, at most half) — 200K → 160K, 128K → 102.4K, 1M → 800K, 32K → 16K, 8K → 4K — the fifth because the trigger counts chars/4, which runs low on code and JSON, and leaves out the tool schemas. The window iscontext_windowin the config, else what an overflow refusal stated for the model (remembered for the process; the limit the server enforces, so it beats a bigger config value), else the provider's cached model list (Gemini, OpenRouter, Together, Groq, Mistral, vLLM and Anthropic lists give it, and the cache now keeps it), else 80K as before. A threshold that is set is used as given. Retention is capped at half the threshold, and the summariser's input cap follows its model's window, so a big window's older history is summarised whole. The Context panel reports the threshold the loop uses and where the window came from (provider,learned). See Sessions → Compaction. Covered bymake test-compact,make test-compact-window,make test-model-discoveryandmake test-context-usage-e2e. - 2026-12-01 — The nightly maintenance pass runs on its own. It used to run only from
pasclaw maintainor an@maintaincron entry, so in practice it did not run. Nowpasclaw gatewayruns it once a day atmaintenance.at(localHH:MM, default03:00): in the active workspace, and in any other workspace that had a session in the last day. A gateway that was off at that time runs it at its first check after, and never twice in a day (the day is recorded in<workspace>/cron/maintain.lastbefore the pass starts).maintenance.auto: falseturns it off, an@maintaincron entry takes the schedule over for its workspace, and both settings are in the web UI's Settings → Maintenance pass and apply without a restart. Review and backup stay off unless configured. See Maintenance → When it runs. Covered bymake test-maintainandmake test-memory-tiers. - 2026-12-01 — The
projecttool costs about 270 tokens per model call instead of about 1,000. It is in every chat's tool list, so its description is now a few lines and its schema names the app fields bare; the app rules (the kinds, every field, the sandboxed frame and its one-origin CSP,pasclaw.js, a process app's permissions) come back from the tool when they are needed:action="app"with onlynameanswers with them and writes nothing (the description asks for this call before a new app), acreateadds them, and a new app's first write adds them as"rules"for a conversation that skipped that call. A conversation is sent them once. The first request of a web UI chat drops from about 6.8k to 6.1k tokens,pasclaw agent's from 7.3k to 6.6k. See Making an app from any chat. Covered bymake test-project-appandmake test-app-link-e2e. - 2026-11-30 — The web UI's App pane starts an app only when it is safe to. A heavy app -- a WebGPU game -- can take the tab down, and a pane that frames the app on every load kept it down across reloads. Start automatically, a switch under the app remembered per project in the browser, is on by default; off, the pane shows the app's name and Start instead of the frame, and the agent's live changes reload only an app that was started. And a crash guard: just before the pane frames an app it records it as starting, and clears that once the page has stayed up and drawing for 8 s after the frame loaded; a page that loads to find the record for the app it is about to show -- the last one died or was reloaded while that app was starting -- shows Start and says so instead of starting it again. Process apps keep their explicit Run. See Gateway → Embedded web UI. Covered by
make test-webui-app-builder-e2e. - 2026-11-29 — Apps from any chat. The
projecttool, now in every chat's tool list, gainsaction="app":name,kind,files(relative path to full text),entry,title,window,icon,run,buildandpermissionswrite a project's app intoprojects/<name>/app/and merge itsapp.json(send one file or one field and the rest stays), making the project when it does not exist; paths that leave the folder (.., absolute, a drive letter, a symbolic link inside it), an unknown kind, a new app with no kind and a missing entry are refused with nothing written, and the answer is the app's state asGET /v1/apps/<p>reports it. The rules an app author needs (the kinds, the sandboxed frame and its one-origin CSP,pasclaw.js'sgetJSON/setJSON, a process app's declared permissions and consent) are one text in the tool's description and in the desktop's Run Task prompt. A conversation whose agent creates a project, writes its app, or writes into itsapp/folder with the file tools is linked to it:GET /v1/sessionsand/v1/sessions/<id>report"project", and the desktop feed carriessession-projectandapp-updated(the desktop reloads an open window of the app on it);GET /v1/desktop/events?passive=1reads the feed without counting as a desktop. In the web UI the right column's App pane follows the link: Building… until the app exists, then the app, reloaded live as the agent writes; New app (the column's head, the App pane's head, the empty chat) takes a name and an idea in a form in the page, makes the project, opens its conversationdesktop-<slug>and sends the idea, so the agent builds it beside the chat; Projects opens any project's conversation; a reopened chat -- a project conversation, an ordinary one, or one from the CLI or the desktop -- rebuilds its tool cards from the stored transcript, whose calls and tool turnsGET /v1/sessions/<id>carries with thelinethe stream showed for each; and a process app gets the desktop's Run window in the pane: where it runs, its command, declared network and env, Run with the exact command from the gateway's 409 and the permissions confirmed in the pane, Stop, Open (its page in the pane's frame) and the run log. Thetaskandruletools still ask outside a standing agent. See Making an app from any chat and Gateway → Conversations linked to projects. Covered bymake test-project-app,make test-app-link-e2eandmake test-webui-app-builder-e2e. - 2026-11-29 — HTTPS on Linux distributions that ship only OpenSSL 3 (issue #605). The vendored Indy's TLS handler takes OpenSSL 1.0.2 and earlier, so a Linux FPC build now picks a TLS backend at the first HTTPS request, once per process: the system's OpenSSL 3 or 4 through TaurusTLS (an Indy TLS handler;
make get-taurustlsfetches it, pinned, intovendor/TaurusTLS), else an OpenSSL 1.0.2 pair next to the binary or inPASCLAW_OPENSSL_DIRthrough Indy's own handler (what the release archives andmake openssl-1.0provide), else the system's libcurl (libcurl.so.4, opened at run time — no link-time dependency) for everything that goes throughPasClaw.Providers.HTTP: provider calls with SSE still streaming, MCP over HTTP,web_fetchwith its redirect guard on every hop, downloads.PASCLAW_TLSnames the backends to try and their order (defaultopenssl3,openssl10,curl). On OpenSSL 3 and libcurl the server's certificate and host name are checked against the system's CA store (TLS 1.2 or 1.3);PASCLAW_CA_FILE/SSL_CERT_FILEnames a PEM to trust instead,PASCLAW_TLS_INSECURE=1turns the checks off; the 1.0.2 path is unchanged (TLS 1.2, unchecked). The relay worker,agent --attach's client and the email / IMAP connections take TaurusTLS or the 1.0.2 handler through the same choice (NewTLSClientIOHandler), and say why when neither loads. When none loads, the message lists what each backend answered and how to get any of them.pasclaw memory provision's downloads (sqlite-vec, ONNX Runtime, the embedding model) moved off FPC'sfphttpclient, whose OpenSSL loader failed on OpenSSL 3 ("Could not initialize OpenSSL library"), onto PasClaw's HTTP layer (PasClaw.Net.Download): same TLS, same proxy rules, and a download whose body is cut off fails and leaves no file (FreePascalOS'sfphttpclientshim is gone with it).pasclaw doctorreports the backend in use and its library version (atlscheck); onboarding's model list says why a fetch failed instead of→ -1. Windows, macOS, Delphi (Linux64 too), DOS, XP and FreePascalOS builds are unchanged.make test-tls-chain(inmake test) runs each backend against a local HTTPS server with a CA made for the run. TaurusTLS is used under its Modified BSD licence (notice in the README's License section). Seedocs/security.md#tlsanddocs/troubleshooting.md. - 2026-11-28 —
pasclaw gatewayon FreePascalOS: its HTTP API, the web UI and SSE, served from inside the system to a browser outside it. Indy gets a socket stack for FreePascalOS,IdStackFreePascalOS(src/fpos/indy, onmake fpos's unit path ahead ofvendor/Indyand on no other build's): aTIdStackBSDBaseover libsystem'sSys.SocketsandSys.HostNames, registered with Indy'sSetStackClass, with readiness through the system'sWaitForSocket/WaitForHandles; and copies ofIdStackConsts,IdStack,IdGlobalandIdGlobalProtocolswith{$IFDEF FREEPASCALOS}branches where they had none for a system that is neither Unix nor Windows (socket constants, ticks, sleep, text encodings without iconv; and Indy'sTextIsSamecomparing bytes, since FreePascalOS'sAnsiCompareTextcollates by the Unicode algorithm and treats'.'and' 'as equal, which broke the HTTP request line). The web UI is embedded as on every build: the resource object the compiler makes is now linked. With Indy working,serve,agent --attach,relay(tohttp://gateways),bridge --listen,execute_code'spasclaw __toolcallback and the LINE / WhatsApp webhooks come back on FreePascalOS;tui(a Unix terminal), the email channel and IMAP (OpenSSL) stay out and say so. The binary grows from 9.9 MB to 14.5 MB.make test-fpos-qemunow also startspasclaw gateway --addr 0.0.0.0inside FreePascalOS with a token and asks it from the host through a port QEMU forwards:/v1/health, the web UI byte for byte,/v1/configwith its secrets masked, 401 without the token,/v1/chatanswered by the fake model,/v1/chat/completionsstreaming a tool call to the host before the model answers, the/v1/logsand/v1/desktop/eventsfeeds,/v1/background, the web UI in headless Chromium sending a chat message, andagent --attachinside the system. Seedocs/freepascalos.md. - 2026-11-28 — The web UI's Workflow tab: a step's arguments as a form, and what a run made, shown. A step that calls an MCP or built-in tool gets one field per property of the tool's input schema (text or a textarea, a number, a checkbox, a select for an
enum, a list for an array of scalars, a fieldset for a nested object, JSON for anything deeper), with required properties marked, the description as a hint and the default as the placeholder; a field holding a{{template}}is text whatever its type and is saved as typed. The JSON stays behind a toggle and follows the form both ways; invalid JSON shows its error without wiping the form. A Replicate model's inputs use the same form. After a run, images, videos and audio in a step's result (Replicate'soutput, any URL field,data:URIs) show in the results, as a thumbnail on the step's card and on the Outputs box, and large in a lightbox; clicking the Outputs box shows each output's value, clicking a step its result. JSON results are pretty-printed with collapsible sections and a prediction's status, model and predict time above them; text renders as markdown. Only http(s) anddata:media URLs are used, with no referrer;javascript:stays text.POST /v1/workflows/<id>/runnow also answersoutputs(andoutput_errors). Covered bymake test-webui-workflow-media-e2e. - 2026-11-28 — Workflows travel. Export as code:
pasclaw workflow export <id> --lang python|pascal,GET /v1/workflows/<id>/export?lang=and Export in the editor give a standalone Python 3.9+ script (standard library only, plus themcpSDK for MCP steps) that re-implements the engine's templates, order,await, loop and outputs over an OpenAI-compatible endpoint, Replicate's HTTP API and MCP; or an Object Pascal program that embeds the workflow and runs it on PasClaw's own engine, gates and config (fpc -MDelphi -Sh -Fubuild/lib wf_<id>.dpr). Sharing:--lang workflowwrites<id>.pasclaw-workflow.json, a versioned envelope with the spec and what itrequires(MCP servers by command or URL, providers and models, built-in tools, Replicate models; never a key, token or env value);pasclaw workflow import <file|url>,POST /v1/workflows/importand Import in the Workflow tab stage it for approval like an agent's workflow, refuse a taken id unless renamed or replaced, and report what this machine lacks.pasclaw workflow run <id>runs a saved workflow from the command line. See Export as code and Sharing workflows. Covered bymake test-workflow-export. - 2026-11-28 — The web UI's Chat tab has a right-hand column, the left one's mirror, opened from a toolbar button or Ctrl+. and remembered with its width and folded panes. Its panes are about the open chat: App — a Desktop project chat (session
desktop-<project>) shows the project's app live, framed from the gateway's/apps/<project>/route with the desktop's sandbox (scripts and forms, never same-origin) and its state store answered through the column, with Reload and Open in a window; Background — this chat's background jobs with their state, live while one runs, each opening on the Background tab, or "No background work in this chat"; Context — the breakdown the context button used to drop down; Parameters — the per-chat system prompt, temperature and max tokens. The Parameters and context buttons now open the column on their pane, and the context button keeps its "6k · 7.5%" summary. At 1024 px opening it puts the chat list away until it closes; on a phone it is a drawer from the right over the transcript. Covered bymake test-webui-chat-column-e2e. - 2026-11-28 — MCP servers can be added, edited and removed in the web UI. The MCP tab has Add server (in its header and empty state), opening a form in the tab: name, transport (a command with its arguments, or a URL), environment variables as rows whose values are write-only (a saved value reads "Saved. Leave empty to keep it"), enabled and tool exposure, with inline checks (a name is required, unique and letters, digits,
-and_; a command or URL is required). Start from the catalog lists the bundled catalog (newGET /v1/mcp/catalog) and fills the form, with a token as a${VAR}marker rather than its value. Each row has Edit and Remove (asks first). Settings › MCP servers uses the same form in its cards and saves through the Save bar. A server that is added or turned on connects as soon as the config is saved (Connecting, then Ready); editing, turning off or removing a running server applies at the next restart, and the tab and Settings say so.GET /v1/confignow masks eachmcp_servers[].envvalue on its own (GITHUB_TOKEN=•••) and keeps the names; a save restores masked values by variable name.envnow reaches a stdio server's environment (it was stored but not passed), and anAuthorizationvariable is the header of an HTTP server whoseargsis empty.GET /v1/mcplistsconfig.jsonas saved, withapply: "restart"on entries the running gateway has not taken up. Covered bymake test-webui-mcp-e2eandmake test-webui-settings-e2e. - 2026-11-28 — The web UI's Workflow tab, redone. A list first: a line on what a workflow is (with a link to the docs), the workflows the agent staged for approval with every step, Approve and Reject, then a row per saved workflow with the tool it is served as, its step count, Run, Open and Delete (asks first). The editor has a bar with the name, the save state and the toolbar in groups (add a step, Fit, Run, Save, delete); the workflow's details behind a disclosure; steps as cards with a type label (LLM, Model, MCP, Tool) on a dotted canvas, connections with arrowheads; the selected step's settings in a panel. A run marks each step running, then done, failed or not run, and lists each step's output; a failure names the step. Leaving with unsaved changes asks first. Empty, loading, error and workflows-off states, and a phone layout. Names, step ids and output are drawn as text. Saving a workflow whose id is not its name now saves over it rather than beside it; a save keeps what the editor has no control for (a step's
await, input and output types, whether an input is required) instead of resetting it; Run no longer saves a workflow that hasn't changed; and the derived input and output wires follow the Inputs and Outputs boxes when they are moved. Covered bymake test-webui-workflow-e2e. - 2026-11-28 — PasClaw on FreePascalOS, the x86-64 UEFI operating system written in Free Pascal.
make fposbuildsbuild/fpos/pasclawwith that system's own compiler target (-Tfreepascalos) from a FreePascalOS checkout inFPOS_DIR, and links it as the system links its own programs. FreePascalOS has no Indy socket stack and no OpenSSL, so HTTP and HTTPS go through itslibhttp(HTTP/1.1 and HTTP/2, TLS 1.3/1.2 throughlibtlswith certificate checks;SSL_CERT_FILE/PASCLAW_CA_FILEfor a private CA) behind the samePasClaw.Providers.HTTPAPI, the body handed to the caller's stream as it arrives, so SSE still streams; processes run through FPC'sTProcesson the system's port of it, a timed-out command is ended with the processes it started, and names resolve through the system's resolver for the SSRF guard.gateway,serve,relay,bridge,tui,agent --attachandexecute_code's tool callback need Indy's sockets and are left out: each says "not available on FreePascalOS". SQLite-backed features have nolibsqlite3to load there. All FreePascalOS-specific code is insrc/fpos/and{$IFDEF FREEPASCALOS}branches; no other build sees it.make test-fpos-build(inmake test) builds it and checks the ELF program;make test-fpos-qemuboots FreePascalOS in QEMU with pasclaw on its system disk and drives its shell over the serial port:pasclaw version, a turn against a fake model on the host over HTTP and over HTTPS (refused without the test CA),write_file,read_file,shell_exec(and its timeout) andexecute_codeinside FreePascalOS, a saved session, andpasclaw acpwith the reply streaming. FreePascalOS is GPLv3 without a linking exception: a FreePascalOS binary of pasclaw links it, so giving one to others means GPL terms; building and running your own does not, and PasClaw's source stays MIT. Seedocs/freepascalos.md. - 2026-11-27 — The web UI's Vault tab, redone as a page for the pasclaw.dev Code Vault: a line on what it is and how the agent uses it, with a pill for whether the vault tools are on and a link to Settings › Tools; a search field, then a row per result (name, category, version, summary, repository) beside the open entry with its facts, install snippet and Copy, description and Build with this. Flagged and blocked entries say so; empty, no-match, loading and error states (with Try again); at phone width the open entry replaces the list. Every field is drawn as text and only http(s) URLs are links. Covered by
make test-webui-vault-e2e. - 2026-11-27 — The web UI's Checkpoints tab, redone. A heading and a line on what checkpoints are and how Undo, Redo and Restore relate, the chat they belong to and the backend, then a timeline of turns that changed files, newest first: the turn, its file count, each file marked Added or Changed (paths relative to the folder they share, five then Show all), and when it was taken (relative, exact on hover). Restore on a row now asks first and rewinds to before that turn; Undo and Redo in the tab report which files they restored in a note above the list instead of the chat transcript. Empty, checkpoints-off, loading and error states, and a phone layout. File names are drawn as text. Covered by
make test-webui-checkpoints-e2e. - 2026-11-27 — The web UI's Logs tab, made a log viewer. A heading with a line on what it shows and a Live, Paused, Reconnecting or Disconnected pill; level chips (Error, Warn, Info, Debug) with counts and a text filter; each line as its time, a level pill and the message, in mono and wrapped (the route sends no times, so it is when the page received the line, and lines replayed from the gateway's buffer have none). Pause and Resume, Copy and Download of the lines shown, Clear for the view only. The view follows new lines only while you are at the bottom, with a Latest button otherwise, and holds at most 2000 lines. When the stream drops it reconnects and adds only the lines written meanwhile, with a mark where it happened; a refused stream shows an error with Retry now. Escaped quotes and newlines in a line are decoded (they showed as
\"), and lines are drawn as text. Covered bymake test-webui-logs-e2e. - 2026-11-27 — The web UI's Skills tab, redone. A line on what a skill is with a link to Settings › Tools & sandbox; skills the agent staged for approval first, each with the
SKILL.mdit would save, Approve, and Reject confirmed in the row; then a row per installed skill with its kind (Knowledge, Prompt, Shell), where it came from and whether its files still match as pills, the description clipped to two lines with Show all, Details (file, source, install time, archive digest), and Remove confirmed in the row instead of a browser dialog. A filter with six or more skills; catalog search and install by name under Add a skill; empty, loading and error states; at phone width the actions fold under the text. Names, descriptions andSKILL.mdtext are drawn as text.GET /v1/skillsnow givesprovenanceandintegrityfor skills a ClawHub install recorded. Covered bymake test-webui-skills-e2e. - 2026-11-27 — The web UI's KB tab, redone. A heading and a line on what the knowledge base is, a strip of documents, chunks, sources and the search mode (keyword or hybrid), search results with rank, document, chunk, score against the best hit and the snippet with its matches marked, an upload bar that asks before replacing a file, a row per document (name, chunks, modified time) and a row per source; empty, loading and error states, and a phone layout. Names and snippets are drawn as text.
GET /v1/kbnow also listsdocuments(the first 500, withpath,root,chunks,mtime). Covered bymake test-webui-kb-e2e. - 2026-11-27 — The web UI's MCP tab, redone. It says what MCP servers are and links to Settings › MCP servers, counts the servers ready, connecting and failed and their tools, and shows each server as a row: its name, a status pill, stdio or HTTP, its command line, the protocol revision it negotiated and how, the server's own name and version, its tool count, and a collapsible list of its tools; a failed connect shows its error, as text, in a red box. With no servers there is an empty state with a button to Settings; while a server is connecting the tab checks again every 3 s. Covered by
make test-webui-mcp-e2e. - 2026-11-27 — The web UI's Cron tab, redone. A line on what it is with a link to Settings › Scheduling for editing, then a row per job: its id, enabled or disabled, the schedule in mono with a plain reading for simple expressions (
*/5 * * * *reads "Every 5 minutes",0 9 * * 1-5"Weekdays at 09:00"; others show the expression alone), the skill it runs and the channel it posts to, its arguments clipped to two lines with Show all, and the last run as "2 h ago" with the exact time on hover; an empty state with none, a retry on error. Ids and arguments are drawn as text, and a channel's webhook URL is no longer shown.GET /v1/cronnow gives each entrylast_fired(a unix time, or null), from the scheduler's state file. Seedocs/gateway.md. - 2026-11-27 — The web UI's Chat page, polished. An empty chat says what the page is for and shows the keys (Enter, Shift+Enter, /, the up arrow); replies read at 15px in a 48rem column, and your own messages sit in a bubble that stands apart in the light theme too. Markdown tables are drawn as tables (column alignment from the delimiter row, cells as text), code blocks have a Copy button with an icon like the Relay tab's, a batch of tool calls stacks into one list with each tool's name ahead of its arguments, and a failed call says "failed" on its card. Stop looks different from Send. A reply streaming in no longer pulls you to the bottom when you have scrolled up to read; a Latest button takes you back, and a finished reply, redrawn as markdown, no longer ends with its last lines below the fold. At phone width the open chat list dims the transcript, and a tap beside it closes it. See
docs/gateway.md. - 2026-11-27 — The web UI's Files tab, tidied into a file browser: a breadcrumb that starts at Workspace with each folder clickable, folders first then by name with an icon, size and modified time (relative, exact on hover), and a viewer with the file's name, folder and size, line numbers, Copy and Download, Markdown rendered with a Source switch, and a plain message for a file over the 256 KB read cap or a binary one. Arrow keys, Enter and Backspace move through it; empty, loading and error states; at phone width the folder sits above the file. Names and contents are drawn as text.
GET /v1/fsentries now carrymtime. Seedocs/gateway.md. - 2026-11-27 — The web UI's Stats tab, tidied: a header with the last refresh time and a refresh button, a strip of input and output tokens, turns, tool calls and sessions, a caching-and-savings panel (now with cache keep-alive requests), and tokens by provider and by model with counts right-aligned and each row's share; an empty state when nothing is counted, a banner linking to Settings › Diagnostics when counters are off, and a clear error when a refresh fails. Reset totals is styled as destructive and asks in the page instead of a browser dialog. Provider and model names are drawn as text, and the tab stops polling while another tab is open. See
docs/gateway.md. - 2026-11-27 — The web UI's Memory tab, tidied: a heading and a line on what memory is, then Notes, Facts and Search setup as tabs with counts. Notes lists
workspace/memory/newest first with size and modified time, opens a note beside the list with its size and age, rendered Markdown, a Source switch and Copy, and shows search matches with the matched words marked. Facts shows each one's kind, scope and id with a forget button, a note when distillation is off (facts are then neither collected nor put in the prompt) linking to Settings, and reports when adding, forgetting or exporting fails instead of failing silently. Empty, loading and error states; at phone width the list sits above the note. Names, snippets and facts are drawn as text.GET /v1/memoryentries now carrymtime. Covered bymake test-webui-memory-e2e. - 2026-11-27 — The web UI's Relay tab, redone. It says in plain words what the relay is and whether a provider of kind
relayis configured and is the default (with a link to Settings when none is), shows the queue as one strip (workers online, queued, in flight, completed, and failed, red only above zero), and lists the connected workers as rows: id, models as chips, online or stale, requests taken, and last seen as "12 s ago" with the exact time on hover; with none there is an empty state. Add a worker holds the gateway URL and the masked worker token once (Reveal and Copy; the snippets keep the<PASCLAW_RELAY_TOKEN>placeholder until Reveal) and one option at a time: this browser,pasclaw relay, Python, Replicate, each snippet with a Copy button. The in-browser worker has a download progress bar with a percentage, a status line, a served count and a timestamped Activity list, and when WebGPU is missing it says why and turns Connect off. Worker ids and models are drawn as text. The status refreshes every 3 s only while the tab is open and the page is visible.GET /v1/relay/statusnow gives each workerlast_seen_age_ms, sincelast_seencarries no time zone. Seedocs/providers-relay.md. - 2026-11-27 — Model pickers in the Settings tab. Every model field (the default model, each provider card's, the fallback rows, the model tiers, the router's easy model, the advisor's, a subagent's) lists the models of the provider that field belongs to: the caret, a click or the down arrow opens the list, with display names where the provider gives them; typing filters it, Enter picks, Esc closes; and any model id can still be typed, since a list can be short of what a provider accepts. Before, a datalist showed nothing until something was typed, and only ever the default provider's models. New route
GET /v1/providers/<name>/models: one provider's models from the same discovery and cache aspasclaw model refresh, with?refresh=1(the list's Refresh), an older cached list when a refresh fails, and the provider looked up inconfig.jsonas saved, so one added in Settings is listed before a restart. Seedocs/gateway.md. - 2026-11-27 — A real Settings tab in the web UI. Settings are grouped into sections (Models & providers, Agent, Tools & sandbox, Memory & knowledge, MCP servers, Gateway & security, Channels, Scheduling, Diagnostics, Backup & transfer, Advanced) with a search box that matches labels, config keys and descriptions; at phone width the section list is a select. Each setting has a name, a line on what it does and its key, with a switch, a select of the allowed values, a number with its unit, or a list editor; providers, MCP servers, channels, cron jobs, subagents and skills are cards you can add and remove. Secrets are write-only fields that say whether a value is set; one left alone keeps its saved value. A bar along the bottom counts unsaved changes and holds Save and Discard, invalid values are refused inline, settings that need a restart say so, leaving the tab with unsaved changes asks first, and the whole file can still be edited as JSON, checked before it is saved. A key the page has no description for is listed under Other and saved as it came. Workspace export and import moved to Backup & transfer. The tab edits
config.jsonas saved (GET /v1/config?source=file), so a change waiting for a restart is no longer reverted by the next save. Saving also stopped writing the•••placeholder intochannels[].targetandcrons[].channel_target, which broke every configured channel, anddiagnostics.otel.headersvalues are now masked on read and kept on save like other secrets. Seedocs/gateway.md. - 2026-11-25 — Background work in the web UI. A Background tab lists the jobs the agent started with
spawn_backgroundandshell_background, in every chat, under Running and Finished with a status chip, the elapsed time and the chat each belongs to; the tab button carries the running count. A job opens beside the list: a subagent's transcript, drawn by the chat's renderer with its tool calls as tool cards, or a command's output (live while it runs) and exit code. Stop cancels a running job, and a finished subagent has a message box: the follow-up runs as a new background job that continues the conversation in the same chat and workspace, linked to the old one both ways. It refreshes every 2 s while open and visible, and pauses while the page is hidden; at phone width the open job takes the tab. New token-gated routes:GET /v1/background,GET /v1/background/<handle>,POST /v1/background/<handle>/cancel(says whether the job was killed or only marked) andPOST /v1/background/<handle>/message. Each job now keeps a bounded transcript (200 messages, 256 KB), finished jobs are kept to the last 50 (they were never dropped before, so a gateway's list grew for its whole life), a cancelled subagent stops at its next step instead of running to the end, and a subagent whose provider refused reads failed, not done./tasksinpasclaw agentand the TUI lists the same jobs. Seedocs/gateway.md. - 2026-11-25 — An advisor: a second model the agent can consult mid-task. With
advisor.modelset in config (onadvisor.provider, else the default provider),--advisor [provider:]modelonagent,tui,gatewayandserve, or/advisorin the REPL and the TUI, the agent gets anadvisortool that takes aquestion. The advisor is sent a system prompt that makes it a brief second-opinion reviewer, a condensed transcript of the conversation (user and assistant text, tool calls with their arguments, tool results; the oldest part cut toadvisor.max_context_chars, 60,000, with a note saying so, and the user's latest message always kept) and the question, with no tools, through the ordinary provider factory; its answer is the tool result. Read-only, so plan mode and parallel batches allow it; at mostadvisor.max_calls_per_turn(3) calls a turn, counted per loop, so each subagent turn has its own; subagents inherit it through"tools": ["*"].--no-advisorand/advisor offtake the tool out of the next request. Its tokens go to a stats bucket per advisor provider and model, so/v1/statscredits the advisor's model, not the session that asked. The tool loop gainedCurrentDispatchHistory/BumpTurnCounter, a tool's view of the turn it runs in. Reviews nobody asked for (OpenClaw's style) are not here. Seedocs/advisor.md. - 2026-11-25 — The MCP client speaks MCP 2026-07-28 and still connects to older servers. It probes with
server/discoverand, for a modern server, sends noinitializeand no session: every request carries_meta(protocol version, client info, capabilities) and, over HTTP,MCP-Protocol-Version,Mcp-Method,Mcp-Nameandx-mcp-headerheaders. An error, an HTTP 4xx, silence orUnsupportedProtocolVersionErrorfalls back toinitialize(offering 2025-11-25, accepting what the server answers); 2024-11-05, 2025-06-18 and 2025-11-25 servers connect as before. The negotiated version shows inpasclaw mcp test,GET /v1/mcpand the web UI's MCP tab. Servers can ask the user for input: multi round-tripinput_requiredresults and legacyelicitation/create(stdio) are answered at the keyboard in thepasclaw agentREPL and the FPCpasclaw tui, one typed prompt per form field, a URL shown but never opened; the gateway, one-shot runs and subagents declare no elicitation and decline, telling the model what was asked and handing it the URL. Tool calls that become tasks (io.modelcontextprotocol/tasks) are polled withtasks/getwithin the call's timeout, with task input sent bytasks/update. OAuth: the authorization response'sissis checked (RFC 9207), dynamic registration declaresapplication_type: native, a stored client is reused only with the issuer that registered it, and a Client ID Metadata Document is used when the server supports one andmcp_oauth_client_metadata_urlis set. Also fixed: an HTTP JSON reply that mentionsdata:(an icon's data URI) was taken for an event stream and lost, and the client sent twoAcceptheaders. Sampling and roots (deprecated) are not offered; skills over MCP are not implemented yet. Seedocs/mcp.md. - 2026-11-21 —
make xpbuilds the fullpasclaw.exefor 32-bit Windows with Free Pascal, made to load on Windows XP. XP's own TLS stops at 1.0, but pasclaw does HTTPS through OpenSSL 1.0.2 (libeay32.dll/ssleay32.dll), so an XP machine talks to providers directly with no bridge. The FPC Windows build had not compiled before; fixes:SysUtils.GetEnvironmentVariablewhere FPC'sWindowsunit hid it,TCriticalSection/TMessagealiases where its records hid ours,SizeIntloop counters in the ONNX binding,MOVEFILE_WRITE_THROUGHfor FPC. For XP itself:GetFinalPathNameByHandleW(Vista) is looked up at run time instead of imported; the console is switched to UTF-8 only on Vista and later, and FPC on Windows writes throughWriteConsoleW; colour is turned off when the console refuses ANSI processing (XP, 7, 8), where it used to print←[31m.make xp-toolchainunpacks the FPC win32 units from the official installer (pinned SHA-256);make test-xpbuilds the exe and checks withscripts/check-xp-imports.pythat its PE header and every imported function are ones XP has.pasclaw version,statusanddoctorran on XP SP2 (LiveXP in the Halfix emulator);pasclaw gatewaythere stopped at opening its port, because that disc has no TCP/IP stack; it now says so in one line with exit code 1 (any gateway listener that cannot be opened does, where it was an unhandled-exception dump), and random bytes fall back toRtlGenRandomwhere the crypto provider does not load, as on that disc. HTTPS, a running gateway and an agent turn are not yet tried on XP. Seedocs/windows-xp.md. - 2026-11-21 — PasClaw on DOS.
PCLAW.EXE(src/dos,make dos) runs the agent loop and its tools on an MS-DOS PC (486 or later; it ran in 2 MB in DOSBox-X):read_file,list_dir, andwrite_file,edit_fileandrun(throughCOMMAND.COM), each of the last three asked about first unless/YES. A DOS PC has no TCP/IP or TLS, so each model call goes as plain HTTP/1.1 down a serial line to the newpasclaw bridge(--serial /dev/ttyUSB0orCOM3for a null-modem cable,--listenfor DOSBox-X'sserial1=nullmodem ... transparent:1), which forwards it to a gateway's/v1/responseswith the tools passed through, so the model's tool calls come back to DOS to run. The gateway token and provider keys stay on the modern machine; the bridge forwards onlyPOST /v1/responses,GET /v1/healthandGET /v1/models, sends this config's token only to this config's gateway, and cuts each answer down to what the client reads (2.6 KB to about 0.5 KB a step). Every body carries a CRC-32 and every request a sequence number, so a damaged request or answer is sent again and a late one skipped. The screen, keyboard, files and file names are CP437 with CR LF and the client converts at each edge.make dos-toolchainbuilds the i386 cross compiler fromfpc-sourceand fetches the DOS units;make test-dosruns the bridge and a host build of the client against a real gateway over TCP and a pseudo-terminal pair, andmake test-dos-dosboxrunsPCLAW.EXEin DOSBox-X. Seedocs/dos.md. - 2026-11-13 —
pasclaw agent -m "..." --session IDis a turn on that session. Before, it sent the model the new prompt alone and saved that turn's history over the session file, so the reply was never saved, the model never saw the conversation so far, and an interactive session passed to it lost its transcript. The one-shot path now runs the turn the way the interactive prompt resumes a session: the stored messages go first, the prompt, tool calls, results and reply are appended, a provider refusal's error text is printed and not saved as a reply, the session's own prompt (where a compaction summary lives) is used and saved back, and the turn works in the session's directory, aspasclaw resumedoes. Without--sessiona one-shot still saves nothing. (#641) - 2026-11-13 — Stats totals are right again, and can be reset. The OpenAI, Anthropic and Gemini
Chatfunctions returned a record whose unset fields held leftover memory, so the Stats tab,/v1/statsand the saved stats ofpasclaw agentsessions showed token counts no provider had reported, in the billions or negative. The three now start from an empty response andParseOAIResponseclears its counters first. Totals saved by earlier builds are not corrected; Reset totals on the Stats tab (POST /v1/stats/reset, token-gated like the rest of/v1/*) asks first, then sets every saved counter to zero and keeps conversations. A conversation with a turn running on the gateway is skipped and the reply says how many were;prompt_cache_warm_pingsis not reset; a reset cannot be undone. A/v1/statsanswer computed before a reset is no longer cached after it, and the tab draws only its newest request's answer. (#639, #640, #641) - 2026-11-13 — Web UI redesign (
webui.html). The neon look gives way to a stylesheet built on a small set of tokens: one neutral surface scale, one accent, three status colours, sans for the interface and mono for code, paths, config keys and tool output, and one SVG icon set in place of emoji.html.liteis a real light theme that swaps the tokens (it was a CSS invert filter), and the theme follows the OS until the theme button is used. A slim app bar with a status chip, a chat transcript in a readable column with per-message actions under the message, and a narrow-screen layout where the tab strip scrolls sideways and the chat list opens over the transcript. No features added or removed;desktop.htmlis not touched. (#638) - 2026-11-13 — The markdown renderer in
webui.htmlanddesktop.htmlno longer freezes the tab on CRLF text. A heading or fence line ending in\rfailed the block test but matched the paragraph loop's stop test, sorenderMarkdownlooped forever; the web UI reopens the last chat on load, so a reload froze it again. The Delphi build's Anthropic provider joins a reply's text blocks with CRLF, which was enough. Line endings (\r\n,\r, U+2028, U+2029) are now normalised before splitting, and the paragraph branch always takes its line. (#637) - 2026-11-13 — Context breakdown in the web UI, the equivalent of Claude Code's
/context. A context button in the chat toolbar shows the running total; it or/contextopens a panel with a segmented bar against the model's window, each part's tokens and share (system prompt, memory, project rules, skills, built-in tools, MCP tools, messages, free space), how far the conversation is from compaction, and expandable lists of system prompt sections, tools per MCP server and the largest messages. It is served byPOST /v1/context, which takes the/v1/chat/completionsbody and assembles it with the chat route's own code without calling a model (text: trueadds each section's text). New display-only keycontext_window; without a window the bar is drawn against the compaction threshold. Every number is a chars/4 estimate, and the report says so. (#636) - 2026-11-13 — A provider refusal is an error, not the assistant's reply.
/v1/chat/completionsused to return the provider's error text as an HTTP 200 answer, andPersistGatewaySessionsaved it as an assistant message, so on the next turn the model was told it had said it. A refusal now gets HTTP 502{"error": {message, type: "provider_error", upstream_status}}(or, withstream: true, an OpenAI error frame then[DONE]), no saved session gets the error as a reply, and the web UI shows it as an error turn with retry that is never sent to the model. Same PR: the MCP bridge registered tools throughRegisterDeferred, the one path that did not resetHidden, so leftover stack bytes decided whether an MCP tool's schema ever reached the model; it now always does. (#636) - 2026-11-12 —
pasclaw acpruns PasClaw as an Agent Client Protocol agent, so an editor (Zed, JetBrains IDEs, ACP plugins for Neovim and Emacs) can drive it over newline-delimited JSON-RPC on stdin and stdout, with the same loop, tools,permissionsrules, sessions, modes and providers aspasclaw agent. The editor gets each tool call with its kind, title and file location, a before/after diff forwrite_file/edit_file/append_file,todo_writeas aplan,askrules assession/request_permission(Allow once / Allow for this session / Deny),session/cancel, the four modes throughsession/set_mode(which now reaches the system prompt after the first turn, as the REPL's/modenow does too), andsession/loadreplay. The editor'scwdis the session's project: tools, the shell, the system prompt and itsAGENTS.mdfollow it, and it is recorded as the session's location forpasclaw resume. Editor-supplied stdio MCP servers connect once per name. Under the Docker backend each session runs in its own container, including its background jobs, with the editor's project mounted (POSIX). Replies stream token by token: OpenAI-compatible providers now really stream (which also makes the gateway's streamed/v1/responsesstream for them), Anthropic streams with per-call state and every block kept, and thinking (Anthropic, or a compatible server'sreasoning_content/reasoning) reaches the editor asagent_thought_chunk. Gemini and the relay provider still send each round whole. Not supported yet: images and audio, HTTP and SSE MCP servers from the editor, the editor's file system and terminals, authentication methods. Seedocs/acp.md. (#630, #631, #632, #633, #634, #635) - 2026-11-06 — Gateway: an unset token is no token, and a token-less gateway refuses browsers from other sites. With
"token": "${PASCLAW_GATEWAY_TOKEN}"(the DigitalOcean template) and the variable unset, the literal marker was accepted as the bearer; it now means no token, and the log says bearer auth is disabled. With no token, any web page could POSTtext/plainto/v1/chatand drive the agent and its shell, and a DNS-rebinding page could read/v1/config. A token-less gateway now answers 403 to anOriginfrom another site (another site, another port,null, or the--apps-portorigin) and to aHostthat is a domain name other thanlocalhost,*.localhostor a name in the newgateway.allowed_hosts. Any IPHostis fine, and CLI tools, SDKs, MCP clients, the web UI, the desktop and app iframes are unaffected. Without the relay token,/v1/relay/*answers only the gateway's own pages and non-browsers. A token-less gateway on a non-loopback bind now says at startup that it answers any client that can reach it,docker/README.mdandmake -C digitalocean runpublish on127.0.0.1, and with--apps-portthe apps origin now follows the request'sHost, so a desktop opened under another name shows its app windows. (#629) - 2026-11-05 —
pasclaw learngives each tool result to the call that made it (the latest call with the id, for servers that number calls per turn), counts misuse notes (grep_filesgiven a regex, a definition hunted by guessing its keyword) as patterns of kind misuse, and runs insidepasclaw maintain, and so@maintain, over the last 30 days. The report gains a Recurring section, andSCARS.mdgets an anchor for each pattern seen in 2+ sessions that it lacks; existing anchors and what the operator wrote under them are left alone, and--dry-runonly lists. Quoted text (file reads, board and subagent results, SCARS.md and report lines read back) is not mined, a bare status line such asexit=1counts a failure but is never a pattern, and credentials are masked as<redacted>before a line is kept.SCARS.mdis still not injected into the prompt. (#628) - 2026-11-05 —
code_outline, a repository map made on demand.symbol=NAMElists where a name is declared or defined (not its uses),path=FILEa file's declarations with line numbers (Pascal interface first, then the implementation bodies),path=DIReach source file's purpose and the names it declares. Line scanners, not parsers, for Pascal, Python, JS/TS (and scripts in.html), Go, Rust, Ruby and PHP; read-only, inside the sandbox, capped. On 34 real definition lookups (make bench-codenav) it returned 7,021 bytes against 47,690 forgrep_fileson the name, both answering all 34. It is visible rather than deferred, at 406 bytes of schema per request. When a definition-shapedgrep_filespattern finds nothing, the result names thecode_outlinecall. In a live run, with the model's decisions made by stand-ins told nothing about the tool, it was chosen first for a one-line-per-unit directory summary (2 calls instead of 3) and not for two lookup tasks; units whose header comment followsunit X;now get a summary line. (#626, #627) - 2026-11-05 — Security Engineer, a team member that follows untrusted input from where it enters to where it is used (SQL built from strings, shell commands,
eval/exec, paths, HTML, fetched URLs, deserializers), then checks secrets, access control, unsafe defaults and crypto. It files only holes it demonstrated, fixes the kind at the boundary with a test that sends the attack, and submits with the attack before and after as evidence.secjoinssoftware-teamon the default tier with a "Security sweep" task that waits on the build; the newsecuritytemplate (Foreman + Security Engineer) sweeps an existing project withpasclaw team up security --project <name>.task action=create … cause="sql-injection"files a finding with a snapshot of the project, andrule action=draftcan prove a check from one fixed finding. Also fixed:/v1/decisionsand/v1/needs-youwere 404 in a running gateway, so Needs you could not show or answer anything. (#625) - 2026-10-30 — Software Factory, and teams that work without config. Start → Software Factory takes a sentence and a team template (Software Team by default, Duo for small things); Ask's new Build with a team, New Team… and the model's own
team_upopen it too. The factory window puts the conversation with the team's lead beside its live board: a timeline of what you told the lead, the lead's replies and the board's events; Accept / Reject, Edit and + Task; whether the team is working, waiting, parked or finished, what waits in each mailbox, and any question for you. NewGET /v1/teams/<name>/feed. A standing agent now always has the board tools and theagenttool. An ordinary chat (CLI, project chats, Ask) finds them withtool_searchand is asked (Allow once / Allow for this session / Deny) before calling one orteam_up, and is refused when there is nobody to ask;desktop_tools_enabledandagent_tools_enabledstill mean "yes, every chat" for configs that set them. (#624) - 2026-10-29 — Team boards hold their own rules. A new
reviewstatus is reached only throughtask action=submitwith evidence and left only through a verdict from the operator or, viatask action=verdict, a listed reviewer who is neither the submitter nor the owner (a reject goes back to the owner with the reason);team upturns review on for its board, and an agent'sdonethere is refused.criteriafreeze once work starts,projects/<p>/activity.jsonlrecords every change (GET /v1/projects/<p>/activity), held-out checks under$PASCLAW_HOME/scenarios/must pass before a submit is accepted, and the file tools cannot write the board's own files. Tasks can wait on others (waits_on),task action=nextclaims the oldest ready task under one lock, and leases (teams.claim_lease_minutes, default 120) hand back work whose holder's run died. Needs you:agent action=ask_operator, a desktop window for decisions, pending permission requests and operator-only reviews,/v1/decisionsand/v1/needs-you, anddecisions.channelwithD12 yesreplies accepted fromdecisions.answer_from. A cause rejected twice can become a proven rule:rule action=draftmust fail on the rejected snapshot and pass on the accepted one. Template agents can be givenlanepath globs that refuse file writes elsewhere. Follow-ups from a live run:task createkeepsassignee, owners and leads are told about ready and new work, mail wakes the team tick (a handoff inmake bench-teamboardwent from 29.5–29.9 s to 0.5–0.8 s), a team the board parked resumes when work arrives, and the desktop gets a task form. An empty reviewer list now means only the operator can give the verdict. (#622, #623, #627) - 2026-10-26 — Held-out verification.
verification.scenariosnames a directory of executable checks the agent never sees. After the model's final answer the tool loop runs them in the workspace through the active shell backend, undershell_timeout_sec; a failing round becomes one more user turn naming the failed check and its output ("fix the cause, not the check"), up toverification.max_rounds(default 2)./v1/chatreturns averificationobject,/v1/chat/completionsand/v1/responsesend an unverified answer with a NOT verified notice, the CLI prints the summary, andpasclaw agent --scenarios <dir>overrides config. A missing or empty scenario set is a failure, not a green 0/0. (#618) - 2026-10-26 — Two seconds off every agent turn.
DrainSteeringtook itsmkdirlock before checking for a queue file, and in a home nobody had steered the steering directory did not exist, so the lock wait ran out at 2,000 ms on every iteration of every session, on the gateway, the CLI and the TUI. It now returns at once when there is no queue file and no lock held. Six turns against an instant relay model went from 12.2 s to 0.1 s. (#617) - 2026-10-26 — Fewer turns per task. Rule 7 of the system prompt now says what the loop does: every call in a response runs, in the order listed, before the model is asked again, so independent writes and the check that depends on them can go in one response. The Workspace section lists the workspace's top-level entries (sorted, directories slashed, hidden ones skipped, capped at 40), each name scrubbed of control and bidi characters and quoted as data. The RAG build bench went from 6 turns and 146,734 request bytes to 2 turns and 49,218. (#616)
- 2026-10-26 —
--no-mcpkeeps the built-in long tail deferred. The gateway,serveand the TUI only reached built-in progressive disclosure through MCP setup, so under--no-mcpthey carried all 36 schemas and had notool_search; all four surfaces now share one entry, andtool_searchregisters only whenbuiltin_progressive_disclosureis on.desktopis deferred until a desktop subscribes to/v1/desktop/events, which reveals it.memory_write,shell_backgroundandmemory_fetchstay visible. On the RAG bench a--no-mcprequest is 34% smaller. (#615) - 2026-10-23 — Skill arguments and slash commands, an
instructionslist, and a prompt-cache keep-alive. Prompt skill templates take$ARGUMENTSand$1..$9(split like a shell, the highest$Nabsorbing the rest) beside{{key}}, and frontmatter gainsagent:,model:andsubagent:. Inpasclaw agentand both TUI builds,/name rest of lineruns the installed prompt skill (built-ins win on a clash;/helplists the skills), andmodel:applies to that run only, untouched by the auto-router. Configinstructionslists files, globs and http(s) URLs whose bodies are appended after the project rules; URLs go throughweb_fetch's SSRF guard and are cached 24 h.prompt_cache.warm(default off) has the gateway send a one-token request every four minutes while idle, until thirty minutes after the last turn, so the cached prefix stays warm; each ping is billed and counted asprompt_cache_warm_pingsin/v1/stats. (#614) - 2026-10-23 — Attach mode.
pasclaw gateway/servewrite$PASCLAW_HOME/run/gateway.jsonwhile running (pasclaw statusreports running / stale / none) and now stop cleanly on the first SIGINT / SIGTERM / Ctrl-C, with a second one killing.pasclaw agent --attachandpasclaw tui --attachrun nothing locally: each line is one turn on the gateway's session through/v1/chat/completions,/sessions,/new,/resume <id>and/delete <id>go through/v1/sessions,--plan/--mode,--model,--system,--max-tokensand--no-toolsare forwarded, and flags a gateway turn cannot carry are refused by name with exit 2.cli.attach: off|auto|on(defaultoff) makes it automatic. (#613) - 2026-10-23 — Git worktrees.
worktree_create(branch, base?),worktree_listandworktree_remove(path, force?)run git through the active shell backend, by default into<repo>-worktrees/<branch>.spawn/spawn_backgroundtakeworktree: "<branch>": the child's relative file writes, workspace boundary and shell cwd follow the worktree, and the parent's threads never see it. Sessions record theirLocation, shown bysession list/show, andpasclaw resumemakes it the workspace again when it still exists. Under Docker the worktree directory is bind-mounted at the same path (POSIX), and a worktree the host cannot see is refused and rolled back.worktree.enabled: falseremoves the tools and theworktreeargument. (#612) - 2026-10-23 — Ordered permissions. One
permissionslist of{tool, resource?, effect}rules, with globs over the tool name and the call's primary resource; the last match wins and an empty list changes nothing.denyrefuses with a result the model can read;askgoes to the surface's asker (TUI footer, CLI prompt, apermission_requestdesktop event answered byPOST /v1/permissions/<id>, the component'sOnAsk) with allow once / allow for the session / deny, and with no asker the answer is deny.<home>/policies.jsonholds a second list of the same shape, evaluated first, thatPUT /v1/configcannot write.pasclaw permissions list/test <tool> [resource]show the lists in order and what the gate would decide. (#611) - 2026-10-23 — Background shell jobs.
shell_background(command, cwd?, timeout_sec?)returns ansh-<hex>handle at once; the output reaches the model at the top of its next turn as a[background shell results]block, andspawn_status/spawn_wait/spawn_cancelwork on it, cancel killing the command and everything it started. It registers whateversubagents_enabledsays. A completion flashes in the TUI and is published as abackground_donedesktop event.background_jobs_max(default 6) caps subagent and shell jobs together, replacing the compile-time 4. Cancel, timeout and the output cap now kill the whole process tree, through/procwhere it exists andpson macOS and the BSDs. (#619) - 2026-10-23 — Code Mode for MCP servers, on by default (
mcp_codemode_default: true, orcodemodeper server). A code-mode server's tools are never sent to the model as schemas; the model calls them from anexecute_codescript through a one-linetoolhelper (tool github__list_issues '<json>' | jq ...), so only the script's output enters the conversation. The prompt's Deferred Tools section names each code-mode server with its tool count and the recipe,code_catalog(server?)(andtool --cataloginside a script) returns their schemas, and script calls pass the same dispatch gates as direct ones. Under the Docker backend the script reaches the host's RPC listener throughhost.docker.internal. (#609) - 2026-10-22 — Scripts and shell skills no longer walk around the tool gates, and
shell_exechas a timeout. Anexecute_codescript'spasclaw __toolcall now goes through the tool loop's dispatcher (mode gates,BeforeToolCallhooks, preflight, promptware scan, output cap), so plan mode refuses a mutation made from a script; a subagent's script reaches only the subagent's tools;kind: shellskills pass the denylist, run through the active shell backend and are mutating. Newshell_timeout_sec(default 600,0= none) kills a command on expiry withexit=124, andshell_exectakes a per-calltimeout_sec. Background subagent results now reach gateway sessions,TPasClawClient.Chatcan sendX-PasClaw-Sessionandsession_context, and the TUI builds the real system prompt (memory, facts,AGENTS.md, skills catalog) like the CLI and gateway. (#608) - 2026-10-17 — Memory tiers, a nightly maintenance pass, backup/restore, and a cheap tier for background work. The always-loaded memory files (
SOUL.md,USER.md,MEMORY.md, two daily notes) are each capped bymemory_core_budget_byteswith an elided note, and the prompt carries the six-months test.pasclaw maintainsweeps expired facts (IFactStore.Sweep), sizes the core files, summarises the day's sessions, audits skills for unused and duplicate ones, optionally asks the model for a critique and backs up; schedule it with the reserved cron skill@maintain.pasclaw backup/restorewrite archives withconfig.jsonand aRESTORE.mdinside, rotated 7 / 4 / 6 (--redactfor a masked config).background_modelcarries distillation, compaction, heartbeat, judge and review on the default provider;pasclaw route reportshows the split. (#606) - 2026-10-17 — PasClaw Browser (
browser-desktop/): a WebView2 desktop browser where every tab has a PasClaw chat beside it that can read the page and change it. One in-processTPasClawAgentfor the app (the component is one-per-process), six page tools (browser_page/browser_find/browser_navigate/browser_click/browser_fill/browser_eval) registered once against a testedTSwitchingBridge, a single worker thread running tabs' turns in order, a page-context hook that stamps every message with the tab's URL, title and selection, and a confirm-before-mutate gate. Each tab is its own session, persisted underworkspace/browser/. Everything below the FMX form compiles under FPC and runs inmake test. (#604) - 2026-09-08 — Memory gains a dependency-free embedding tier and a
memory_writetool.PasClaw.Memory.Embed.Static(hash-ngram-v2@256) is feature hashing over word unigrams and character 4-grams — no model file, no vocabulary, no native runtime — so a host that has never runpasclaw memory provisionstill gets a vector column instead of keyword-only retrieval. It is lexical, not semantic (carandautomobilescore near zero) and registers with semantic dedup disabled: it ranks, it never merges.memory_writerecords one durable fact deliberately —tcMutating, so plan mode refuses it and MCP exposes it only under--mcp-allow-write— which lets an external MCP client contribute to the store it could already read. Underneath both, every stored vector now carries the id of the embedder that produced it, so two embedding spaces are never compared and a model switch triggers a backfill instead of silently wrong neighbours. (#600) - 2026-07-01 —
web_fetch(andmemory_fetch, gated on it) back ON by default. It was turned off in #314 because it looked redundant withshell_exec+curl— but its value is the HTML→readable-text stripping (tags removed, entities decoded) capped atmax_chars(default 50000), which curl doesn't do. The tool description now states this plainly, plus that it does not run JavaScript (so a JS-rendered SPA returns little — fetch a raw/API/README URL instead) and thatsave_towrites the uncapped full body to the workspace.stockprofile mirrors the new default;web_fetch_enabled: falseopts out and round-trips. - 2026-06-24 —
orient_task_aware(task-awareMEMORY.mdslicing) reverts to off on every profile and gains a per-run CLI flag:pasclaw agent --orientenables it for one invocation,--no-orientforces whole-file injection (overridingconfig.json). #314 had flipped it on-by-default inTConfig.Create+ thestock/low-token/all-onprofiles while docs, onboarding, and the loop-shaping test still described it as off; this restores whole-file MEMORY injection as the default contract and makes slicing an explicit opt-in. (#343) - 2026-06-21 —
pasclaw relayworker client +cog-relay/Replicate cog. Polls a remote gateway's/v1/relay/poll, forwards each job through the locally-configured provider (Cfg.DefaultProvideror--provider NAME), POSTs back to/v1/relay/respond/<id>. Bearer auth viaPASCLAW_GATEWAY_TOKENor--gateway-token; reconnects on SSE drop with 1s→30s backoff; refuses to forward to a provider that is itself a relay (would loop).cog-relay/exposes the same flow as a Replicate predictor so a deployment with one API-key Secret can lend its compute to any gateway. Lifecycle: one prediction = one polling window (default 300 s). - 2026-06-21 — Relay pull-worker provider: external workers (WebGPU browser tab, phone with mlc-llm, desktop with llama.cpp) connect INBOUND to
pasclaw gateway, advertise models viaX-Relay-Capabilities, pull pending requests off PasClaw's in-process queue, run inference locally, POST results back. New endpoints/v1/relay/poll(SSE),/v1/relay/respond/<id>,/v1/relay/status; new catalog rowrelay. Unlocks WebGPU inference without exposed ports, cog-hosted PasClaw served by your phone, shared home GPU across devices. (#318) - 2026-06-20 —
pasclaw plan+pasclaw build --goalpairing.pasclaw plan -d "<task>"runs inpmPlanmode with a dedicatedplan_writetool and writesworkspace/PLAN.md(## Goal / Files / Steps / Open questions / Risks).pasclaw buildauto-loads PLAN.md as system-prompt context (stale-check +--no-planopt-out) and archives consumed plans toworkspace/memory/plans/<ts>.md.build --goalparses## Goaland seeds the Ralph judge loop.cog-build/predict.pygains a 4-choicemodeInput (build/plan/plan build/plan build goal). (#317) - 2026-06-20 — Cloudflare AI Gateway catalog rows:
cloudflare(compat OpenAI-shape endpoint, defaultworkers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fastusing the gateway's<provider>/<model>routing),cloudflare-anthropicandcloudflare-gemini(native passthroughs with each provider's own auth header). Catalog-only — existing provider units handle the wire shape onceapi_baseis set. (#316) - 2026-06-20 — MCP progressive disclosure + Claude Code-style
tool_search(Hermes Level 0/1 pattern applied to MCP). Default on since fat catalogs (Replicate / GitHub MCP) make eager-reveal expensive. MCP tools register withIsDeferred=True; their schemas are stripped from the per-requesttoolsarray. System prompt lists names under## Deferred Tools;tool_searchloads schemas on demand viaselect:Name1,Name2,+required keyword1 keyword2, or plain keyword search. Revealed tools callable next iteration. (#315) - 2026-06-20 — Stock-config defaults adopt the bench-grounded lean-edit shape:
web_fetch/vault_tools/memory_fetchOFF out-of-box; the six zero-prompt-cost behavioral toggles (orient_task_aware,checkpoints,stats, 1hprompt_cache.ttl,distiller,auto_router) ON.HashlineEnabledcontrols onlyfs_edit_hashlineafter split-gating;fs_grepregisters unconditionally (its ripgrep-inspired optimisations beatshell_exec grepand Windows has no shellgrep). (#314) - 2026-06-18 — Web UI workspace.zip export + import from the gateway: download a snapshot of
$PASCLAW_HOME(memory, sessions, kb, checkpoints, skills, scars) for hand-off between machines, re-import to restore. Same shape as thepasclaw buildworkspace handshake but operator-driven through the browser. (#312) - 2026-06-18 — Model-callable
crontool (opt-in viacron_tool_enabled: true; off by default since it grants background autonomy). Lets the agent schedule an installed skill on a cron expression. Schedules persist inworkspace/cron.json; the scheduler picks them up on the nextpasclaw serve/pasclaw gatewaystart. (#310) - 2026-06-18 —
memory_search/kb_searchFTS5 snippet window widened 24 → 60 chars; system prompt nudges the model to follow up with a targetedfs_readwhen a snippet looks relevant but lacks context. (#309) - 2026-06-18 — Windows
cmd.exequoting fix inshell_exec/execute_code: embedded double-quote literals (hello "world") now survivecmd.exe /c; previously the inner quotes were eaten. (#307) - 2026-06-17 —
cog-buildhonoursprofile=security's sandbox tightening (workspace restriction + shell deny + private-network block) by intentionally not seeding any sandbox fields in its generatedconfig.json. Same PR drops a misleadingweb_searchclaim in the cog README (the tool only registers when a search provider is configured; the cog doesn't supply one). (#306) - 2026-06-17 —
cog-builddefaultsprofiletomax-build(the richest unattended-build toolset). Operators wanting different posture override tobaseline/low-token/security/all-on/ empty. Profile layered UNDER the cog's explicitconfig.jsonfields so the cog's provider catalog +checkpoints_enabledalways win. (#304) - 2026-06-17 —
cog-buildoutputs aslist[Path](workspace.zip + reply.txt CDN URLs) instead of a nested-PathBaseModel(Cog's older runtimes base64-encoded the nested Path inline). API keys move toOptional[Secret]inputs — masked in the UI, never appear in prediction logs.-qflag forwarded topasclaw buildso the ASCII banner stays out ofreply.txt. (#303) - 2026-06-16 —
cog-buildmakesworkspace_inoptional (Cog'sOptional[Path]plus aworkspace_in_urlstring for explicit-URLpgetparallelism). Empty = fresh run; the cog auto-creates a tempdir$PASCLAW_HOME. (#302) - 2026-06-16 —
pasclaw buildcommand +cog-build/Replicate cog predictor with workspace.zip handshake.pasclaw build -d "<task>"orchestratespasclaw agent --quietwith optional--workspace-in <zip>(unpack into$PASCLAW_HOMEbefore the run) and--workspace-out <zip>(pack after). The cog wraps this for Replicate so callers can run long-horizon builds in 30s invocations and round-trip the entire agent brain through one zip URL per call. Default 50 iterations, 4 GiB cap. Sibling to the existingcog/. (#300) - 2026-06-16 — Checkpoints backend switches to zpaq, enabling
/redoon top of the existing/undo. Content-addressable + dedupe-by-default atworkspace/checkpoints/<session>/archive.zpaqso multi-edit sessions don't bloat history. (#299) - 2026-06-16 —
AGENTS.mdproject-rules convention (opencode / Codex / Cursor / Zed shape) read from cwd walking up to git root + injected as the system prompt's## Project Rulessection. Newpasclaw initcommand +/initslash command scan cwd and ask the model for a starterAGENTS.md. (#298) - 2026-06-16 —
tool_choicesupports force-a-specific-tool form across providers. Pass a tool / function NAME (anything other thanauto/none/required) and each provider emits its native object shape. Gemini ignorestool_choiceentirely. (#297) - 2026-06-16 — Delphi build
IShellBackendenv-injection fix:ExtraEnvnow reaches spawned children on Delphi/Windows AND Delphi/POSIX (was silently dropped before; FPC paths were already correct). (#296) - 2026-06-16 — Knowledgebase native PDF ingest: parses PDF text via FlateDecode +
/ToUnicodelookup in pure Pascal (no Poppler /pdftotextdependency).pasclaw kb add <file>.pdfworks without preprocessing. Scanned PDFs still need external OCR. (#295) - 2026-06-15 —
pasclaw profile diff <a> <b>(side-by-side comparison of two profiles' resolved field values) +pasclaw profile bench <profile>(run the SWE bench fixtures under the named profile, emit aggregated turn-count / tool-call / token stats). Finishes the profile-system follow-ups. (#292) - 2026-06-13 —
pasclaw agent --quiet/-qclamps the logger tollErrorso[info]startup noise (web_search disabled,mcp[<name>] cache hit, ...) stays off the stdout pipeline scripts read. Pairs with the banner / assistant-header / per-tool decoration / token-line suppression from PR #243 — Replicate / Lambda / curl callers runningpasclaw agent --quiet -m "..."now get only the model's reply on stdout. (#244) - 2026-06-12 —
dcc64 F2613 Unit 'PasClaw.Otel' not foundfixed by appending..\pkg\otelto the Delphi project'sDCC_UnitSearchPath. Same PR also addspasclaw agent --quiet/-qfor machine-readable single-turn output: drops the banner, theassistant (provider/model):header, every per-tool decoration line, and the trailing[tokens in=... out=...]summary. Exit code is non-zero on provider misconfiguration or a failed tool loop, so scripts can detect failures without parsing stdout. (#243) - 2026-06-12 — OpenTelemetry traces (OTLP/HTTP+JSON) on the agent loop + gateway HTTP server, off by default. Span hierarchy:
HTTP <method> <route>(gateway, W3Ctraceparentparsed for parent context) →openclaw.agent.turn→chat <model>(provider request withgen_ai.*attrs) →execute_tool <name>(serial tool dispatch). Span shape mirrors openclaw v2026.2+ so Langfuse / Tempo / Jaeger / Honeycomb / Datadog dashboards work without remapping. Flip on viadiagnostics.otel.enabled: trueinconfig.jsonOR the standardOTEL_EXPORTER_OTLP_ENDPOINTenv var. (#242) - 2026-06-12 —
fs_grepripgrep tier 5+6: byte walker replacingTStringList/StringReplace/ per-lineLowerCase(tier 5), and Boyer-Moore-Horspool substring search replacingPos()(tier 6). 3-5x faster on the per-file path for typical source files; ~3-10x fewer text-byte reads on patterns the model actually queries (TODO,function,class,FIXME). Output byte-identical to the old path. (#241) - 2026-06-12 —
fs_grepripgrep-inspired tier 1-4 speedups: deferComputeFileHashuntil the first match in a file (tier 1); skip well-known VCS / build / deps directories by name at walk time (.git,.hg,.svn,node_modules,target,build,dist,vendor,.venv,__pycache__,.gradle,.next) — tier 2; NUL-byte binary sniff in first 1 KiB (tier 3); file-size cap (default 10 MiB, override viamax_file_bytesarg) — tier 4. Together these pull the typical scan envelope from "read every file under the root" to "read the source files only". (#240) - 2026-06-11 — Windows
shell_execoutput: auto-detect UTF-8 vs OEM codepage with strictMB_ERR_INVALID_CHARSUTF-8 first, fall back toGetOEMCP. Catchespwsh(PowerShell 6+ defaults to UTF-8 piped output) ANDcmd.exe(defaults to OEM) without requiring operator config. Replaces an earlierGetConsoleOutputCPapproach which broke real-world non-ASCII paths liker�sum�.txt. (#239) - 2026-06-11 — Hashline
fs_readheader mojibake fix:¶was rendering as¶on certain terminals after a{$CODEPAGE UTF8}source-page change promoted ASCII byte literals to UnicodeString-like length-1 codepoints. Stamp the full hashline-formatted output asCP_UTF8before JSON serialisation so the bytes survive identically across FPC and Delphi. (#238) - 2026-06-11 — Windows
shell_execoutput: decode child-process stdout via the OEM codepage instead of assuming UTF-8. Catchesdir /b,git status,git diffmojibake on non-ASCII paths. Subsequently refined in #239 to also handlepwsh's UTF-8 piped output. (#237) - 2026-06-10 — Shell backends (
local|docker) viaIShellBackend.shell_execandexecute_codedispatch through an active backend instead of going straight to/bin/sh -c. Thedockerbackend spawns a per-session container at session start,docker execs into it for every shell call, bind-mounts the workspace at the same path inside the container (sofs_*from the host andcat/teefrom inside reference the same files — no path translation), and stops it at session end. Hardening win: even a denylist-escaping model can only touch the container, not the host filesystem.~/.pasclaw/config.json(provider keys) is deliberately not mounted in. Phase 1 wires this forpasclaw agent(interactive + one-shot) andpasclaw heartbeat. (#233) - 2026-06-10 — Heartbeat daemon (off by default;
pasclaw onboardasks to enable).pasclaw heartbeatreadsworkspace/heartbeat.mdevery N minutes (default 30), runs the full agent loop on the body, and optionally posts the reply to a named channel. Each tick re-reads the content file so edits land on the next tick without restarting the daemon. Use cases: "every hour, check whether the staging build is red over an hour and message me if so"; "every 6h, summarise GitHub issue mentions and post to the team Slack". Same PR also wires reversible condensation (CCR) — destructive condensers (JSON shrink, shell-output filters) stash the original under a freshtool_output_gethandle and append a footer naming it, so the model defaults to the structural view but can recall the verbatim bytes via one tool call. (#232) - 2026-06-10 — Three feature batch: (1)
send_messagemodel-facing tool — post a message to a named, operator-configured channel mid-task (channels[]inconfig.json); the model can only reach endpoints the operator pre-declared (no model-supplied URLs). (2) ~14 more per-command shell-output condenser families: compile walls (cargo build/check/clippy), linters (eslint stylish), package managers (npm install/pip install), build systems (mvn/gradle), IaC (terraform plan/apply), tabular CLIs (docker ps,kubectl get,gh), JSON output (aws). (3) Promptware defense — substring-pattern scan over three indirect-input chokepoints (tool output, recalled memory, stored skills) with annotate-don't-block semantics for chokepoints 1-2 and suppress-outright for SKILL.md descriptions; rule families cover instruction overrides, fake system prompts, concealment, system-prompt exfiltration probes, curl-pipe-to-shell. (4) Task-aware MEMORY.md slicing viaorient_task_aware: true— slice each memory file into markdown sections, score against the current task by lexical overlap, inject only the sections that score > 0. (#230) - 2026-06-09 —
pasclaw /goalRalph loop with judge model: auto-continues turn after turn until a judge model verdict ofMET/FAILED/CONTINUEis reached. Atlas-style "ralph wiggum" pattern — keep nudging the agent until the goal is provably done. Same PR also adds a JSON-aware tool-output condenser that collapses MCP search responses into structural summaries while preserving keys (so the model can still reason about the shape). (#223) - 2026-06-09 —
/undowired intopasclaw agent(interactive) and the sample dprojs (was TUI-only). (#222) - 2026-06-09 — Checkpoints: auto-snapshot files BEFORE
fs_write/fs_edit_hashlineoverwrites them; TUI/undoreverts the last edit (opt-in viacheckpoints.enabled: true). Snapshot store underworkspace/checkpoints/<session>/<seq>.json; dedupe within a turn so multi-edit sequences don't snapshot the same file twice. (#221) - 2026-06-09 —
pasclaw mcp catalog: lenient hub-projector accepts the slim summary shape the pasclaw.dev MCP hub returns (previously rejected 10 of 39 entries as "non-HTTP transports not supported" when those entries were actually fine). (#220) - 2026-06-09 —
pasclaw mcpaccepts SSE-tagged, Streamable HTTP, and stdio hub transports (was HTTP-only). The 10 previously-dropped entries become installable. (#219) - 2026-06-09 — Inbound MCP server mode:
pasclaw gateway(and the newpasclaw mcp stdiosubcommand) serve PasClaw's curated tools (memory_search,kb_search,SCARS, etc.) over MCP so other agents (Claude Code, Cursor, etc.) reach PasClaw's state live. The inbound MCP server defaults to read-only;--mcp-allow-writeopts in to mutating tools.--mcp-port <p>spawns a second listener on the named port that honours only MCP routes plus/v1/health(isolation for different firewall rules). (#218) - 2026-06-09 —
pasclaw onboardoffers to index documents into the knowledgebase as part of setup. (#217) - 2026-06-09 — Knowledgebase: RAG over operator-curated documents (
pasclaw kb add ~/docs/). FTS5 BM25 ranking by default; auto-upgrades to hybrid keyword + vector with Reciprocal Rank Fusion when the local embedding runtime is provisioned (pasclaw memory provision— same sqlite-vec + ONNX Runtime + MiniLM artifactsmemory_searchuses). Two read-only tools (kb_search/kb_get) auto-register once at least one source is registered. Documents are indexed in place (never copied) intoworkspace/kb.db. Supports markdown, plain text, HTML, and common source-code extensions; PDFs require external conversion. Unlikememory_search, the KB does NOT re-index on every query —pasclaw kb syncis the explicit refresh, keepingkb_searchfast on large corpora. (#214) - 2026-06-10 — TUI: subagents wired in (
spawn+ the background quartet register when config.json declares subagents — previously CLI-agent-only) and the/stats+/modeloverlays no longer flicker over the session pane (the every-50ms repaint painted pane content then the overlay box on top each tick; panes now freeze while these static modals are up; the/thememenu keeps live repaint for its preview). - 2026-06-10 — Background subagents (Claude Code shape):
spawn_background(agent, prompt)returns a handle and the parent loop keeps working; when the job finishes its result is pushed into the next loop iteration as a[background subagent results]block in the system prompt (same channel steering and compaction use). Companion tools:spawn_status(handle),spawn_wait(handle, timeout_sec),spawn_cancel(handle). Up to 4 concurrent jobs per session; each runsRunToolLoopagainst a filtered child registry on its own thread. Jobs die with the session — coordinator teardown abandons still-running workers and they self-free. Synchronousspawnfrom PR #93 is unchanged. - 2026-06-10 —
session_searchtool: FTS5 keyword search over the full text of every SAVED session, not just the current one (hermes-agent'ssession_search). Index lives atworkspace/sessions/.search.db, lazily rebuilt from the JSON transcripts (reindexes a session only when itsUpdatedAtadvances). Returns session id + title + snippet + BM25 score with apasclaw resume <id>hint per hit. Gateway stat buckets are excluded. Reusesmemory_search's FTS query normaliser so both tools treat a query identically. (Fetched-doc search — the other half of the original gap — was already covered:memory_fetchwrites intoworkspace/memory/whichmemory_searchalready indexes.) - 2026-06-10 — Tool-RPC callback from
execute_code: inside a bash/PowerShell script the model can call back into the same tool registry it's been given viapasclaw __tool <name> '<json-args>'. Replaces N + 1 + N inference rounds (list → loop fs_read each → summarise) with a singleexecute_codewhose script body calls memory_search / fs_read / web_fetch as many times as it likes. Loopback TCP server on a kernel-allocated port + token authentication; connection info written to$PASCLAW_HOME/run/tool-rpc.json. - 2026-06-09 — Gateway stats buckets: stateless
/v1/chat,/v1/chat/completions, and/v1/responsescalls now accumulate per-endpoint into synthetic session files (_gateway_v1_chat_completions.jsonetc.) so the web UI Stats tab actually ticks up when the operator uses the web chat (previously gateway requests had no session and showed zero). Each endpoint gets one bucket; concurrent calls serialised through a single critical section. - 2026-06-09 — Auto-router (UltraCode-Shim shape): heuristic classifies each user message as easy/abstain/hard from keyword markers + token count + tool mix, and routes "easy" turns to a cheap-tier fallback provider while leaving real work on the primary. Opt-in via
auto_router.enabled(onboarding asks); the primary is automatically prepended to the fallback chain on routed turns so a misclassification falls through cleanly. - 2026-06-09 — Per-session stats persistence +
/v1/statsendpoint + web UI Stats tab. Opt-in viastats_collection_enabled(default off; onboarding prompts). When on, each turn's token / tool-call / truncation-savings counters accumulate into the session JSON; the gateway exposes a 5-second-cached aggregate atGET /v1/statswithby_providerandby_modelrollups; the web UI renders an auto-refreshing Stats tab. TUI/statsoverlay is unchanged (it keeps its own in-process accumulator and works regardless of the flag). - 2026-06-09 —
execute_codetool: model writes a multi-line bash or PowerShell script, body is materialised to a temp file under$PASCLAW_HOME/tmp/and run by the right shell. Cuts inference rounds on fan-out / loop / heredoc patterns that would otherwise need N separateshell_execcalls. Same sandbox + denylist gate asshell_exec. - 2026-06-09 —
pasclaw runbookasks the agent to probe the current project and write a starter./AGENTS.md(project overview, build / test commands, repo layout, conventions, gotchas). Refuses to clobber an existingAGENTS.mdwithout--force; pairs withexecute_codeso the probe is one tool call instead of a dozen. - 2026-06-09 —
pasclaw learn --write-scarsemits / refreshesworkspace/memory/SCARS.mdwith Atlas-style stable§ANCHOR-NAMEids per recurring failure (citable from commits and PRs viagit log --grep "§"); operator-edited Root-cause / Do / Do-NOT rationale survives re-runs. - 2026-06-09 —
pasclaw export [agents|claude|cursor|gemini|zed|all]renders the operator's MEMORY.md + SCARS.md + skill manifests + sandbox policy into the rules files Claude Code (CLAUDE.md), Cursor (.cursor/rules/agent.mdc), Gemini CLI (GEMINI.md), Zed AI (.zed/agent.md), and the cross-runtimeAGENTS.mdconvention already look for at the repo root, so teammates using a different agent runtime pick up the same project rules without installing PasClaw. - 2026-06-08 — Server-side
call_id→thoughtSignaturecache on/v1/responsesso stock OpenAI-Responses clients (Codex CLI etc.) round-trip Gemini 3's signed function calls across turns even when they strip PasClaw'sprovider_signatureextension. (#194) - 2026-06-08 —
memory_fetchURL auto-dedup: a second fetch against the same URL inside 24h short-circuits the HTTP and returns the cached path. (#192) - 2026-06-08 —
pasclaw learnmines session transcripts for recurring tool failures, normalises into clustering signatures (paths/pids/hashes stripped), reports patterns above--min-sessions, optionally appends a dated block toMEMORY.md. (#190) - 2026-06-08 — Per-command shell output filters with tee-on-failure:
git status/diff/log,pytest/cargo test/npm test,grep/Select-String/findstr,ls -R/Get-ChildItem/dir /s. Cross-shell dispatch normalises PowerShell / cmd.exe / shell wrappers. Counters surface in TUI/stats. (#189) - 2026-06-08 — In-browser wasm build via container2wasm:
make C2W=1 browserproduces a single-page agent UI with fetch-proxy networking, onboarding and chat run inline in the tab. (#185, #186, #187, #188) - 2026-06-08 — TUI session pane sorted newest-first by
UpdatedAt, assistant markdown rendered as ANSI in the chat pane,pasclaw tuiresumes the newest session on launch, no sort drift on session-pane navigation. (#182, #184) - 2026-06-08 — Context-mode follow-ups:
memory_fetchtool (writes URL bodies toworkspace/memory/fetched-*.md, body never enters context), per-session working-state snapshot (recent edits / shell / errors) re-injected as system-prompt prefix after compaction, think-in-code steering rule. (#180) - 2026-06-08 — Per-tool-result output truncation cache (
tool_output_capconfig) withtool_output_get(handle, offset, len)retrieval; TUI/statsoverlay shows token totals, truncation savings, per-tool call counts. (#176) - 2026-06-07 — Live
/v1/modelsdiscovery with on-disk cache keyed on operator-facing provider name, onboarding picker, TUI/modelmodal switcher (Up/Down/Enter, FPC line-based fallback) with inline auto-refresh when the cache is empty. (#171, #173, #175) - 2026-06-06 — Hybrid FTS5 + local-vector
memory_searchbackend with in-tree localvector port and apasclaw memory provisioncommand that fetches sqlite-vec, ONNX Runtime, and the MiniLM embedder. (#165, #166) - 2026-06-06 — Catalog adds xAI (Grok) + LM Studio entries; Moonshot default bumped to
kimi-k2.6. (#163) - 2026-06-06 —
vector_search_enabledconfig flag + onboarding question for the hybrid memory backend. (#164) - 2026-06-05 — Gemini server-side
google_searchgrounding, default-on with Gemini-3-or-later gating for the function-calling combo. (#158) - 2026-06-05 — Gemini 3
thoughtSignatureround-trip onfunctionCallparts for tool-use continuations. (#154) - 2026-06-05 — Markdown rendered as ANSI-styled text in the terminal for agent + TUI surfaces. (#155)
- 2026-06-05 — OpenAI server-side
web_search_optionssupport, default-on for genuine OpenAI endpoints only. (#146) - 2026-06-05 —
web_fetchtool gated behind explicitweb_fetch_enabledopt-in. (#144) - 2026-06-04 — pasclaw.dev Code Vault tools (
vault_search/vault_get) for Object Pascal sample discovery. (#130) - 2026-06-04 — MCP catalog + hub with one-command built-in server installs. (#131, #134)
- 2026-06-04 — Onboarding prompt for built-in MCP servers. (#126)
- 2026-06-01 — TUI themes, widgets, and chat layout polish. (#122, #123, #124)
- 2026-06-01 — Docker image and Dockerfile for containerised deployment. (#121)
- 2026-06-01 — Persistent sessions, resume, and mid-loop
steerfollow-ups. (#117, #120) - 2026-06-01 — Anthropic prompt-caching toggle with TTL config. (#118)
- 2026-06-01 — Channel sender identity + allowlist gating. (#119)
- 2026-06-01 — Windows ARM64 cross-build target. (#115)
- 2026-06-01 — Agent hooks and steering API. (#113)
- 2026-05-30 — Tier-1 features: parallel tool dispatch, code-driven provider config, Delphi sample projects. (#98, #96, #95, #101)
- 2026-05-30 — MCP catalog of built-in servers. (#91)
- 2026-05-30 — Web UI with chat / sessions / memory / MCP / skills / vault tabs. (#88)
- 2026-05-29 — Channels: Matrix + IRC + WhatsApp + LINE bots in addition to Telegram. (#75, #76, #77, #86)
- 2026-05-29 — Web search across DuckDuckGo / Brave / Tavily / SearXNG / Perplexity / Gemini. (#80, #81, #82)
- 2026-05-29 — SSRF guard blocking cloud-metadata + RFC1918 + loopback in
web_fetch. (#85) - 2026-05-29 — Workspace sandbox with
cd-gating and shell denylist. (#84) - 2026-05-29 — Cron persistent state + per-job channel sinks. (#79)
- 2026-05-29 — FTS5-backed
memory_searchtool. (#74) - 2026-05-28 — OpenAI Responses API on the gateway. (#62)
- 2026-05-28 — Skills system:
SKILL.mdmanifests, GitHub install, ClawHub install. (#55, #56, #59) - 2026-05-28 — Gemini provider (generateContent REST). (#48)
- 2026-05-27 —
pasclaw serve— OpenAI-compatible HTTP server with SSE streaming. (#20) - 2026-05-27 — Provider catalog (19+ kinds: Anthropic, OpenAI, Groq, OpenRouter, Mistral, ...). (#40)
- 2026-05-27 — Delphi visual component (
TPasClawAgent). (#37) - 2026-05-27 — Hashline diff format port for
fs_edit_hashline. (#26) - 2026-05-27 — TUI (full-screen interactive console). (#24)
- 2026-05-26 — Initial Delphi/FPC port of picoclaw. (#2)
- Free Pascal 3.2+ in Delphi mode, or Delphi/RAD Studio.
- Indy (
TIdHTTP,TIdHTTPServer) for HTTP clients, the gateway, and channel integrations.- FPC builds vendor Indy into
vendor/Indy. - Delphi/RAD Studio ships Indy, so no vendored Indy checkout is required.
- FPC builds vendor Indy into
- TaurusTLS (Linux FPC builds): Indy's TLS handler for OpenSSL 3 and 4, vendored into
vendor/TaurusTLSbymake get-taurustls.
Open src/pasclaw/PasClaw.dproj in Delphi/RAD Studio and build the project. The checked-in Delphi project already contains the project search paths.
On Windows, you can optionally build from a RAD Studio command prompt with:
build-delphi.batThe batch file uses MSBuild with the existing Delphi project when available, and falls back to the installed Delphi command-line compiler.
See fpc.md for detailed FPC prerequisites, Indy vendoring, resource generation, Makefile targets, and variable overrides.
On Windows, you can optionally build with:
build-fpc.batPasClaw stores configuration as JSON. By default:
- Home directory:
~/.pasclaw - Config file:
~/.pasclaw/config.json - Default provider:
anthropic - Default model:
claude-opus-4-7 - Gateway bind address:
127.0.0.1 - Gateway port:
8088 - Gateway log level:
info
Environment variables:
| Variable | Purpose |
|---|---|
PASCLAW_HOME |
Overrides the PasClaw home directory. |
PASCLAW_CONFIG |
Overrides the config file path. |
PASCLAW_VERSION |
Compile-time FPC version override used by the Makefile. |
PASCLAW_TELEGRAM_TOKEN |
Default Telegram bot token for pasclaw gateway --telegram. |
PASCLAW_LINE_TOKEN |
LINE Messaging API channel access token. Used by pasclaw post line and pasclaw gateway --line. |
PASCLAW_LINE_SECRET |
LINE channel secret. Required by pasclaw gateway --line to verify X-Line-Signature on inbound events. |
PASCLAW_WHATSAPP_TOKEN |
WhatsApp Cloud API system-user access token. Used by pasclaw post whatsapp and pasclaw gateway --whatsapp. |
PASCLAW_WHATSAPP_PHONE_ID |
WhatsApp phone-number ID (the numeric ID, not the phone number itself). |
PASCLAW_WHATSAPP_VERIFY_TOKEN |
User-chosen string used to verify Meta's GET /webhooks/whatsapp subscription handshake. |
PASCLAW_WHATSAPP_APP_SECRET |
Meta App Secret used to validate X-Hub-Signature-256 on inbound events. |
PASCLAW_BRAVE_API_KEY |
Brave Search API key for the web_search tool when web_search.provider = brave. |
PASCLAW_TAVILY_API_KEY |
Tavily API key for the web_search tool when web_search.provider = tavily. |
PASCLAW_SEARXNG_API_KEY |
Bearer token for protected SearXNG instances (most public ones don't need it). |
PASCLAW_PERPLEXITY_API_KEY |
Perplexity API key for the web_search tool when web_search.provider = perplexity. |
PASCLAW_GEMINI_API_KEY |
Google AI Studio key for the web_search tool when web_search.provider = gemini. PASCLAW_GOOGLE_API_KEY works too. |
PASCLAW_MATRIX_HOMESERVER |
Matrix homeserver base URL (e.g. https://matrix.org) for pasclaw gateway --matrix. |
PASCLAW_MATRIX_TOKEN |
Matrix access token (provisioned out-of-band via /login or the homeserver admin UI). |
PASCLAW_IRC_SERVER |
IRC server hostname (e.g. irc.libera.chat) for pasclaw gateway --irc. |
PASCLAW_IRC_PORT |
IRC server port (default 6667). |
PASCLAW_IRC_NICK |
IRC nickname the bot connects with. |
PASCLAW_IRC_CHANNEL |
IRC channel to join on connect (must start with #). |
PASCLAW_IRC_PASSWORD |
Optional NickServ / server password. |
NO_COLOR |
Disables ANSI color output. |
Useful config commands:
pasclaw onboard # create/update home + workspace dirs, pick a provider + model + API key,
# then optionally enable any of the 5 built-in MCP servers inline
# (replicate, digitalocean-apps, digitalocean-databases, runpod-docs, huggingface)
pasclaw config # print current JSON config
pasclaw config path # print resolved config path
pasclaw config reset # write a default configGlobal flags:
pasclaw --help
pasclaw --no-color status
NO_COLOR=1 pasclaw statusTop-level commands are dispatched by src/cmd/PasClaw.Cmd.Root.pas:
| Command | What it does |
|---|---|
onboard |
interactive setup wizard (provider + key, model, behavioural toggles) |
agent |
one-shot (-m "…") or interactive chat with the full tool loop |
tui |
full-screen two-pane terminal UI (Delphi build is positioned; FPC is line-based) |
gateway |
HTTP server: web UI + /v1/* OpenAI-compat API + inbound channel webhooks |
serve |
OpenAI-compatible API server (/v1/chat/completions, /v1/responses) |
resume <id> / session … |
resume / list / show / delete / export saved sessions |
steer <id> "…" |
push a follow-up into a running agent mid-loop |
model … / auth … |
view/switch the default model; provider login/logout/status |
mcp … |
add / list / test / catalog / search / install / sync MCP servers; stdio bridge |
skills … |
install (GitHub / hub / ClawHub) / search / list / pending / approve / reject |
vault … |
search / show / install pasclaw.dev Code Vault entries |
kb … |
add / sync / search / get / status for the RAG knowledgebase |
memory … |
provision / status for the local ONNX vector backend; migrate (re)indexes |
cron … |
add / list / enable / disable / remove scheduled skill jobs |
profile … |
list / show / use / diff / bench config profiles |
post / heartbeat |
one-shot channel post; proactive periodic daemon |
build / plan |
multi-iteration build / read-only plan with workspace.zip handshake (CI/cloud) |
init / runbook / export / learn |
scaffold AGENTS.md; render agent files; mine sessions for skills |
relay |
pull-worker that runs gateway inference jobs on your own hardware |
config / status / version / update |
inspect config; status dashboard; version; self-update |
| Command | Purpose |
|---|---|
config |
View or reset the JSON configuration. |
onboard |
Initialize PASCLAW_HOME, workspace folders, and provider settings. |
agent |
Chat with the assistant from the terminal. |
tui |
Chat in the full-screen TUI. |
auth |
Store, clear, or inspect provider API keys. |
gateway |
Start the full HTTP gateway, embedded web UI, cron scheduler, tools, MCP, and optional Telegram channel. |
serve |
Start the OpenAI-compatible API server surface. |
status |
Show provider, model, gateway, MCP, cron, and skill status. |
cron |
Manage scheduled tasks. |
mcp |
Manage MCP server entries. |
migrate |
Run data migrations for older versions. |
skills |
List, install, or remove skill extensions. |
model |
Show or change the default model. |
post |
Send a one-shot message to a Discord, Slack, Microsoft Teams, generic, LINE, or WhatsApp webhook target. |
membench |
Benchmark the memory log subsystem. |
update |
Check GitHub releases or self-update. |
version |
Print version/build information. |
pasclaw agent
pasclaw agent -m "hello"
pasclaw agent --model claude-opus-4-7 --provider anthropic -m "summarize this repo"
pasclaw agent --system "Be concise" --thinking medium --max-tokens 2048 --max-iterations 25
pasclaw agent --no-tools --no-mcp --no-hashline
pasclaw tui
pasclaw tui --session 20260601T093015-1a2b3c4d
pasclaw tui --provider openai --model gpt-4o-mini
pasclaw tui --theme matrix
pasclaw tui --no-tools --no-mcp --no-hashlineThe Delphi build of pasclaw tui paints a positioned two-pane layout (MVCFramework.Console-backed, default theme ConsoleThemeDefault): session list on the left, chat history + input on the right, header bar with provider/model/clock, footer bar with focus-aware hotkeys. Tab swaps focus between panes; in the session pane Up/Down navigates, Enter loads, N spawns a fresh session, D then Y deletes (one-key confirm), R refreshes the list. In the chat pane typing fills the input; Enter sends the turn (which runs in a background thread so the UI keeps redrawing — spinner shown in the divider above the input); Up/Down scrolls the chat back. If a follow-up is sent while a turn is still running it's queued via pasclaw steer automatically. Pending steering count is shown in the chat divider next to the spinner. Q or Escape quits. The FPC build of pasclaw tui stays on the original line-based ANSI renderer (no session list pane yet).
Theme switcher — --theme <name> picks the initial colour theme; type /theme inside the TUI to open a modal menu with Up/Down live-preview, Enter to apply, Escape to revert. Themes are the ones DMVCFramework ships: default (default), navy, matrix, sunset, ocean, midnight, classic. Unknown names fall back to default silently. Changes don't persist across runs — pass --theme next time, or wire a config field in a follow-up.
Model switcher — type /model inside the TUI to open a modal picker of the cached /v1/models roster for the session's provider (falls back to Cfg.DefaultProvider). Up/Down navigates, Enter applies, Escape cancels. The picker reads the cache file populated by pasclaw model refresh <provider> / pasclaw onboard, and the modal's subtitle shows how stale that cache is. Picking a model updates the active session's meta.model (persisted on the next turn's auto-save) but does not touch config.json — use pasclaw model set for that. When the cache is empty or missing, the TUI auto-refreshes inline: it flashes fetching models from <provider>..., runs /v1/models on a background thread (so the UI stays responsive), writes the cache, and opens the picker when the worker completes. Failures flash an error and leave you on the existing screen. The 15-second wall clock guards against a stuck HTTP. The FPC build exposes /model as a line-based command with the same cache-first → fetch-fallback behavior, but synchronous (line-based UI doesn't fight a render thread): bare /model prints the cached list and current selection (fetching live if no cache exists), /model <id> switches the active model for the running TUI.
Tool output truncation — large tool outputs (recursive greps, multi-thousand-line file reads, web fetches) routinely dump 20-50 KB of raw bytes into the context window; after a dozen of those, the bulk of the budget is tool noise the model rarely needs in full. Set tool_output_cap in config.json to a byte cap (e.g. 8192 ≈ 2K tokens) and RunToolLoop diverts oversize tool results into a process-lifetime cache, replacing the in-context body with [tool output truncated: N bytes, handle=...] plus a head/tail snippet. The model dereferences via the auto-registered tool_output_get(handle, offset, len) tool when it actually needs the rest. 0 (default) is off — legacy verbatim behavior. Errors stay verbatim regardless of cap (they're short and the head/tail split would just obscure the failure).
Shell-output filters — shell_exec is the loudest tool: git status, cargo test, pytest, npm test, recursive greps, and recursive listings all spew kilobytes of mostly-noise on the success path. PasClaw.Tools.Shell.Filters runs each successful shell return through a per-command condenser that keeps the signal (failure traces, counts, the first few changed paths) and drops the rest. Covered families: git status/diff/log; test runners (pytest, npm/pnpm/yarn/cargo test, go test); grep; recursive listings (ls -R, find); tabular CLIs (docker ps/images, kubectl get, gh pr/run/issue/release lists); docker build (classic + BuildKit); log tails (docker logs, kubectl logs/describe); compile walls (cargo build/check/clippy — clippy warnings exit 0, so they're kept verbatim while the Checking spam collapses); linters (eslint stylish reporter, per-file aggregation); package managers (npm install/ci, pip install); build systems (mvn [INFO] walls, gradle/gradlew task noise); IaC (terraform plan/apply — resource headers + Plan: summary survive, attribute diffs collapse); and aws (JSON output routes through the shared PasClaw.Condense.JSON engine). The dispatcher canonicalises PowerShell aliases (Get-ChildItem/gci/dir → ls, Select-String/sls/findstr → grep, Get-Content/gc/type → cat), collapses pip3→pip, npm i→npm install, ./gradlew→gradle, and peels sudo/npx plus shell wrappers (powershell -Command "...", cmd /c ..., bash -c "...") so the same filter fires whether the model is talking to Linux/macOS or Windows. Tee-on-failure: when the command exits non-zero, the filter is bypassed entirely — the model gets the full output for debugging. Unknown commands always pass through (no surprises for one-off invocations). Filtered byte savings surface in the TUI /stats overlay alongside the OutputCache numbers. Inspired by rtk-ai/rtk.
Promptware defense — a substring-pattern scan (PasClaw.Promptware) guards the agent's three indirect-input chokepoints against prompt injection: (1) tool output — every successful tool result is scanned in RunToolLoop after JSON condensation; (2) recalled memory — memory_search snippets, which re-enter the context looking like the agent's own trusted notes; (3) stored skills — SKILL.md descriptions that get advertised verbatim inside the system prompt. Hits on chokepoints 1–2 are annotated, not blocked: a [promptware-warning] banner naming the matched rule and source is prepended so the model treats the content as untrusted data (false positives — e.g. a security blog post quoting an injection — still reach the model intact below the banner). Chokepoint 3 suppresses the flagged description outright (a banner inside the system prompt would sit in the model's most trusted real estate) and logs a pointer to the SKILL.md for operator inspection. Rule families: instruction overrides ("ignore previous instructions"…), fake system prompts (<|im_start|>, "your new instructions are"…), concealment ("do not tell the user"…), system-prompt exfiltration probes, and curl-pipe-to-shell droppers (two-substring rule: curl alone never fires). On by default — it's a lowercase substring scan over bytes already in memory; "promptware_enabled": false in config.json opts out. Inspired by hermes-agent's promptware defense.
Task-aware orientation — by default the whole of MEMORY.md + today's + yesterday's daily notes are injected into every system prompt; as memory grows, most of it is irrelevant to any given task and front-loads the model's attention with noise. With "orient_task_aware": true in config.json, PasClaw.Agent.Orient slices each memory file into markdown-heading sections (paragraph blocks for headingless prose), scores each section against the current task by distinct-token overlap (lowercased, stopword-stripped, length ≥ 3 — deliberately lexical: this runs synchronously in prompt assembly and must not depend on the vector stack's provisioned weights), and injects only the sections that score > 0 — original document order preserved, 4 KB budget per file, with an (N sections elided — memory_search reaches them) note so the model knows what it isn't seeing. The task hint is the current user message (one-shot -m, each interactive turn, each /goal turn); call sites without a clear task (gateway requests, embedders that don't pass one) keep verbatim whole-file injection regardless of the flag. Off by default on every profile — opt in per-run with pasclaw agent --orient (--no-orient forces it off) or persistently with "orient_task_aware": true. Inspired by Abbasi-Alain/atlas's orient step.
Reversible condensation (CCR) — the JSON condenser and the shell-output filters are destructive by default: a 200 KB MCP search response collapses to a 4 KB structural summary the model can reason about, but the original bytes are gone. With "condense_reversible": true (the default), whenever a condenser actually shrinks the output PasClaw stashes the original under a fresh tool_output_get handle and appends a [condensed N -> M bytes; full original at handle="..." via tool_output_get] footer to the in-context result. The model defaults to the structural view; when the shape isn't enough — debugging a specific row in a collapsed table, reading the elided middle of a long file — it calls one tool and gets the verbatim bytes back. Same PasClaw.Tools.OutputCache store the byte-cap truncation already uses; tool_output_get now registers whenever either feature is on. Set "condense_reversible": false to revert to the destructive behaviour. Inspired by chopratejas/headroom's CCR (compressed-context retrieval).
Heartbeat — proactive periodic wake-up — off by default; opt in via pasclaw onboard. A standalone pasclaw heartbeat daemon reads workspace/heartbeat.md every N minutes (default 30), runs the full agent loop on the file's body as the user message, and optionally posts the reply to a named channel from config.json's "channels" array (same channel name format send_message uses). The whole subsystem is gated on "heartbeat": {"enabled": true, "interval_mins": 30, "channel": "ops"} — without that, pasclaw heartbeat refuses to start unless --force is passed. Use cases the picoclaw / openclaw heartbeat exists for: "every hour, check whether the staging build is red over an hour and message me if so", "every 6h, summarise GitHub issue mentions and post to the team Slack", "every 30 min, run kb sync and report what changed". Each tick re-reads the content file from disk, so edits land on the next tick without restarting the daemon. Empty or missing file = skip the tick (no spurious model call). Inspired by sipeed/picoclaw's heartbeat.md polling and openclaw's heartbeat manifest.
Shell backends (local | docker) — shell_exec and execute_code dispatch through an IShellBackend interface so the operator can pick where commands actually run. Local (default) is /bin/sh -c in the host process — the legacy behaviour. Docker ("shell_backend": "docker" in config.json or --backend docker per-run) spawns a per-session container at session start, docker execs into it for every shell call, and stops it at session end. The workspace is bind-mounted at the same path inside the container, so fs_read/fs_write from the host process and cat/tee from inside the container reference the same files — operators inspect from outside with ls ~/.pasclaw/workspace/, no path translation. Hardening win: even a model that escapes the ShellAllowed denylist can only touch the container, not the host filesystem; ~/.pasclaw/config.json (provider keys) is deliberately not mounted in. Image / network / privileged / user are configurable; the default debian:bookworm-slim is small and universally available. Onboarding asks once; CLI override --backend docker|local doesn't persist. Phase 1 wires this for pasclaw agent (interactive + one-shot) and pasclaw heartbeat; pasclaw tui / pasclaw serve / pasclaw gateway refuse docker cleanly until per-session container handoff inside those long-running surfaces lands. SSH backend is Phase 2. Inspired by openclaw's six terminal backends and hermes-agent's execution-environment plumbing.
pasclaw learn — session-failure mining — walks $PASCLAW_HOME/workspace/sessions/*.json and scans every mrTool message for failure-shaped lines (error:, command not found, permission denied, no such file, non-zero exit=, etc.). Each candidate normalises into a clustering signature that strips per-session variability — digit runs ≥ 2 collapse to <n>, hex runs ≥ 8 (with at least one letter) to <hash>, absolute paths to <path> — so "fs_write to /tmp/abc123/foo.pas line 42 failed" and "fs_write to /tmp/xyz789/foo.pas line 17 failed" cluster as one pattern. Patterns above --min (default 2 occurrences) print sorted by frequency with the tool that triggered them, a verbatim sample, and a first/last-seen window. --write appends a dated ### Patterns observed block to workspace/memory/MEMORY.md so the next agent loop picks it up via the system prompt. --write-scars additionally emits workspace/memory/SCARS.md with Atlas-style stable §ANCHOR-NAME ids per pattern — citable from commit messages and PRs via git log --grep "§" so a fix links back to the failure it addresses; operator-edited Root-cause / Do / Do-NOT rationale survives re-runs (only new patterns get fresh anchor blocks). --since <days> limits the scan window so old sessions don't keep resurfacing fixes the operator has already applied. Inspired by chopratejas/headroom's headroom learn (mining + MEMORY.md) and Abbasi-Alain/atlas (SCARS anchor convention).
pasclaw export — cross-runtime adapter — renders PasClaw's MEMORY.md, SCARS.md, skill manifests, and sandbox policy into the rules files other agent runtimes already look for at the repo root, so a teammate using Claude Code, Cursor, Gemini CLI, Zed AI, or any AGENTS.md-aware tool gets the same project context without installing PasClaw. pasclaw export (default all) writes ./AGENTS.md, ./CLAUDE.md, ./.cursor/rules/agent.mdc (with the YAML alwaysApply: true frontmatter Cursor requires), ./GEMINI.md, and ./.zed/agent.md; single-target form (pasclaw export claude) writes just one; --stdout prints the rendered body for piping; --to <dir> targets a directory other than CWD. Each generated file carries a <!-- generated by: pasclaw export --> marker on the first line — re-runs clobber, hand-edits belong in the source under $PASCLAW_HOME/workspace/. Inspired by Abbasi-Alain/atlas's sidecar-export approach.
pasclaw runbook — bootstrap AGENTS.md — one-shot agent invocation that probes the project (top-level layout, Makefile / package.json / Cargo.toml / etc. for build + test commands, recent git history) and writes a starter ./AGENTS.md covering project overview, build, test, repo layout, conventions, and gotchas. Refuses to overwrite an existing AGENTS.md without --force; --to <file> targets a different filename. Pairs with the new execute_code tool so the probe is one tool call (the model writes a multi-line bash script) instead of a dozen separate shell_exec rounds. Use after pasclaw onboard on a fresh repo, before pasclaw export curates the file with PasClaw-internal state.
execute_code tool — model writes a multi-line bash or PowerShell script body via execute_code({lang, code}); PasClaw materialises the body to a temp file under $PASCLAW_HOME/tmp/exec-*.{sh,ps1}, spawns the right shell (bash <file> on unix, pwsh -NoProfile -ExecutionPolicy Bypass -File <file> on Windows), captures combined stdout+stderr, and cleans up the file. Borrowed conceptually from picoclaw's Python execute_code (bash/powershell instead of Python because both already ship with the host OS — no extra install). The same PasClaw.Tools.Sandbox.ShellAllowed denylist that gates shell_exec runs against the script body, so a buried rm -rf / inside a heredoc gets refused identically to the same string passed inline. Cwd is pinned to the workspace when sandbox.restrict_to_workspace is on, same as shell_exec. The big win: fan-out patterns (list every *.pas, grep each for a symbol, summarise hits) that would take 1+N+1 inference rounds under shell_exec (because the model can't comfortably escape a for loop into a single-line command) collapse to one tool call. Output runs through the tool_output_cap truncation cache, same as every other tool. Inside the script the model can also call back into the same tool registry via pasclaw __tool <name> '<json-args>' — see the next paragraph.
Tool-RPC callback (pasclaw __tool) — when execute_code spawns a script, PasClaw starts a loopback TCP server on a kernel-allocated port and writes the port + a fresh 32-hex-char token to $PASCLAW_HOME/run/tool-rpc.json. The hidden pasclaw __tool <name> '<json-args>' subcommand (not in --help) reads that file, opens TCP, sends {"token":"...","name":"...","args":{...}}, prints the result on stdout. Inside an execute_code script the model can therefore drive arbitrary tool fan-out without re-entering the LLM: for f in $(pasclaw __tool fs_list '{"path":"src/"}' | jq -r .files[]); do pasclaw __tool memory_search "{\"q\":\"$f\"}"; done. Same registry the model is using, same sandbox + denylist + output-cap path; bad tokens get rejected at the wire level, missing info file produces an actionable error. The killer use case is "list every *.pas under src/, grep each for symbol X, build a CSV" — pre-PR: 1 + N + 1 inference rounds; post-PR: one execute_code call.
Stats overlay (TUI) — type /stats inside the TUI for a read-only modal showing per-session token totals (in/out/cache), turn count + wall-clock elapsed, truncation count + bytes saved, OutputCache handles held, and per-tool call counts (top 8 rendered). Pairs with tool_output_cap so the savings are visible — type /stats after a long session, see the bytes saved climb. Any key dismisses the overlay. The overlay uses an in-process accumulator and works regardless of stats_collection_enabled.
Stats persistence + web UI (gateway) — flip stats_collection_enabled in config.json (or answer "y" during pasclaw onboard) to persist per-turn counters into each session JSON's meta.stats block: input_tokens, output_tokens, cache_read_tokens, cache_created_tokens, turns, tool_calls, truncation_bytes_saved. The gateway exposes a 5-second-cached aggregate at GET /v1/stats returning the same fields summed across every session in $PASCLAW_HOME/workspace/sessions/, plus by_provider and by_model rollups (so the operator can see "OpenAI ate 70% of my tokens this week"). The web UI's Stats tab auto-refreshes every 10s and renders the cards + rollup tables; when the flag is off the panel shows a hint pointing at the config flag rather than a wall of zeros. Default off: per-session JSONs of flag-off operators are byte-identical to the pre-feature schema.
The gateway's own stateless API endpoints (/v1/chat, /v1/chat/completions, /v1/responses) accumulate into per-endpoint synthetic session files (_gateway_v1_chat.json, _gateway_v1_chat_completions.json, _gateway_v1_responses.json) so calls driven through the web UI chat or any other OpenAI/Anthropic-compatible client also show up in /v1/stats. Each endpoint gets one bucket regardless of model — Meta.Model tracks the most recent request's model, so the by_model rollup reflects the latest call rather than per-call breakdown for those buckets (trade-off chosen for simplicity; operators wanting per-model breakdown of API traffic can route through real sessions via pasclaw agent --session <id>). Concurrent gateway requests serialise the bucket update through a single critical section so two simultaneous turns don't race the file.
Auto-router (cheap-tier routing) — flip auto_router.enabled plus name a configured fallback in auto_router.easy_provider (or answer "y" to both onboarding prompts) and PasClaw classifies each user message before the loop fires. Three signals: (1) hard keyword markers like implement, refactor, debug, fix bug, write tests, optimize route hard outright; (2) token-count threshold (auto_router.easy_max_tokens, default 500) — anything longer routes hard; (3) tool-mix gate — when shell_exec / execute_code / fs_write are in the registry, ambiguous one-word messages (yes, continue) abstain because they might mean "now go run the script". Only when all three agree on easy AND the operator has explicitly enabled routing does the agent swap providers for that turn. The original primary is automatically prepended to the fallback chain on a routed turn, so a misclassified easy that the cheap provider fumbles falls back to the primary with no operator intervention. Each routed turn surfaces (routed -> <provider>, auto-routed) in the assistant header so it's never invisible.
pasclaw auth status
pasclaw auth login anthropic
pasclaw auth logout anthropic
pasclaw auth weixin
pasclaw model show
pasclaw model set claude-opus-4-7
pasclaw model add openai gpt-4o-mini
pasclaw model refresh anthropic # GET /v1/models → cache under $PASCLAW_HOME/cache/models/anthropic.json
pasclaw model refresh --all # refresh every configured provider in one shot
pasclaw model list openai # show the cached roster, newest firstauth login prompts for an API key and stores it in the matching provider entry. model set changes default_model; model add upserts a provider entry and records a model for that provider. model refresh hits the provider's live /v1/models endpoint (Anthropic / OpenAI / Gemini / xAI / Groq / OpenRouter / DeepSeek / Mistral / Moonshot / Cerebras / Ollama / vLLM / LM Studio — anything in the catalog), caches the result, and shows the count. pasclaw onboard runs the same fetch automatically once you've entered the API key and presents a numbered picker over the top 12 newest models — type a number, type a free-form name, or hit Enter for the catalog default. Discovery fails gracefully when the endpoint is unreachable (offline, behind a proxy, provider 5xx) and the onboarding flow falls back to the existing text input.
pasclaw mcp list
pasclaw mcp add filesystem npx -y @modelcontextprotocol/server-filesystem /tmp
pasclaw mcp add remote https://example.com/mcp
pasclaw mcp show filesystem
pasclaw mcp test filesystem
pasclaw mcp remove filesystem
pasclaw mcp edit
pasclaw mcp catalog # list public MCP servers PasClaw knows about
pasclaw mcp install <name> # add one from the catalog; auth from $ENV_VARMCP entries are stored in the config as mcp_servers. A command starting with http:// or https:// is tested with the HTTP MCP client; other commands are spawned with the stdio MCP client.
Catalog (curated public MCP servers; opt-in, never preloaded). pasclaw mcp install <name> writes a normal mcp_servers entry — list/remove/test/show all just work afterwards. Auth is read from the env var the catalog entry names; installing with the env unset writes an empty Authorization header and a hint to re-run after setting it.
| name | env var | provider |
|---|---|---|
replicate |
REPLICATE_API_TOKEN |
Run AI models (text/image/video/audio) on Replicate — 5000+ models. |
digitalocean-apps |
DIGITALOCEAN_TOKEN |
Manage DigitalOcean App Platform. |
digitalocean-databases |
DIGITALOCEAN_TOKEN |
Manage DigitalOcean Managed Databases. |
runpod-docs |
(none) | Search RunPod documentation. |
huggingface |
HF_TOKEN |
Search models / datasets / papers / Spaces. |
pasclaw cron list
pasclaw cron add daily-summary "0 9 * * *" summarize "workspace/memory"
pasclaw cron add ping-discord "*/15 * * * *" healthcheck "--channel discord:https://discord.com/api/webhooks/..."
pasclaw cron add line-status "0 * * * *" status_skill "--channel line:U1234abcd"
pasclaw cron disable daily-summary
pasclaw cron enable daily-summary
pasclaw cron remove daily-summaryEach cron entry persists its last successful fire time to $PASCLAW_HOME/workspace/cron/state.json so a missed slot (gateway down, laptop closed) catches up on the next tick instead of being silently skipped. Delivery is at-least-once: the state file is written after the skill runs (PasClaw.Cron.Scheduler.pas:175 runs the skill, :196 persists the timestamp), so a crash between those two steps will replay the job on restart. Idempotent skills are safe; side-effecting skills (sending emails, posting to channels) should self-deduplicate. Skill output is appended to workspace/memory/<today>.md for the model to recall on subsequent turns, and — if --channel <kind>:<target> was set — posted to the configured channel. Channel kinds: discord, slack, teams, webhook (URL is the target), line (target is userId, token from $PASCLAW_LINE_TOKEN), whatsapp (target is phone number, credentials from $PASCLAW_WHATSAPP_TOKEN + $PASCLAW_WHATSAPP_PHONE_ID).
pasclaw agent --session 20260601T093015-1a2b3c4d # resume by id (creates fresh if absent)
pasclaw resume 20260601T093015-1a2b3c4d # shorthand for the above
pasclaw session list # id, age, title, msg count for every saved session
pasclaw session show <id> # metadata + last 8 messages (head trimmed)
pasclaw session export <id> # raw JSON to stdout (pipe through `jq`)
pasclaw session delete <id> # remove the session fileSessions live as one JSON file per id under $PASCLAW_HOME/workspace/sessions/<id>.json. The file carries the full messages array (role / content / name / tool_call_id / tool_calls), the model + provider + title in meta, and any system_prompt_override left behind by /compact. pasclaw agent saves after each turn (atomic .tmp → rename), so killing the process mid-conversation is safe — pasclaw resume <id> picks up exactly where it stopped. /new inside an interactive session spawns a new id; /reset clears history in place and keeps the same id; /compact is persisted before returning to the prompt so a summariser pass survives an immediate /quit. The Delphi build of pasclaw tui uses the same store (session list pane reads ListSessions, the chat pane operates against the loaded TSession.Messages); the FPC build of pasclaw tui stays in-memory.
Two tools, both registered automatically alongside the filesystem and shell tools:
web_search(query, k?)— returns up to k results as title + URL + snippet. Dispatches to the configured provider; defaults to DuckDuckGo when nothing is set.web_fetch(url, max_chars?)— fetches anhttp://orhttps://URL and returns the response body as readable plain text (HTML tags stripped, entities decoded, whitespace collapsed, capped at 50 KB by default).
Provider is set under web_search in ~/.pasclaw/config.json:
{
"web_search": {
"provider": "brave",
"api_key": "",
"max_results": 5
}
}| Provider | API key needed? | Source |
|---|---|---|
duckduckgo (default) |
no | HTML scrape of html.duckduckgo.com/html/ |
brave |
yes — $PASCLAW_BRAVE_API_KEY overrides api_key |
api.search.brave.com/res/v1/web/search |
tavily |
yes — $PASCLAW_TAVILY_API_KEY overrides api_key |
api.tavily.com/search |
searxng |
no (most public instances); optional $PASCLAW_SEARXNG_API_KEY for protected ones |
<web_search.base_url>/search?format=json |
perplexity |
yes — $PASCLAW_PERPLEXITY_API_KEY overrides api_key |
api.perplexity.ai/chat/completions (Sonar model — returns one synthesised answer plus citation URLs) |
gemini |
yes — $PASCLAW_GEMINI_API_KEY (or $PASCLAW_GOOGLE_API_KEY) overrides api_key |
generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent with google_search grounding — returns one synthesised answer plus the ground-truth source URLs Gemini consulted |
Env-var values win over the api_key field so secrets can stay out of config.json. SearXNG additionally needs web_search.base_url set since every instance is self-hosted (e.g. "base_url": "https://searx.be").
A skill is a markdown manifest under $PASCLAW_HOME/workspace/skills/. The system prompt lists each installed skill (name + one-line description + path); the model reads the full body with fs_read when a matching task comes up. Skills tagged kind: shell or kind: prompt also register as a callable skill_<name> tool.
pasclaw skills list
pasclaw skills install owner/repo # GitHub repo root
pasclaw skills install owner/repo/path/to/skill # GitHub subdirectory
pasclaw skills install owner/repo/path/to/[email protected] # GitHub at a pinned ref
pasclaw skills install clawhub:code-review # ClawHub: latest version
pasclaw skills install clawhub:[email protected] # ClawHub: pinned version
pasclaw skills search "code review" # ClawHub: search the registry
pasclaw skills install my-skill # Legacy: record name in config.json
pasclaw skills remove my-skill # Delete workspace dir + config entryPasClaw accepts two layouts:
-
Per-directory
SKILL.md(preferred — same format picoclaw, nanobot, ClawHub, and Anthropic agent-skills use):workspace/skills/my-skill/ └── SKILL.md ← YAML frontmatter + markdown body--- name: my-skill description: One-line summary the model uses to pick the skill # Omit `kind` for knowledge-only skills (most common); set `kind: shell` # or `kind: prompt` to register a callable `skill_<name>` tool. --- # My skill Markdown body. The system prompt advertises this SKILL.md path; the model loads the full body with `fs_read` when the matching task comes up.
A copy-pasteable starter lives at
samples/skills/hello/SKILL.md. -
Legacy single
*.json(workspace/skills/<name>.json) — still loaded for backwards compat. Per-directorySKILL.mdentries shadow same-named JSON entries; new skills should use the directory layout. The JSON shape mirrors the frontmatter:{ "name": "my-skill", "description": "One-line summary the model uses to pick the skill", "kind": "shell", "schema": "{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}}}" }kindandschemaare only needed for callable skills; knowledge-only skills carry justname+description.
pasclaw skills install owner/repo[/path][@ref]:
- Fetches a zip snapshot from
codeload.github.com. - Extracts it via the bundled zip library —
Zipper.TUnZipperunder FPC,System.Zip.TZipFileunder Delphi. No tar dependency. - Locates
SKILL.mdat the requested subpath and validates it throughParseSkillMD. - Copies the containing directory tree into
$PASCLAW_HOME/workspace/skills/<dest>/, where<dest>is the last segment of the subpath, or the repo name when no subpath was given. - When
@refis omitted, triesmainfirst and falls back tomaster. - Refuses to overwrite an existing skill directory — run
pasclaw skills remove <name>first to reinstall.
pasclaw skills install clawhub:<slug>[@<version>] talks to ClawHub (https://clawhub.ai), the slug-based registry picoclaw and nanobot standardised on:
GET /api/v1/skills/<slug>— fetches metadata, surfaces moderation flags, and resolveslatestVersionwhen no@<version>is pinned.GET /api/v1/download?slug=<slug>&version=<version>— pulls the zip, then runs it through the samePasClaw.Skills.Zip+ParseSkillMDvalidation pipeline as the GitHub install path.- Malware-flagged skills are refused; skills flagged as suspicious install with a warning.
- Slugs are lowercase alphanumerics with
-or_. - The
clawhub:prefix is required. A bare slug-shaped name likemy-skillstill falls through to the legacyconfig.json-only record, so pre-Phase-3 install scripts keep working unchanged.
pasclaw skills search <query> hits /api/v1/search and prints slug / version / display-name / summary rows.
Subsequent phases will add scripts/ (callable helpers) + references/ (lazy-loaded context) runtime support.
pasclaw gateway
pasclaw gateway --addr 0.0.0.0 --port 8088
pasclaw gateway --telegram --token <BOT_TOKEN>
pasclaw gateway --line # also pass $PASCLAW_LINE_TOKEN + $PASCLAW_LINE_SECRET
pasclaw gateway --whatsapp # also pass $PASCLAW_WHATSAPP_{TOKEN,PHONE_ID,VERIFY_TOKEN,APP_SECRET}
pasclaw gateway --matrix # also pass $PASCLAW_MATRIX_HOMESERVER + $PASCLAW_MATRIX_TOKEN
pasclaw gateway --irc # also pass $PASCLAW_IRC_{SERVER,NICK,CHANNEL}
pasclaw gateway --no-tools --no-mcp --no-hashline
pasclaw serve
pasclaw serve --addr 0.0.0.0 --port 8088
pasclaw serve --debug
pasclaw serve --max-iter 40
pasclaw serve --no-tools --no-mcp --no-hashlineBoth commands use the same TGatewayServer implementation. gateway starts the full surface and can also run the Telegram long-poll channel. serve is a focused wrapper for OpenAI-compatible clients and prints copy-pasteable client configuration.
OpenAI-compatible client example:
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8088/v1", api_key="sk-pasclaw")
response = client.chat.completions.create(
model="claude-opus-4-7",
messages=[{"role": "user", "content": "hello"}],
)
print(response.choices[0].message.content)Curl examples:
curl http://127.0.0.1:8088/v1/health
curl http://127.0.0.1:8088/v1/tools
curl http://127.0.0.1:8088/v1/chat \
-H 'Content-Type: application/json' \
-d '{"message":"hello"}'
curl http://127.0.0.1:8088/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"model":"claude-opus-4-7","messages":[{"role":"user","content":"hello"}]}'
curl http://127.0.0.1:8088/v1/responses \
-H 'Content-Type: application/json' \
-d '{"model":"claude-opus-4-7","input":"hello"}'The gateway routes implemented in src/pkg/gateway/ are:
| Route | Method | Purpose |
|---|---|---|
/ |
GET |
Embedded single-page web UI from src/pkg/gateway/webui.html. Tabs for chat (with streaming + tool-call rendering + localStorage session history), memory browser, file browser, MCP servers, cron entries, skills, log tail (SSE), and a read-only config viewer. |
/v1 |
GET |
JSON index listing gateway routes. |
/v1/health |
GET |
Health check with PasClaw version. |
/v1/version |
GET |
Version and build metadata. |
/v1/status |
GET |
Default provider/model plus provider, MCP, cron, skill, and tool counts. |
/v1/tools |
GET |
Registered tool descriptors. |
/v1/context |
POST |
Token-estimated breakdown of what the next chat turn sends the model (system prompt sections, tool schemas, messages); the web UI's Context panel. See docs/gateway.md. |
/v1/rerank |
POST |
Order documents by relevance to a query: the local cross-encoder, the chat model, or a decision model where a recorded bench showed it does better. See docs/decision-models.md. |
/v1/mcp |
GET |
Configured MCP servers (name, cmd, args, enabled). |
/v1/cron |
GET |
Cron entries (id, spec, skill, args, channel_*, enabled). |
/v1/background |
GET |
Background jobs of every chat (spawn_background subagents, shell_background commands), running first; /v1/background/<handle> is one job's transcript or output, POST …/cancel stops it, POST …/message {"text"} continues a finished subagent as a new job. See docs/gateway.md. |
/v1/skills |
GET |
Installed skills (name, description, kind, path, dir). |
/v1/memory |
GET |
Files in workspace/memory/ with sizes. |
/v1/memory/<name> |
GET |
Contents of one memory file (rejects path-traversal). |
/v1/config |
GET |
Full config with providers[].api_key masked to •••. |
/v1/fs?path=… |
GET |
Directory listing (entries + sizes + dir flag); defaults to $PASCLAW_HOME/workspace. A relative path here and on the routes below means the agent's workspace, as it does for the file tools, so the chat's Files menu gets the file write_file("out.txt") wrote; the listing reports its path, workspace_root and cwd_root absolute. |
/v1/fs/read?path=… |
GET |
File contents capped at 256 KB; truncated flag on response. |
/v1/logs |
GET |
SSE tail of the gateway log buffer (1000-entry ring); recent buffer dumps first, then live. |
/v1/chat |
POST |
PasClaw JSON chat endpoint accepting {"message":"..."}. |
/v1/chat/completions |
POST |
OpenAI Chat Completions-compatible endpoint; supports streaming with stream: true. |
/v1/responses |
POST |
OpenAI Responses-compatible endpoint accepting string or message-array input; non-streaming only. |
/v1/models |
GET |
OpenAI-compatible model list containing the configured default model. |
When /v1/chat/completions runs with stream: true, the tool loop executes
server-side and each tool call is surfaced to the client as a visible
content delta in a Claude-Code-style transcript — the tool name with its key
argument, followed by a short result summary on the next line:
⏺ fs_read(README.md)
⎿ 312 lines, 12044 bytes — ¶README.md#a1b2
⏺ shell_exec(ls -la)
⎿ exit=0
Known tools (fs_read, fs_write, fs_list, fs_grep,
fs_edit_hashline, shell_exec, memory_search, web_search, web_fetch)
surface their most meaningful argument;
MCP and other tools fall back to a compact one-line dump of the raw
arguments. The full argument and result text also go to the SSE comment
lines (: tool_call ... / : tool_result ...) for consumers that log
structured activity, and to the server debug log when --debug is set.
The formatter lives in src/pkg/gateway/PasClaw.Gateway.ToolView.pas
(unit-tested via make test-toolview).
Manual /v1/responses verification examples:
# string input
curl http://127.0.0.1:8088/v1/responses \
-H 'Content-Type: application/json' \
-d '{"model":"claude-opus-4-7","input":"hello"}'
# message-array input
curl http://127.0.0.1:8088/v1/responses \
-H 'Content-Type: application/json' \
-d '{"model":"claude-opus-4-7","input":[{"role":"user","content":[{"type":"input_text","text":"hello"}]}]}'
# missing or empty input should return invalid_request_error
curl http://127.0.0.1:8088/v1/responses \
-H 'Content-Type: application/json' \
-d '{"model":"claude-opus-4-7","input":""}'
# streaming is intentionally unsupported on this route
curl http://127.0.0.1:8088/v1/responses \
-H 'Content-Type: application/json' \
-d '{"model":"claude-opus-4-7","input":"hello","stream":true}'Channel posting commands:
pasclaw post discord <webhook-url> "hello"
pasclaw post slack <webhook-url> "hello"TPasClawAgent (unit PasClaw.Agent) is a TComponent you can drop on a form or instantiate from code to embed the full agent — provider auth, tools, MCP, skills — inside a standalone Delphi or FPC binary, without shelling out to the CLI.
Code-driven (one-liner) form:
uses PasClaw.Agent, PasClaw.Tools;
var
Agent: TPasClawAgent;
begin
Agent := TPasClawAgent.Create('claude-opus-4-7');
try
Agent.SetProvider('anthropic', GetEnvironmentVariable('ANTHROPIC_API_KEY'));
Agent.RegisterTool(TWebSearchTool.Create);
Agent.RegisterTool(TWebFetchTool.Create);
Agent.RegisterTool(TFileSystemTool.Create);
WriteLn(Agent.Run('Summarize the latest Delphi release notes.'));
finally
Agent.Free;
end;
end;SetProvider(Kind, APIKey) builds a TProviderConfig in-memory from the catalog entry for Kind (anthropic, openai, gemini, groq, ollama, etc. — see PasClaw.Providers.Catalog) plus the API key the caller hands in. The catalog supplies the default base URL and default model; both can be overridden via the three-arg and four-arg SetProvider overloads. This lets an embedded binary run without ever touching ~/.pasclaw/config.json — set the env var, ship the binary, done.
Run raises EPasClawRun on failure; use Chat(prompt, reply, err): Boolean when you'd rather not unwind exceptions. RegisterTool takes ownership of the TPasClawTool instance and frees it with the agent.
Form-designer / property-driven form (back-compat — Create(nil), set published properties, wire events):
PC := TPasClawAgent.Create(nil);
PC.Model := 'claude-opus-4-7';
PC.SystemPrompt := 'You are a Pascal expert.';
PC.OnText := MyTextHandler;
if PC.Chat('hi', Reply, Err) then WriteLn(Reply);Built-in tools available as classes: TWebSearchTool, TWebFetchTool, TFileSystemTool (bundle: fs_read/write/grep/list/edit), TShellTool, TMemoryTool. Custom tools subclass TPasClawTool (unit PasClaw.Tools.Obj) and override Name / Description / Schema / Run.
TPasClawServer (same unit) hosts the full HTTP gateway inside the calling process. Same OOP shape as TPasClawAgent:
uses PasClaw.Agent, PasClaw.Tools;
var
Server: TPasClawServer;
begin
Server := TPasClawServer.Create('0.0.0.0', 8088);
try
Server.SetProvider('anthropic', GetEnvironmentVariable('ANTHROPIC_API_KEY'));
Server.RegisterTool(TWebSearchTool.Create);
Server.Run; { blocks until Stop is signalled from another thread }
finally
Server.Free;
end;
end;SetProvider works the same way as on TPasClawAgent — call it before Start and the gateway boots with the in-memory provider config.
Run does Start + WaitForStop in one call and raises EPasClawRun if startup fails. Use Start / WaitForStop / Stop separately when you need to do something between binding the socket and entering the wait. SIGINT handling is the embedder's problem — most hosting apps already have their own signal-handling strategy, so the component doesn't install one.
samples/component-console/ ships three sample binaries:
cd samples/component-console
make get-indy # only needed once, from repo root
make # builds all three (SampleConsole, SampleSimple, SampleServer)
make simple # just the agent code-form sample
make server # just the server samplePasClaw.Component is still available as the legacy unit name — it now re-exports everything from PasClaw.Agent, so existing code keeps compiling.
Index reference documents — manuals, books, source trees — so the agent can retrieve them while answering ("Big RAG" style, but operator-curated):
pasclaw kb add ~/docs/delphi-book.md ~/projects/mylib/ # files and/or dirs
pasclaw kb list
pasclaw kb search "constructor constraints in generics"
pasclaw kb sync # after documents change
pasclaw kb status
pasclaw kb remove ~/projects/mylib/Documents are indexed in place (never copied) into workspace/kb.db,
chunked by paragraph (~1.6 KB target). Supported types: markdown, plain
text, HTML (tag-stripped), and common source-code extensions (.pas,
.dpr, .c, .py, ...). PDFs are not supported — convert first, e.g.
pdftotext book.pdf book.txt.
Once at least one source is registered, two read-only agent tools appear automatically (and not before, so the model never sees an empty KB):
| Tool | Purpose |
|---|---|
kb_search(query, k) |
Search the corpus; returns path#cN citations + snippets + scores. |
kb_get(path, chunk, window) |
Expand a citation into full chunk text ± window neighbouring chunks. |
Ranking is SQLite FTS5 BM25 out of the box. When the local embedding
runtime is provisioned (pasclaw memory provision — the same sqlite-vec +
ONNX Runtime + MiniLM artifacts memory_search uses, gated by the same
vector_search_enabled flag), the KB automatically upgrades to hybrid
keyword + semantic ranking with Reciprocal Rank Fusion; embeddings are
computed locally and never leave the host. The vector sidecar
(workspace/kb.db.vec) is rebuilt by kb sync when documents change.
Unlike memory_search, the KB does not re-index on every query — kb sync is the explicit refresh, keeping kb_search fast on large corpora.
Conversation memory (memory_search) and the knowledgebase are deliberately
separate: one answers "what did we decide earlier", the other "what do my
reference documents say".
pasclaw status
pasclaw version
pasclaw migrate
pasclaw update --check
pasclaw update --repo owner/name
pasclaw membench --records 1000 --content 128
pasclaw membench --records 1000 --content 128 --keep --out /tmpProvider definitions live in src/pkg/providers/PasClaw.Providers.Catalog.pas. pasclaw onboard uses the catalog to populate provider kind, default API base URL, default model, and auth scheme.
Implemented protocol families:
pfAnthropic: Anthropic Messages API usingx-api-key.pfOpenAI: OpenAI Chat Completions-compatible HTTP API. This powers OpenAI and most compatible hosted/local providers.pfGemini: Google GeminigenerateContentREST API usingx-goog-api-key.pfPlaceholder: catalog placeholder for known future provider families that are not wired into this build.
Auth schemes:
asBearer:Authorization: Bearer <key>.asNone: no auth header, used for local Ollama/vLLM deployments.asHeader: raw key in the catalog-specified header name.
Current catalog entries:
| Provider | kind |
Family | Default base | Default model | Auth |
|---|---|---|---|---|---|
| Anthropic | anthropic |
Anthropic | https://api.anthropic.com |
claude-opus-4-7 |
x-api-key header |
| OpenAI | openai |
OpenAI-compatible | https://api.openai.com |
gpt-4o-mini |
Bearer |
| OpenRouter | openrouter |
OpenAI-compatible | https://openrouter.ai/api |
provider-selected | Bearer |
| Zhipu (GLM) | zhipu |
OpenAI-compatible | https://open.bigmodel.cn/api/paas |
glm-4 |
Bearer |
| DeepSeek | deepseek |
OpenAI-compatible | https://api.deepseek.com |
deepseek-chat |
Bearer |
| Volcengine (Doubao/Ark) | volcengine |
OpenAI-compatible | https://ark.cn-beijing.volces.com/api |
provider-selected | Bearer |
| Qwen (DashScope) | qwen |
OpenAI-compatible | https://dashscope.aliyuncs.com/compatible-mode |
qwen-max |
Bearer |
| Groq | groq |
OpenAI-compatible | https://api.groq.com/openai |
provider-selected | Bearer |
| Moonshot (Kimi) | moonshot |
OpenAI-compatible | https://api.moonshot.cn |
moonshot-v1-32k |
Bearer |
| MiniMax | minimax |
OpenAI-compatible | https://api.minimax.chat |
provider-selected | Bearer |
| Mistral | mistral |
OpenAI-compatible | https://api.mistral.ai |
mistral-large-latest |
Bearer |
| NVIDIA NIM | nvidia |
OpenAI-compatible | https://integrate.api.nvidia.com |
provider-selected | Bearer |
| Cerebras | cerebras |
OpenAI-compatible | https://api.cerebras.ai |
provider-selected | Bearer |
| Novita AI | novita |
OpenAI-compatible | https://api.novita.ai |
provider-selected | Bearer |
| Xiaomi MiMo | mimo |
OpenAI-compatible | set api_base in config |
provider-selected | Bearer |
| Ollama (local) | ollama |
OpenAI-compatible | http://localhost:11434 |
required during onboarding | none |
| vLLM (local) | vllm |
OpenAI-compatible | http://localhost:8000 |
required during onboarding | none |
| LiteLLM proxy | litellm |
OpenAI-compatible | set api_base in config |
provider-selected | Bearer |
| Google Gemini | gemini |
Gemini | https://generativelanguage.googleapis.com |
gemini-1.5-flash |
x-goog-api-key header |
Minimal local provider examples:
{
"default_provider": "ollama",
"default_model": "llama3.1:8b",
"gateway": { "log_level": "info", "bind_addr": "127.0.0.1", "port": 8088 },
"providers": [
{
"name": "ollama",
"kind": "ollama",
"api_base": "http://localhost:11434",
"api_key": "",
"model": "llama3.1:8b"
}
],
"mcp_servers": [],
"crons": [],
"skills": []
}{
"default_provider": "vllm",
"default_model": "your-model",
"gateway": { "log_level": "info", "bind_addr": "127.0.0.1", "port": 8088 },
"providers": [
{
"name": "vllm",
"kind": "vllm",
"api_base": "http://localhost:8000",
"api_key": "",
"model": "your-model"
}
],
"mcp_servers": [],
"crons": [],
"skills": []
}PasClaw's filesystem and shell tools are guarded by an opt-in workspace boundary plus an always-on shell denylist (src/pkg/tools/PasClaw.Tools.Sandbox.pas). Configure via the sandbox block in ~/.pasclaw/config.json:
"sandbox": {
"restrict_to_workspace": true,
"allow_read_outside_workspace": false,
"workspace": "/home/me/my-project",
"allow_read_paths": ["^/usr/(include|share)/.*"],
"allow_write_paths": ["^/tmp/agent/.*"],
"custom_shell_deny": ["scp ", "rsync "],
"shell_deny_enabled": true
}| Field | Default | Effect |
|---|---|---|
restrict_to_workspace |
false |
When true, fs_read / fs_write / fs_list / fs_edit_hashline / fs_grep refuse paths outside workspace. shell_exec refuses absolute paths outside it AND tokens containing .., pins the shell's cwd to the workspace, and bans cd / chdir / pushd / popd. |
allow_read_outside_workspace |
false |
When true, reads are allowed anywhere even while writes stay restricted. Useful for letting the agent pull from /usr/include/ while still locking down writes. |
workspace |
"" (cwd at startup) |
Absolute path the agent may operate inside. Empty means "use the current working directory at the time pasclaw was invoked", which is the picoclaw / Claude Code convention. |
allow_read_paths |
[] |
PCRE regex patterns that also count as readable. Same syntax picoclaw's tools.allow_read_paths accepts — anchors (^ $), character classes, alternation. |
allow_write_paths |
[] |
Same for writes. |
custom_shell_deny |
[] |
Extra substrings appended to the built-in shell denylist. Case-insensitive. |
shell_deny_enabled |
true |
Master switch for the shell denylist. Set false only for trusted automation — doing so re-enables sudo, rm, dd, mkfs, $( ), curl | sh, format c:, PowerShell -EncodedCommand, etc. |
block_private_networks |
true |
When true, web_fetch refuses URLs whose host resolves to a private / loopback / link-local IPv4 address (RFC1918, 127.0.0.0/8, 169.254.0.0/16 — including the cloud-metadata endpoint 169.254.169.254, CGNAT, IETF-reserved). Initial URL and every redirect hop are both checked. Flip to false only when you actually need the model to reach private addresses. See PasClaw.Net.SSRF for the full blocklist. |
Cross-target regex: PasClaw.Tools.Regex wraps FPC's RegExpr and Delphi's System.RegularExpressions behind one call, so allow_*_paths patterns are full PCRE on either toolchain. Invalid patterns return False (the sandbox falls through to the workspace boundary) rather than crashing.
Built-in shell denylist (always on unless shell_deny_enabled is false):
- POSIX tokens:
sudo,su,rm,chmod,chown,pkill,killall,kill,shutdown,reboot,poweroff,halt,eval,mkfs,diskpart. - Windows tokens:
del,erase,rd,rmdir,format,attrib,takeown,icacls,runas. - cwd-change tokens (when
restrict_to_workspace):cd,chdir,pushd,popd. Any token containing..is also rejected. - Substrings:
dd if=,:(){:|,<<EOF,$( ),${ }, backticks,| sh,| bash,apt install/remove/purge,yum install/remove,dnf install/remove,npm install -g,pip install --user,docker run/exec,git push,git force,format c:. - PowerShell (matched lowercased):
powershell -e/-en/-enc/-ec,-encodedcommand,iex (,invoke-expression,[convert]::frombase64,[text.encoding],.getstring([byte[],set-executionpolicy. - Device writes:
> /dev/sd*//hd*//vd*//xvd*//nvme*//mmcblk*//loop*//md*. - Always-safe paths:
/dev/null,/dev/zero,/dev/{,u}random,/dev/std{in,out,err}— picoclaw'ssafePaths.
Workspace-pin: when restrict_to_workspace=true, Tool_Shell invokes RunOneShot with WorkingDir = workspace so the child shell starts inside the boundary. Combined with the cd token ban and .. traversal check, a sandboxed model has no relative-path escape — even if a future denylist gap let a command through, the shell still starts in the workspace, not wherever pasclaw was launched from.
Known limitation: path canonicalisation uses ExpandFileName, which resolves .. but not symlinks. Picoclaw's equivalent (os.OpenRoot in Go 1.24+) enforces the boundary at the syscall layer; PasClaw runs on FPC and Delphi RTLs that have no equivalent. Do not place symlinks inside workspace that point outside it — they would let the agent escape.
--no-tools remains the strongest option: it disables the tool registry entirely, so neither fs_* nor shell_exec is registered. The system prompt automatically reflects this (no SKILLS section, no "ALWAYS use tools" rule).
src/
pasclaw/ Program entry point (`PasClaw.dpr`)
cmd/ CLI command units and root dispatcher
dos/ PCLAW.EXE, the DOS client (`make dos`, docs/dos.md)
pkg/
agent/ Agent execution and prompts
bridge/ `pasclaw bridge` and the serial-line HTTP framing it shares with the DOS client
channels/ Telegram, Discord, Slack, Teams, generic webhook, LINE, WhatsApp, Matrix, IRC
cliui/ ANSI styling, banner, command help rendering
component/ Shared components
config/ Version constants and on-disk config model
cron/ Cron scheduler
gateway/ Indy HTTP server, OpenAI-compatible API, embedded web UI
hashline/ Hashline patch/edit support
json/ Project JSON abstraction
logger/ Levelled logging
mcp/ MCP stdio/HTTP clients and tool bridge
membench/ Memory benchmark helpers
memory/ Memory log storage
net/ SSRF guard (IPv4 blocklist + DNS re-resolution)
platform/ Platform helpers
providers/ Provider catalog and LLM HTTP clients
search/ Web-search providers (DuckDuckGo, Brave, Tavily, SearXNG, Perplexity, Gemini) + HTML→text
skills/ Skill manifest loading and tool registration
tokenizer/ Token counting helpers
tools/ Built-in tool registry, filesystem, shell, and tool loop
tui/ Full-screen terminal UI
updater/ GitHub release update support
utils/ Path, file, and string helpers
MIT. See LICENSE.
Linux FPC builds include TaurusTLS (fetched by make get-taurustls), which is dual licensed; PasClaw uses it under the Modified BSD licence, whose notice follows:
Portions of this software are Copyright (c) 2024 TaurusTLS Developers – https://github.com/JPeterMugaas/TaurusTLS
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation, about box and/or other materials provided with the distribution.
- No personal names or organizations names associated with the TaurusTLS project may be used to endorse or promote products derived from this software without specific prior written permission of the specific individual or organization.
THIS SOFTWARE IS PROVIDED BY TaurusTLS Developers "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.






