Pi Agent Slash Command Handbook

The following is a quick reference table for all built-in slash commands in Pi Agent interactive mode.


Accounts & Authentication

The commands in this section are used to log in to and log out of AI providers. Credentials are stored in ~/.pi/agent/auth.json.

CommandFunctionExample
/loginLog in to AI providerOn first use, enter /login and select Anthropic from the list to complete subscription login.
/logoutLog out and clear credentialsNo parameters; run this before switching to another provider or API key authentication to avoid interference from old credentials.

Model Management

The commands in this section are used to switch models, adjust reasoning levels, and manage the model list available when cycling with Ctrl+P.

CommandFunctionExample
/modelOpen model selectorAfter opening the selector, type sonnet to filter and press Enter to select. Press Ctrl+S to save it as the startup default.
/thinkingSwitch reasoning levelNo parameters; in the level list, switch from medium to high. Press Ctrl+S to save as startup default.
/scoped-modelsManage the model list available for Ctrl+PNo parameters; when you only want to cycle among a few models, use it to select your frequently used models.
/llamaManage llama.cpp local models (see the chapter "Working with llama.cpp Local Models")No parameters; open the model menu, select an unloaded model and press Enter to load it, or select a loaded model and press Enter to unload it.

Session Management

The commands in this section are used to create, resume, name, navigate, and compact sessions.

CommandFunctionExample
/newStart a new sessionNo parameters; when the current direction is not working, open a clean session and start over.
/resumeResume a historical sessionAfter restarting the terminal, enter /resume and select the last session from the list to continue.
/name <name>Set the current session name/name Refactor authentication module, then quickly locate it by name in the /resume list.
/sessionView session informationRun once before and once after compaction to compare token usage and cost changes.
/treeOpen session tree browserAfter trying two implementations for the same problem, use it to jump back to a previous node and take another path.
/forkFork a new session from historical messagesUse this when you want to restart from the 3rd round of questions without affecting the current session.
/cloneClone the current branch to a new sessionBefore asking the AI to make major code changes, /clone to keep a copy so you can roll back anytime if something goes wrong.
/compactManually compact the contextWithout parameters, it compacts using the default strategy; you can also use `/compact focus on security changes` to specify the summary focus.

Content Operations

The commands in this section are used to copy, export, import, and share session content.

CommandFunctionExample
/copyCopy the AI's last replyNo parameters; use this when you want to paste the solution into an issue or document.
/export <file>Export as HTML or JSONL file/export ~/Desktop/session.html
/import <file>Import a JSONL session file/import session.jsonl
/shareUpload as a private GitHub Gist and shareNo parameters; after running, it generates a shareable HTML link for a private Gist.

Settings & Management

The commands in this section are used to adjust settings and maintain the running environment.

CommandFunctionExample
/settingsOpen settings panelNo parameters; use it when you want to adjust reasoning level, theme, or transport protocol.
/trustSave project trust decisionRun this after confirming the project source is trustworthy to avoid the trust prompt appearing on every startup.
/reloadHot reload all resourcesRun this after modifying extension or Skill code without needing to exit and restart.
/hotkeysShow keyboard shortcuts listNo parameters; view this when you forget which shortcut corresponds to an action.
/changelogShow version changelogRun this after upgrading to quickly see what changes this update brings.
/quitExit Pi AgentNo parameters; sessions are auto-saved, so exiting won't lose records.

Extension Commands

Extensions can register custom commands.

Skills are automatically registered as/skill:namecommands.

Prompt templates are invoked via/template-name.

Command typeFormatExample
Extension command/command-name/stats
Skill command/skill:skill-name/skill:brave-search
Prompt template/template-name/review

Shell Commands

Start with ! or !! in the input box to directly execute terminal commands without exiting Pi Agent.

PrefixFunctionExample
!Execute command, send output to AI!npm test, let the AI continue fixing based on the test failure information.
!!Execute command, do not send output to AI!!cat ~/.zshrc, just view the content yourself without consuming context.
Other Extensions