dump-system-prompt

A command that extracts Claude Code's built-in system prompts from its JavaScript command-line program and saves them as structured JSON.

In plain words
What is it for?
Use it to extract prompts, view the results, compare saved versions, and optionally convert them to Markdown.
Why use it?
It lets you inspect the instructions Claude Code itself uses and compare them across versions.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/bengous/claude-code-plugins/dump-system-prompt
Clone the repo
git clone --depth 1 https://github.com/bengous/claude-code-plugins
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 470 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00011 $0.00470
Opus 5 $0.00005 $0.00235
Sonnet 5 $0.00002 $0.00094
Haiku 4.5 $0.00001 $0.00047

Measured 2d ago against content hash ad7cb9f8cb8b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dump-system-prompt scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude-meta-tools/commands/dump-system-prompt.md · 75 lines

What it actually says

Dump System Prompt

Extract system prompts from Claude Code's cli.js using Piebald-AI's AST-based extractor.

How It Works

This command:

  1. Creates an isolated temp directory
  2. Installs the npm version of @anthropic-ai/claude-code
  3. Runs promptExtractor.js against cli.js to extract prompts via AST parsing
  4. Outputs structured JSON with all extracted prompts
  5. Cleans up the temp directory

Execute Extraction

Run the extraction script:

"${CLAUDE_PLUGIN_ROOT}/scripts/extract-system-prompts.sh"

Output Location

Prompts are saved to: .claude-system-prompts/prompts-<version>.json

Post-Extraction

After running the script:

  1. Report the results:

    • Version extracted
    • Number of prompts found
    • File location
  2. If previous versions exist, show a diff summary:

    # Find all prompt files
    ls -la .claude-system-prompts/
    
    # Compare with previous version if available
    # jq '.prompts | length' on each file
    
  3. Show interesting prompts (first 500 chars of main system prompt):

    jq -r '.prompts[0].pieces[0][:500]' .claude-system-prompts/prompts-*.json | head -20
    

Optional: Convert to Markdown

If the user wants individual markdown files, create them:

.claude-system-prompts/markdown/
├── 01-main-system-prompt.md
├── 02-tool-bash.md
├── 03-tool-read.md
└── ...

Each file should contain the reconstructed prompt with interpolation placeholders shown.

Attribution

Extraction method vendored from Piebald-AI/tweakcc (MIT License).

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 75 lines · 11 tokens per session scan A ad7cb9f8cb8b

Subscribe to this mod's changes

dump-system-prompt is a command published in the GitHub repository bengous/claude-code-plugins (4 stars, last pushed 2d ago), licensed MIT. It adds 11 tokens to every session and 470 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.