Parallel Works

Slash Commands

Slash commands let you control a pw code session without leaving the conversation. Type / in the composer to open the command palette, which filters as you type, or run /help in a session to print the same list. Press Enter to run the highlighted command.

Built-In Commands

CommandDescription
/allocation [allocation-name]Show or change the budget allocation (org providers only)
/authRe-authenticate when your token or API key has expired
/clearClear conversation and start fresh
/compactManually compact conversation history
/costShow token usage and estimated cost
/diffShow git diff for workspace
/fork <task>Fork this conversation into a subagent with its full history
/helpShow available commands
/mcpShow MCP server connection status and tools
/model [model-name]Show or change the current model
/permissions [add|remove <rule>]View and manage allowed tool rules
/rename <name>Rename the current session
/resumeResume a previous session from a picker
/settingsChange pw code settings
/statusShow session status
/usageShow provider usage and reset times
/versionShow CLI version

/usage availability

/usage only appears in the palette and in /help when the selected model's provider reports usage information. If your provider does not expose usage windows, the command is hidden.

/fork hands a task to a subagent that starts with a full copy of the conversation so far. See Subagents for details.

The composer has two other prefixes: @ references files and ! runs a shell command yourself. See Interface & Shortcuts.

Custom Slash Commands

You can define your own slash commands as markdown files. A file named <name>.md becomes the command /name, and its body is the prompt sent to the agent when you run it.

pw code looks for command files in these locations, in order of precedence:

  1. <workspace>/.agents/commands/: project commands, shared with your team through version control
  2. ~/.config/agents/commands/: personal commands, available in every workspace (respects XDG_CONFIG_HOME)

When the same command name exists in both locations, the project file wins.

Project commands require approval

Command files in the workspace are part of the configuration pw code asks you to approve at launch. See Workspace Trust.

File Format

An optional frontmatter block sets how the command appears in the palette:

  • description: the one-line description shown next to the command
  • argument-hint: appended to the command name in the palette to show what arguments it expects

The body is a prompt template. These placeholders are substituted when the command runs:

  • $ARGUMENTS (or $ARGS): everything typed after the command name
  • $1 through $9: individual space-separated arguments; a position with no argument expands to nothing

Example

Save this as .agents/commands/fix-issue.md in your workspace:

---
description: Investigate and fix a GitHub issue
argument-hint: <issue-number>
---
 
Look up GitHub issue #$1 with `gh issue view $1`.
Reproduce the problem, implement a fix, and run the relevant tests.
Summarize the root cause when you are done.

Then run it from the composer:

/fix-issue 123

The agent receives the body with $1 replaced by 123 and works through it as a normal turn.

MCP prompts are slash commands too

Connected MCP servers can expose prompt templates, which appear in the palette as /mcp__<server>__<prompt>. See MCP Servers for how arguments are passed.