coderClaw

System Prompt

CoderClaw builds a custom system prompt for every agent run. The prompt is CoderClaw-owned and does not use the pi-coding-agent default prompt.

The prompt is assembled by CoderClaw and injected into each agent run.

Structure

The prompt is intentionally compact and uses fixed sections:

Safety guardrails in the system prompt are advisory. They guide model behavior but do not enforce policy. Use tool policy, exec approvals, sandboxing, and channel allowlists for hard enforcement; operators can disable these by design.

Prompt modes

CoderClaw can render smaller system prompts for sub-agents. The runtime sets a promptMode for each run (not a user-facing config):

When promptMode=minimal, extra injected prompts are labeled Subagent Context instead of Group Chat Context.

Workspace bootstrap injection

Bootstrap files are trimmed and appended under Project Context so the model sees identity and profile context without needing explicit reads:

All of these files are injected into the context window on every turn, which means they consume tokens. Keep them concise — especially MEMORY.md, which can grow over time and lead to unexpectedly high context usage and more frequent compaction.

Note: memory/*.md daily files are not injected automatically. They are accessed on demand via the memory_search and memory_get tools, so they do not count against the context window unless the model explicitly reads them.

Large files are truncated with a marker. The max per-file size is controlled by agents.defaults.bootstrapMaxChars (default: 20000). Total injected bootstrap content across files is capped by agents.defaults.bootstrapTotalMaxChars (default: 150000). Missing files inject a short missing-file marker.

Sub-agent sessions only inject AGENTS.md and TOOLS.md (other bootstrap files are filtered out to keep the sub-agent context small).

Internal hooks can intercept this step via agent:bootstrap to mutate or replace the injected bootstrap files (for example swapping SOUL.md for an alternate persona).

To inspect how much each injected file contributes (raw vs injected, truncation, plus tool schema overhead), use /context list or /context detail. See Context.

Time handling

The system prompt includes a dedicated Current Date & Time section when the user timezone is known. To keep the prompt cache-stable, it now only includes the time zone (no dynamic clock or time format).

Use session_status when the agent needs the current time; the status card includes a timestamp line.

Configure with:

See Date & Time for full behavior details.

Skills

When eligible skills exist, CoderClaw injects a compact available skills list (formatSkillsForPrompt) that includes the file path for each skill. The prompt instructs the model to use read to load the SKILL.md at the listed location (workspace, managed, or bundled). If no skills are eligible, the Skills section is omitted.

<available_skills>
  <skill>
    <name>...</name>
    <description>...</description>
    <location>...</location>
  </skill>
</available_skills>

This keeps the base prompt small while still enabling targeted skill usage.

Documentation

When available, the system prompt includes a Documentation section that points to the local CoderClaw docs directory (either docs/ in the repo workspace or the bundled npm package docs) and also notes the public mirror, source repo, community Discord, and ClawHub (https://clawhub.com) for skills discovery. The prompt instructs the model to consult local docs first for CoderClaw behavior, commands, configuration, or architecture, and to run coderclaw status itself when possible (asking the user only when it lacks access).