Skip to content

Slash Commands Reference

PD interacts with you through OpenClaw slash commands. This document lists all available commands with plain-language usage instructions.

Reading Guide

New here? Start with the User Guide to understand PD's core concepts, then come back here to look up specific commands.

Quick Reference Table

All commands start with /pd- (short aliases start with /pd + a single letter). They never conflict with OpenClaw's built-in commands.

CommandShortCategoryOne-line Purpose
/pd-init/pdiSetupInitialize workspace, establish project focus
/pd-bootstrap/pdbSetupScan local toolchain (rg/sg/fd, etc.)
/pd-research/pdrSetupAsk Agent to research tool upgrades
/pd-help/pdhSetupList commands in-session
/pd-statusMonitoringView GFI friction index and mental mode
/pd-painMonitoringManually report a pain signal
/pd-evolution-statusMonitoringView principle evolution loop status
/pd-contextConfigControl context injection (Thinking OS / project focus)
/pd-focusConfigManage CURRENT_FOCUS.md (compress/rollback)
/pd-thinking/pdtConfigManage mental models (view/propose/audit)
/pd-rollbackRollbackRollback a misjudged empathy event penalty
/pd-principle-rollbackRollbackRollback a principle and blacklist it
/pd-exportDataExport analytics or correction samples
/pd-samplesDataView and review correction samples

About Implementation Lifecycle Commands

/pd-promote-impl, /pd-disable-impl, /pd-archive-impl, and /pd-rollback-impl have their replay-generation path retired in PRI-230 and are now in a semi-deprecated state. For the new implementation promotion workflow, use the pd candidate internalize and pd runtime activation promote CLI commands instead. This page no longer documents those four commands.


Setup Commands

/pd-init

Short:/pdi

Initializes a new workspace. The command itself only outputs guidance text — the actual initialization is done by the Agent following that guidance: it interviews you to establish your project's strategic focus.

Usage

/pd-init

What Happens

  1. The command tells the Agent to read existing context in the OKR/ directory
  2. The Agent interviews you: What's the project vision? What are the top 1-3 priorities right now?
  3. The Agent generates CURRENT_FOCUS.md (current focus) and USER_CONTEXT.md (user preferences)

When to Use

  • The first time you use PD in a new workspace
  • When project direction shifts significantly and you need to realign

TIP

/pd-init does not directly generate PRINCIPLES.md or THINKING_OS.md — those files are created automatically by PD's background services when first needed.


/pd-bootstrap

Short:/pdb

Scans your local environment to detect which development tools are installed (rg, sg, fd, qmd, ast-grep, shellcheck) and writes the result to .state/SYSTEM_CAPABILITIES.json.

Usage

/pd-bootstrap

Example Output

🔍 Environment perception complete.
**Detected tools:** `rg`, `fd`, `ast-grep`
**Platform:** darwin
Capabilities saved to `.state/SYSTEM_CAPABILITIES.json`.

When to Use

  • The first time you use PD after installation
  • After installing a new tool (e.g., you just installed ast-grep) and want PD to be aware of it

/pd-research

Short:/pdr

Asks the Agent to use web search to research the latest tools in a category and output a "Tool Upgrade Proposal". Text-only output, no side effects.

Usage

/pd-research [category]

Parameters

ParameterRequiredDescription
categoryNoTool category to research; defaults to "modern high-performance CLI tools for coding and architecture"

Examples

/pd-research
/pd-research fast code search tools

When to Use

  • When you want to learn about the latest tools in a category (code search, doc generation, etc.)
  • When /pd-bootstrap shows a missing tool and you want alternatives

/pd-help

Short:/pdh

Quickly view all PD commands in-session. Since OpenClaw's /help does not automatically list plugin commands, PD provides its own help command.

Usage

/pd-help

TIP

Can't remember the commands? Just type /pdh to see a quick reference table of all commands.


Monitoring Commands

/pd-status

View PD's system health. This is one of the commands you'll use most often.

Usage

/pd-status [subcommand]

Subcommands

SubcommandDescription
(none)Show GFI friction index, mental mode, pain dictionary stats
empathy [--today|--week|--session]View empathy event stats (default: today)
resetReset the current session's GFI to zero
dataView trajectory database stats (turns, tool calls, pain events, etc.)

Example Output (default)

📊 Principles Disciple - System Health Monitor
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💊 Current Friction (GFI): [██████░░░░░░░░░] 35/100
🧠 Current Mental Mode: 🤝 CONCILIATORY
   ↳ Diagnosis: High Friction 🟡

🧠 Evolution Dictionary: 12 active rules
   ↳ Successfully blocked 47 invalid operations
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

What is GFI?

GFI (Global Friction Index) is the current session's "fatigue index". Every time the Agent makes a mistake, gets corrected, or gets blocked, GFI accumulates. The higher the GFI, the more likely the Agent enters "conciliatory mode" — it becomes more cautious, slower, and more apologetic.

  • 0-20: Healthy 🟢
  • 21-50: Minor Issues 🟢
  • 51-80: High Friction 🟡 (consider whether the context is messy)
  • 81-100: Critical 🔴 (consider /pd-status reset or starting a new session)

When to use reset

When the Agent has accumulated too much "emotional baggage" and becomes overly cautious or apologetic, /pd-status reset clears the GFI so the Agent can start fresh. This doesn't "delete memory" — it only resets the friction accumulation.


/pd-pain

Manually report a pain signal to PD. PD usually detects pain automatically (tool failures, user corrections, etc.), but sometimes you want to explicitly record an issue — use this command.

Usage

/pd-pain <description of the issue>

Parameters

ParameterRequiredDescription
descriptionYesDescribe the issue in natural language

Example

/pd-pain Agent edited the file without reading it first, overwriting existing logic

Example Output

✅ Pain recorded (context-bound)

📋 Pain ID: manual_1751500000000_a1b2c3d4
📝 Reason: Agent edited the file without reading it first, overwriting existing logic
🔗 Provenance: openclaw_context_bound
📌 Session: sess_xxx

The system will diagnose using current session context.

Difference from Automatic Detection

  • Automatic detection: PD's hook judges whether something is pain after a tool call (tool failure, blocked, etc.)
  • /pd-pain: You actively record a "soft" issue (e.g., the Agent's judgment direction was wrong, but no error occurred)

WARNING

/pd-pain must be used inside an OpenClaw chat session — it depends on the current session's context (context-bound provenance). In a non-session environment it will report "Session ID not available".


/pd-evolution-status

View the full state of the principle evolution loop: control plane (GFI/gate), evolution plane (queue/tasks), principle stats, workflow funnel.

Usage

/pd-evolution-status

Output Contents

  • Control Plane: Current GFI, GFI sources, recent gate blocks/bypasses
  • Evolution: Evolution queue status (pending/in_progress/completed), current evolution task
  • Principles: Principle stats (candidate/probation/active/archived counts)
  • Workflow Funnel: Pass rates at each workflow stage

When to Use

  • When you want to know how many principle candidates are waiting for review
  • When you want to confirm that evolution tasks are progressing normally
  • When troubleshooting "why isn't my principle being activated"

Configuration Commands

/pd-context

Control what context PD injects into the Agent. This is the main entry point for adjusting PD's "presence".

Usage

/pd-context [subcommand]

Subcommands

SubcommandDescription
statusView current injection status (default)
thinking on|offToggle Thinking OS injection
focus full|summary|offSet project context mode
minimalPreset: core principles only (quietest)
standardPreset: core principles, no Thinking OS
fullPreset: core principles + Thinking OS + project context (fullest)
helpShow help

Examples

/pd-context status
/pd-context thinking on
/pd-context focus summary
/pd-context full

Preset Differences

PresetCore PrinciplesThinking OSProject ContextBest For
minimalMinimal interference, let Agent work freely
standardDaily use (same as minimal)
full✅ (summary)Complex tasks, Agent needs full picture

Core principles are always injected

Regardless of preset, core principles (always-on) are always injected and cannot be disabled. What's configurable is only the "enhancement layers" like Thinking OS and project context.

Where is the config stored?

Configuration is written to .pd/config.yaml (the ADR-0016 unified config file) and takes effect on the next turn.


/pd-focus

Manage the CURRENT_FOCUS.md file — this file records the current project focus, current tasks, and next steps. As work progresses, this file grows longer; /pd-focus helps you compress and roll it back.

Usage

/pd-focus [subcommand]

Subcommands

SubcommandShortDescription
statusView current status and historical versions
historyhistList historical versions
compresscpManually compress (archive milestones, clean completed items)
rollback <n>rb <n>Rollback to a specified historical version
helpShow help

Examples

/pd-focus status
/pd-focus compress
/pd-focus rollback 3

When to Use compress

  • When CURRENT_FOCUS.md exceeds 40 lines
  • When you've completed a milestone and want to clear completed items while keeping unfinished ones
  • When you want to archive milestones to the memory/ diary

Auto-compression

PD also auto-compresses CURRENT_FOCUS.md in the background. /pd-focus compress is a manual trigger for when you want to clean up immediately.


/pd-thinking

Short:/pdt

Manage mental models (Thinking OS). Mental models are PD's "cognitive layer" — they tell the Agent which thinking style to use in different scenarios.

Off by default

Thinking OS is off by default. To enable it, first run /pd-context thinking on, then use /pd-thinking to view stats.

Usage

/pd-thinking [subcommand]

Subcommands

SubcommandDescription
statusView usage stats for each mental model (hit rate, dormant models)
propose <description>Propose a new mental model (must include a "signal detection" section)
auditAudit model health (over-triggered/dormant/pending candidates)
(none)Show help

Examples

/pd-thinking status
/pd-thinking propose A mental model for code review, signal detection: regex /review|audit/
/pd-thinking audit

propose Requirements

A proposal must include the keyword "signal" and describe how to detect the model's usage via regex. Proposals are written to THINKING_OS_CANDIDATES.md and require validation in 3+ different task types and human approval before promotion.

What audit Tells You

  • ✅ Healthy models (reasonable hit rate)
  • 🔸 Over-triggered models (hit rate >50%, pattern may be too broad)
  • ⚠️ Dormant models (0 hits, consider archiving)
  • 📝 Number of pending candidates

Rollback Commands

PD's core promise is "reversibility". These commands let you undo PD's decisions.

/pd-rollback

Rollback the penalty from an empathy event. When PD misjudges a "user frustration" and GFI rises incorrectly, use this command to undo it.

Usage

/pd-rollback <event-id>
/pd-rollback last

Parameters

ParameterRequiredDescription
event-idYesThe event ID to rollback (or use last for the most recent)

Examples

/pd-rollback last
/pd-rollback evt_20260701_001

last vs <event-id>

  • last: Rollback the most recent empathy event in the current session (most common)
  • <event-id>: Rollback a specific event (get the ID from /pd-status empathy output)

What Happens After Rollback

  1. The event's penalty score is subtracted from GFI
  2. The event is marked as "rolled back"
  3. The Agent's friction level decreases accordingly

WARNING

/pd-rollback must be used in a chat session (depends on sessionId). It rolls back "empathy penalty", not "principles" — to rollback a principle, use /pd-principle-rollback.


/pd-principle-rollback

Rollback a principle and add its pattern to the blacklist (preventing it from being re-proposed).

Usage

/pd-principle-rollback <principle-id> [reason]

Parameters

ParameterRequiredDescription
principle-idYesPrinciple ID (e.g., P_001, from /pd-evolution-status or PRINCIPLES.md)
reasonNoReason for rollback (default: "manual rollback")

Examples

/pd-principle-rollback P_003
/pd-principle-rollback P_003 This principle is too strict and blocks normal development

Difference from /pd-rollback

CommandRollback TargetEffect
/pd-rollbackOne empathy eventGFI decreases, principles unaffected
/pd-principle-rollbackOne principlePrinciple deactivated + pattern blacklisted, prevents re-proposal

Data Commands

/pd-export

Export PD's collected data for analysis or backup.

Usage

/pd-export analytics
/pd-export corrections [--redacted]

Subcommands

SubcommandDescription
analyticsExport analytics snapshot (aggregated stats)
corrections [--redacted]Export correction samples (approved ones)

What is --redacted?

The --redacted flag applies redaction (removes sensitive info), suitable for sharing or reporting. Without it, raw data is exported.

Examples

/pd-export analytics
/pd-export corrections --redacted

Example Output

Exported correction samples to .state/exports/corrections_20260701.json (mode=redacted, count=15).

/pd-samples

View and review correction samples. Correction samples are "training data" extracted by PD from the Agent's mistakes.

Usage

/pd-samples
/pd-samples review approve <sample-id> [note]
/pd-samples review reject <sample-id> [note]

Subcommands

SubcommandDescription
(none)List all pending samples
review approve <id> [note]Approve a sample
review reject <id> [note]Reject a sample

Examples

/pd-samples
/pd-samples review approve s_001 good quality
/pd-samples review reject s_002 this isn't actually an error

What reject Triggers

Rejecting a sample isn't just "not approved" — it triggers a correction_rejected pain event, causing PD to re-diagnose. This is PD's "reverse learning" mechanism: when you reject a wrong correction sample, PD learns that its judgment was off.

Review Workflow

  1. /pd-samples to see the pending list
  2. Decide approve or reject based on sample quality
  3. Approved samples enter training data; rejected samples trigger re-diagnosis

Common Workflows

Workflow 1: First-time PD Setup

1. /pdi              # Initialize workspace, establish project focus
2. /pdb              # Scan local tools
3. /pd-status        # Confirm PD is running normally
4. /pd-context full  # Enable full context (optional, for complex projects)

Workflow 2: Correcting Agent Mistakes

1. /pd-pain Agent edited without reading the file first, overwrote my code
2. /pd-status        # Check if GFI rose
3. (Wait for PD background diagnosis, or use /pd-evolution-status to view queue)

Workflow 3: Agent is Over-fatigued

When the Agent keeps apologizing and is overly cautious:

1. /pd-status        # Check GFI, confirm it's too high
2. /pd-status reset  # Clear GFI
3. (Continue working, Agent returns to efficient mode)

Workflow 4: Rollback a Misjudgment

PD misjudged a "user frustration" and GFI rose incorrectly:

1. /pd-status empathy --session  # View current session's empathy events
2. /pd-rollback last             # Rollback the most recent misjudgment
3. /pd-status                    # Confirm GFI has decreased

Workflow 5: Review Correction Samples

1. /pd-samples                    # View pending samples
2. /pd-samples review approve s_001  # Approve good samples
3. /pd-samples review reject s_002   # Reject wrong samples (triggers re-diagnosis)
4. /pd-export corrections --redacted  # Export redacted data (optional)

Workflow 6: Principle Governance

1. /pd-evolution-status           # See what candidate principles exist
2. (Review principle candidates in the console)
3. /pd-principle-rollback P_003   # Rollback an inappropriate activated principle

FAQ

Command not responding?

  • Confirm PD plugin is installed: if /pd-help responds, the plugin loaded successfully
  • Confirm you're in a workspace: PD commands need workspace context
  • Check logs: ~/.openclaw/workspace/memory/logs/SYSTEM_*.log

/pd-pain says "Session ID not available"?

/pd-pain must be used inside an OpenClaw chat session, not from the CLI or a non-session environment.

Output is in English, how do I switch to Chinese?

Edit your workspace's .pd/config.yaml and set language: zh. Or set it in the plugin config.

GFI won't go down?

  • Use /pd-status reset to clear the current session's GFI
  • Check if there are persistent tool failures triggering pain (fix the root cause)
  • Consider /clear to start a new session

How do I view all activated principles?

  • Run /pd-evolution-status for stats
  • Read ~/.openclaw/workspace/.principles/PRINCIPLES.md directly