# piebald-ai/claude-code-system-prompts architecture

> Architecture diagram of the GitHub repository piebald-ai/claude-code-system-prompts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/piebald-ai/claude-code-system-prompts
- Repository: https://github.com/piebald-ai/claude-code-system-prompts

## Overview

#### Purpose and Entry Points
This is a versioned corpus of Claude Code prompt fragments extracted from compiled Claude Code releases, currently documented for v2.1.246. It is primarily consumed by humans, diff tooling, and patching workflows such as tweakcc—not executed as an application. The public index and release history are `README.md` and `CHANGELOG.md`.

#### Content Corpus
The repository’s core artifact is a flat Markdown prompt registry under `system-prompts/`. Filenames encode the runtime role and feature area, enabling direct lookup and stable diffs. Major families are:
- Main interactive-agent prompt fragments: `system-prompts/system-prompt-harness-instructions.md`, `system-prompts/system-prompt-executing-actions-with-care.md`
- Specialized agent prompts: `system-prompts/agent-prompt-explore.md`, `system-prompts/agent-prompt-plan-mode-enhanced.md`
- Built-in tool contracts: `system-prompts/tool-description-write.md`, `system-prompts/tool-description-workflow.md`
- Embedded reference/template data: `system-prompts/data-claude-code-gateway-protocol.md`, `system-prompts/data-managed-agents-core-concepts.md`
- Skill instructions: `system-prompts/skill-building-llm-powered-applications-with-claude.md`, `system-prompts/skill-verify-skill.md`
- Runtime notifications/reminders: `system-prompts/system-reminder-plan-mode-workflow.md`, `system-prompts/system-reminder-external-source-trust-boundary.md`

#### Prompt Assembly Boundaries
The corpus reflects Claude Code’s conditional prompt assembly rather than one monolithic prompt. Base system fragments establish identity, safety, tool behavior, planning, memory, and autonomy; runtime selectively adds tool descriptions, skills, agent-specific instructions, reminders, configuration-dependent content, and interpolated session context. Individual files are therefore atomic patch/diff units, not independently runnable prompts.

#### Agent and Workflow Layer
Agent prompts define distinct control planes for exploration, planning, delegation, background jobs, hooks, review, and utility tasks. Coordinator/worker behavior and isolated worktree execution are represented in `system-prompts/system-prompt-coordinator-mode-orchestration.md`, `system-prompts/agent-prompt-coordinator-worker-instructions.md`, and `system-prompts/agent-prompt-worker-fork.md`. Deterministic multi-agent scripting is documented as a tool contract in `system-prompts/tool-description-workflow.md`.

#### Tool, Security, and Trust Contracts
Tool-description files capture the model-visible interface and operational constraints for filesystem, shell, browser, MCP, scheduling, messaging, and Artifact capabilities. High-impact safety boundaries include sandboxing and Git guidance in `system-prompts/tool-description-bash-sandbox-mandatory-mode.md` and `system-prompts/tool-description-bash-git-avoid-destructive-ops.md`; untrusted external-content handling in `system-prompts/system-reminder-external-source-trust-boundary.md`; and autonomous-action review in `system-prompts/agent-prompt-security-monitor-for-autonomous-agent-actions-first-part.md`.

#### External Systems Represented
Although this repo does not integrate with services itself, its extracted prompts describe Claude Code’s interfaces with Anthropic’s Claude API, Managed Agents, MCP servers, GitHub, browser automation, Claude.ai Artifacts, cloud scheduling, and self-hosted runners. Key reference payloads include `system-prompts/data-managed-agents-endpoint-reference.md`, `system-prompts/data-claude-code-gateway-protocol.md`, and `system-prompts/data-self-hosted-runner-command-help.md`.

#### Extraction and Maintenance
The only executable maintenance surface is Node.js tooling: `tools/updatePrompts.js` updates/generated prompt files, while `tools/promptMarkdownUtils.mjs` centralizes Markdown processing and has its companion test file. Updates are expected to track Claude Code releases closely; `CHANGELOG.md` preserves cross-version prompt evolution. There is no service runtime, package manifest, deployment topology, or database in this repository.

Main entry points: [`system-prompts/tool-description-write.md`](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/tool-description-write.md) (Tool contracts), [`system-prompts/system-prompt-harness-instructions.md`](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-prompt-harness-instructions.md) (Base system fragments), [`tools/updatePrompts.js`](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/tools/updatePrompts.js) (Prompt updater), [`system-prompts/system-reminder-plan-mode-workflow.md`](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-reminder-plan-mode-workflow.md) (Runtime reminders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Repository Index"]
  node_readme["Public index<br/>Markdown index<br/>[README.md]"]
  node_changelog["Release history<br/>Markdown changelog<br/>[CHANGELOG.md]"]
end

subgraph group_corpus["Prompt Fragment Corpus"]
  node_registry["Prompt registry<br/>Markdown corpus"]
  node_base_prompts["Base system fragments<br/>prompt fragments"]
  node_action_safety["Action-care guidance<br/>prompt fragment"]
  node_agent_prompts["Specialized agents<br/>agent prompts"]
  node_coordination["Coordinator and workers<br/>agent workflow prompts"]
  node_tool_contracts["Tool contracts<br/>tool descriptions"]
  node_workflow_contract["Workflow contract<br/>tool description"]
  node_safety_boundaries["Safety and trust boundaries<br/>safety prompts"]
  node_reminders["Runtime reminders<br/>system reminders"]
  node_reference_data["Reference payloads<br/>embedded data prompts"]
  node_skills["Skill instructions<br/>skill prompts"]
end

subgraph group_maintenance["Maintenance Tooling"]
  node_update_tool{{"Prompt updater<br/>Node.js script<br/>[updatePrompts.js]"}}
  node_markdown_utils["Markdown utilities<br/>Node.js module"]
end

subgraph group_represented["Represented Runtime Interfaces"]
  node_claude_runtime(("Claude Code assembly<br/>conditional runtime"))
  node_external_interfaces(("External interfaces<br/>represented systems"))
end

node_readme -->|"indexes"| node_registry
node_changelog -->|"tracks changes to"| node_registry
node_update_tool -->|"uses"| node_markdown_utils
node_update_tool -->|"updates"| node_registry
node_registry -->|"contains"| node_base_prompts
node_registry -->|"contains"| node_agent_prompts
node_registry -->|"contains"| node_coordination
node_registry -->|"contains"| node_tool_contracts
node_registry -->|"contains"| node_reference_data
node_registry -->|"contains"| node_skills
node_base_prompts -.->|"includes care guidance"| node_action_safety
node_claude_runtime -->|"assembles"| node_base_prompts
node_claude_runtime -.->|"selects by role"| node_agent_prompts
node_claude_runtime -.->|"selects for delegation"| node_coordination
node_claude_runtime -.->|"adds available tools"| node_tool_contracts
node_claude_runtime -.->|"enables workflows"| node_workflow_contract
node_claude_runtime -.->|"injects by context"| node_reminders
node_claude_runtime -.->|"adds skills"| node_skills
node_tool_contracts -->|"constrained by"| node_safety_boundaries
node_reminders -->|"reinforces"| node_safety_boundaries
node_reference_data -->|"describes"| node_external_interfaces
node_tool_contracts -->|"defines interfaces for"| node_external_interfaces

click node_readme "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/README.md"
click node_changelog "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/CHANGELOG.md"
click node_base_prompts "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-prompt-harness-instructions.md"
click node_action_safety "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-prompt-executing-actions-with-care.md"
click node_agent_prompts "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/agent-prompt-explore.md"
click node_coordination "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-prompt-coordinator-mode-orchestration.md"
click node_tool_contracts "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/tool-description-write.md"
click node_workflow_contract "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/tool-description-workflow.md"
click node_safety_boundaries "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/tool-description-bash-sandbox-mandatory-mode.md"
click node_reminders "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-reminder-plan-mode-workflow.md"
click node_reference_data "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/data-claude-code-gateway-protocol.md"
click node_skills "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/skill-building-llm-powered-applications-with-claude.md"
click node_update_tool "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/tools/updatePrompts.js"
click node_markdown_utils "https://github.com/piebald-ai/claude-code-system-prompts/blob/main/tools/promptMarkdownUtils.mjs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_changelog toneBlue
class node_registry,node_base_prompts,node_action_safety,node_agent_prompts,node_coordination,node_tool_contracts,node_workflow_contract,node_safety_boundaries,node_reminders,node_reference_data,node_skills toneAmber
class node_update_tool,node_markdown_utils toneMint
class node_claude_runtime,node_external_interfaces toneRose
```

## Components

### Repository Index

- [Public index](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/README.md): Markdown index · `README.md`
- [Release history](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/CHANGELOG.md): Markdown changelog · Tracks prompt evolution across Claude Code versions. · `CHANGELOG.md`

### Prompt Fragment Corpus

Atomic Markdown units extracted from Claude Code releases.

- **Prompt registry**: Markdown corpus · Flat, versioned registry for lookup, diffs, and patching.
- [Base system fragments](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-prompt-harness-instructions.md): prompt fragments · Establish identity, safety, planning, memory, autonomy, and tool behavior. · `system-prompts/system-prompt-harness-instructions.md`
- [Action-care guidance](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-prompt-executing-actions-with-care.md): prompt fragment · `system-prompts/system-prompt-executing-actions-with-care.md`
- [Specialized agents](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/agent-prompt-explore.md): agent prompts · Exploration and enhanced planning control planes. · `system-prompts/agent-prompt-explore.md`
- [Coordinator and workers](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-prompt-coordinator-mode-orchestration.md): agent workflow prompts · Defines delegation, workers, and isolated worktree execution. · `system-prompts/system-prompt-coordinator-mode-orchestration.md`
- [Tool contracts](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/tool-description-write.md): tool descriptions · Model-visible interfaces for filesystem, shell, browser, MCP, scheduling, messaging, and Artifacts. · `system-prompts/tool-description-write.md`
- [Workflow contract](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/tool-description-workflow.md): tool description · Documents deterministic multi-agent scripting. · `system-prompts/tool-description-workflow.md`
- [Safety and trust boundaries](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/tool-description-bash-sandbox-mandatory-mode.md): safety prompts · Sandbox, Git safety, external-content trust, and autonomous-action review. · `system-prompts/tool-description-bash-sandbox-mandatory-mode.md`
- [Runtime reminders](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/system-reminder-plan-mode-workflow.md): system reminders · Conditionally injected workflow and trust-boundary guidance. · `system-prompts/system-reminder-plan-mode-workflow.md`
- [Reference payloads](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/data-claude-code-gateway-protocol.md): embedded data prompts · Gateway, Managed Agents, and runner reference material. · `system-prompts/data-claude-code-gateway-protocol.md`
- [Skill instructions](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/system-prompts/skill-building-llm-powered-applications-with-claude.md): skill prompts · `system-prompts/skill-building-llm-powered-applications-with-claude.md`

### Maintenance Tooling

- [Prompt updater](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/tools/updatePrompts.js): Node.js script · Updates or generates extracted prompt files. · `tools/updatePrompts.js`
- [Markdown utilities](https://github.com/piebald-ai/claude-code-system-prompts/blob/main/tools/promptMarkdownUtils.mjs): Node.js module · Central Markdown processing used by maintenance tooling. · `tools/promptMarkdownUtils.mjs`

### Represented Runtime Interfaces

External interfaces described by the prompt corpus, not repository integrations.

- **Claude Code assembly**: conditional runtime · Selectively assembles fragments with configuration and session context.
- **External interfaces**: represented systems · Claude API, Managed Agents, MCP, GitHub, browser automation, Artifacts, scheduling, and runners.

## Connections

- Public index → Prompt registry: indexes
- Release history → Prompt registry: tracks changes to
- Prompt updater → Markdown utilities: uses
- Prompt updater → Prompt registry: updates
- Prompt registry → Base system fragments: contains
- Prompt registry → Specialized agents: contains
- Prompt registry → Coordinator and workers: contains
- Prompt registry → Tool contracts: contains
- Prompt registry → Reference payloads: contains
- Prompt registry → Skill instructions: contains
- Base system fragments → Action-care guidance: includes care guidance
- Claude Code assembly → Base system fragments: assembles
- Claude Code assembly → Specialized agents: selects by role
- Claude Code assembly → Coordinator and workers: selects for delegation
- Claude Code assembly → Tool contracts: adds available tools
- Claude Code assembly → Workflow contract: enables workflows
- Claude Code assembly → Runtime reminders: injects by context
- Claude Code assembly → Skill instructions: adds skills
- Tool contracts → Safety and trust boundaries: constrained by
- Runtime reminders → Safety and trust boundaries: reinforces
- Reference payloads → External interfaces: describes
- Tool contracts → External interfaces: defines interfaces for
