Skip to content

Commands (Slash Commands)

✓ Fresh · 2026-02-24

Pi uses slash commands for built-in actions. Type / in the input to trigger command completion with fuzzy matching.

Complete Command Reference

Authentication

CommandPurpose
/loginStart OAuth authentication with a provider
/logoutSign out of current provider

Model Management

CommandPurpose
/modelOpen model selector (also Ctrl+L)
/scoped-modelsEnable or disable models for Ctrl+P cycling

Session Management

CommandPurpose
/resumePick from previous sessions to continue
/newStart a fresh session (discard current)
/name <name>Set a display name for the current session
/sessionShow current session path, token count, and cost
/treeNavigate and branch session history
/forkCreate a new session file from the current branch
/compact [prompt]Manually compact context (summarize older messages)

Settings

CommandPurpose
/settingsConfigure thinking level, theme, message delivery mode

Output & Sharing

CommandPurpose
/copyCopy the last assistant message to clipboard
/export [file]Save the current session as an HTML file
/shareUpload the session as a private GitHub gist

System

CommandPurpose
/reloadRefresh extensions, skills, prompts, and themes (hot reload)
/hotkeysDisplay all keyboard shortcuts
/changelogShow Pi version history
/quitTerminate Pi
/exitTerminate Pi (alias for /quit)

Custom Commands

Skills and prompt templates register their own slash commands:

PatternSource
/skill:nameCustom skills loaded from skills directories
/templatenamePrompt templates loaded from prompts directories

Command Flow

Session Commands Deep Dive

/tree

The /tree command opens an interactive session history navigator:

  • Search: Type to filter entries
  • Navigate: Left/right arrows to page through history
  • Filter modes (Ctrl+O): cycle through default > no-tools > user-only > labeled-only > all
  • Label: Press l to label/bookmark an entry
  • Branch: Select any previous point to continue from there

/compact

Compaction summarizes older messages to free context window space:

bash
/compact                    # default compaction
/compact Keep all code changes  # custom compaction instructions

All original history remains in the JSONL session file. Use /tree to revisit anything that was compacted.

/fork

Creates an entirely new session file from the current branch point. Unlike branching within /tree (which keeps everything in one file), /fork produces a separate file.

Pi Coding Agent SOP Documentation