SC26Join us at Booth 5405 · Nov 16–19
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 and lists built-in commands, skills, custom commands, and MCP prompts. Press Tab to complete the highlighted command, or Enter to run it. /help prints the built-in commands only.

Built-In Commands

CommandDescription
/agentsOpen the agents list to browse, start, and manage every session on this machine. See The Agents List.
/allocation [allocation-name]Show or change the budget allocation (org providers only). With no name, opens a picker.
/approveApprove one retry of a recent auto mode denial.
/authSign in again from the terminal running pw code.
/autocompact [auto|<tokens>]Set the context size at which the conversation is summarized automatically.
/claude-code [login <name>|use <name>|remove <name>]Manage local Claude Code accounts and subscription usage. See Models & Allocations.
/clearClear the conversation and start fresh.
/compact [focus]Compact the conversation now, optionally telling the summary what to focus on.
/costShow token usage and estimated cost, in the Usage tab of the settings panel.
/diffShow the git diff for the workspace.
/effort [level]Show or change the reasoning effort. With no level, opens a slider.
/fork [prompt]Copy this conversation into a new background session and keep working here.
/goal [condition|edit|clear|pause|resume]Keep working toward a condition, checked after every turn, until it is met.
/helpList the built-in commands.
/hooks [trust|reload]Browse configured hooks; trust enables project hooks, reload re-reads settings.
/loop [interval] [prompt]Repeat a prompt on a fixed interval, or let the model pace itself.
/mcpBrowse MCP servers: view their tools, reconnect, enable, or disable them.
/model [model-name]Show or change the current model. With no name, opens the model picker.
/permissionsView and manage allow rules and recent auto mode denials.
/plan [open|<description>]Switch to plan mode, or show the session's plan.
/recapRecap the session in a sentence or two.
/remote-control [on|off|status]Make this session viewable and drivable from the web app. Alias: /rc.
/rename [name]Rename the session. With no name, one is generated from the conversation.
/resumeResume a previous session from a picker.
/rewindRestore code, the conversation, or both to an earlier prompt.
/settingsChange pw code settings. See The /settings Menu.
/skillsList, reload, enable, disable, and trust skills.
/statusShow session status.
/subtask <task>Send a subagent off with your full context; its result comes back here.
/tasks [id]List and manage the background commands the agent started.
/usageShow provider usage and reset times, in the Usage tab of the settings panel.
/versionShow the CLI version.

Commands that are sometimes hidden

/loop is turned off when the CLAUDE_CODE_DISABLE_CRON environment variable is set to 1.

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

/effort

/effort <level> sets how hard the model reasons on each turn: default, none, minimal, low, medium, high, xhigh, or max. Models support different subsets, and /effort rejects a level the current model does not support. Bare /effort opens a slider; use ←/→ to choose and Enter to apply. The choice is saved for future sessions and shown beside the model in the status line. To set it at launch, pass --effort.

/autocompact

/autocompact <tokens> caps how large the conversation may grow before it is summarized automatically. The setting is global: it applies across models and future sessions, and the effective limit is the smaller of this value and the model's context window.

  • Token counts accept 500k, 1m, or 200000. A bare number from 100 to 1000 means thousands, so 200 is 200K.
  • auto (or reset, unset, default) returns to each model's own context window.
  • Bare /autocompact shows the current value.

/permissions

Bare /permissions opens the Permissions panel with two tabs:

  • Recently denied: calls the auto mode reviewer denied. Press Enter on one to approve a single retry, the same as /approve. The panel opens on this tab when there is a denial to show.
  • Allow: your allow rules with the scopes each is saved in. Type to filter, choose Add a new rule… to add one (you then pick where it is saved), or press Enter on a rule to delete it.

The typed forms still work, and are what /permissions does outside the interactive terminal:

FormEffect
/permissionsList allow rules, numbered and grouped by where they are saved.
/permissions add [user|project|local] <rule>Add a rule. The scope defaults to local, which applies to this repository only.
/permissions remove <rule|#>Remove a rule by its text or its number in the list.

See Allow Rules for rule syntax.

Settings, Status, and Usage

/settings, /status, /cost, and /usage open one panel with three tabs: Settings, Status, and Usage. /settings opens it on Settings, /status on Status, and /cost and /usage on Usage, which shows the session's token usage and cost followed by the provider's usage limits (or a line saying the provider reports none). Press Tab or Shift+Tab to switch tabs, Ctrl+R to refresh Status or Usage, and Esc to close.

/fork and /subtask

/fork [prompt] copies the conversation into a new session that runs in the background, and you keep working in this one. With a prompt, the copy starts on it right away; without one, it waits for you. The copy keeps the session's model, permission mode, effort, and allocation, and works in the same checkout. The transcript shows the pw code -r <id> command that opens it, and it appears in the agents list. Typed during a turn, /fork waits for the turn to end, and it is refused while a subagent is working.

/subtask <task> instead hands the task to a background subagent that starts with the conversation's full history and reports back to this conversation.

/auth

/auth signs you in again through your browser, or with a device code you can open on any device. When browser sign-in is not available, such as in a session attached to another resource, it asks you to paste an API key or token into a hidden prompt instead. Credentials typed on the same line as /auth are ignored, so they never reach the conversation or your prompt history.

Commands While the Agent Is Working

Most slash commands wait in the queue until the current turn ends. Some run right away:

  • /help, /diff, /version, and /recap print their output immediately.
  • /goal, /remote-control (/rc), and /approve take effect immediately, so you can stop a goal loop, open the session to the web app, or approve a denied retry mid-turn.
  • /settings, /status, /cost, /usage, /permissions, /skills, /tasks, and /resume open their panels immediately, as do /model, /allocation, /effort, /mcp, /hooks, and /agents with no arguments.
  • /rename, /permissions add and remove, /hooks trust and reload, /model <name>, /effort <level>, and /allocation <name> also run immediately. A model, effort, or allocation chosen mid-turn applies from the next turn.

Picking a session in /resume while a turn runs switches to it and leaves the turn running in its own session. /rewind replaces the conversation and /fork copies it, so both wait for the turn to finish.

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 group through version control
  2. <workspace>/.pw/code/commands/: older project location, still read
  3. ~/.config/agents/commands/: personal commands, available in every workspace (respects XDG_CONFIG_HOME)
  4. ~/.pw/code/commands/ and ~/.claude/commands/: personal fallbacks, still read

When the same command name exists in several locations, the first one found 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 and what it may do:

  • description: the one-line description shown next to the command. Without one, the first line of the body is used.
  • argument-hint: appended to the command name in the palette to show what arguments it expects.
  • allowed-tools: tools the command's turn may use without prompting, as with skill tool grants. Personal commands get these grants directly. A project command gets them, and any dynamic context shell output in its body, only after you run /skills trust <name>; until then its prompt still runs, without them.

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

  • $ARGUMENTS (or $ARGS): everything typed after the command name
  • $ARGUMENTS[N], or $0 through $9: individual arguments, 0-based, so $0 is the first one. Arguments are split shell-style, so a quoted "a b" counts as one. A position with no argument is left as literal text.

Unless the body consumes the whole string through $ARGUMENTS or $ARGS, the arguments are also appended as a trailing ARGUMENTS: line, so nothing you typed is silently dropped. Write \$0 to keep a placeholder literal. Skills use the same placeholders and add named arguments.

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 #$0 with `gh issue view $0`.
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 $0 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.

Skills Are Slash Commands Too

Skills are instruction bundles that also appear in the palette as /name. They go beyond a single prompt file: a skill can ship supporting files, request tool grants for its turn, inline live shell output, and be invoked by the agent on its own when a task matches its description.

A typed /name resolves in the order built-in → skill → custom command, so a built-in name can never be shadowed, and a skill wins over a same-named custom command.