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/pdiSetupInterview and draft the 3-section Principle Context
/pd-bootstrap/pdbSetupScan local toolchain (rg/sg/fd, etc.)
/pd-research/pdrSetupAsk Agent to research tool upgrades
/pd-help/pdhSetupList commands in-session
/pd-status—MonitoringView session, tool/hook/RuleHost activity and trajectory stats
/pd-pain—MonitoringManually report a pain signal
/pd-context—ConfigControl context injection (Thinking OS)
/pd-focus—ConfigInspect/restore the Principle Context file CURRENT_FOCUS.md
/pd-rollback—RollbackRollback a stored legacy empathy event
/pd-principle-rollback—RollbackRollback a principle and blacklist it
/pd-export—DataExport analytics or correction samples
/pd-samples—DataView 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: long-term background, important constraints, and the current long-term direction
  3. The Agent drafts three Principle Context sections (Long-term Background / Important Constraints / Current Direction) and shows the draft — the Owner copies or edits CURRENT_FOCUS.md manually; the command never writes the file

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 real system state: session counters, today's tool/hook/RuleHost totals, trajectory database size, and evolution dictionary stats. Every number is read from a persisted producer — none of it is synthesized.

Usage

/pd-status [subcommand]

Subcommands

SubcommandDescription
(none)Show session counters, today's activity, trajectory and dictionary stats
empathy [--today|--week|--session]View empathy events stored before the empathy engine was retired
dataView trajectory database stats (turns, tool calls, pain events, etc.)

Example Output (default)

📊 Principles Disciple - System Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧭 Session: 01a0…
   ├─ LLM turns: 3
   ├─ Injected principles: 2
   ├─ Auto-corrects: 1
   └─ Gate blocks: 0

📅 Today (2026-11-04)
   ├─ Tool calls: 12 (success 10 / failure 2)
   ├─ Hook runs: 30 (success 29 / failure 1)
   └─ RuleHost: evaluated 8 · blocked 2 · auto-corrected 1

🗄 Trajectory DB: 161 tool calls · 3 pain events (use `/pd-status data` for details)

🧠 Evolution Dictionary: 12 active rules
   ↳ 47 cumulative rule hits (a hit is not a block)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

GFI and mental mode are gone

The friction index (GFI), the mental-mode display and /pd-status reset were removed in GFI-COMPLETE-REMOVAL-001. Session state is now summarized by real tool, hook and RuleHost activity.


/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: host_context_bound
📌 Session: sess_xxx
📎 Evidence: N trajectory evidence entries

When the session's trajectory has no usable evidence yet, the command says so explicitly instead of claiming a context-bound success — candidates may then be gated by the admission threshold until evidence exists.

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".


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
minimal✅❌❌Minimal interference, let Agent work freely
standard✅❌❌Daily 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 ​

Inspect and restore the CURRENT_FOCUS.md file — the Owner-maintained Principle Context source (long-term background, important constraints, current direction). PD never compresses or rewrites it automatically; /pd-focus only reports file facts and restores explicit backups.

Usage

/pd-focus [subcommand]

Subcommands

SubcommandShortDescription
status—Show file existence, size, line count, and last update time
historyhistList history backups in .history/
rollback <n>rb <n>Restore backup n by raw bytes (the current file is backed up first)
help—Show help

Examples

/pd-focus status
/pd-focus history
/pd-focus rollback 3

Principle Context

CURRENT_FOCUS.md is now the Owner-maintained Principle Context source file: PD reads it only (and only after explicit adaptiveActivation.sendPrincipleContext authorization) as background for principle selection. The compress subcommand and all automatic compression/working-memory maintenance were retired.


Rollback Commands ​

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

/pd-rollback ​

Rollback a legacy empathy event that is still stored in the event log. The empathy engine that used to create these events was retired in GFI-COMPLETE-REMOVAL-001, so new sessions no longer produce them; the command remains for cleaning up events recorded by older releases.

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 stored empathy event in the current session
  • <event-id>: Rollback a specific event (get the ID from /pd-status empathy output)

What Happens After Rollback

  1. The event is marked as "rolled back" in the event log
  2. Its recorded penalty score is reported back to you
  3. Principles and activation state are not affected

WARNING

/pd-rollback must be used in a chat session (depends on sessionId). It rolls back a stored empathy event, not a principle — 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 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 stored empathy eventEvent marked rolled back, 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 today's tool failures / RuleHost evaluations
3. (Wait for PD background diagnosis)

Workflow 3: Confirm PD Is Actually Working ​

When output looks suspicious or a rule does not seem to fire:

1. /pd-status        # Session counters, tool/hook failures, RuleHost evaluations
2. /pd-status data   # Trajectory database size and last ingest time
3. (If hooks report failures, check the logs under ~/.openclaw/workspace/memory/logs)

Workflow 4: Rollback a Legacy Empathy Event ​

Only needed when an older release stored an empathy event that you want to undo:

1. /pd-status empathy --session  # View stored empathy events for this session
2. /pd-rollback last             # Mark the most recent event as rolled back

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. (Review principle candidates in the console)
2. /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.

Where did the friction score (GFI) go? ​

It was removed in GFI-COMPLETE-REMOVAL-001 together with the mental-mode display and /pd-status reset. The session's friction state no longer exists, so there is nothing to reset; use /pd-status to inspect real tool, hook and RuleHost activity instead.

How do I view all activated principles? ​

  • Read ~/.openclaw/workspace/.principles/PRINCIPLES.md directly