Pi’s interactive mode provides a powerful terminal interface for working with AI agents. The interface consists of four main areas: startup header, message history, input editor, and status footer.
# Basic interactive modepi# With initial promptpi "List all TypeScript files in src/"# Continue previous sessionpi -c# Resume from session selectorpi -r# With specific modelpi --model anthropic/claude-sonnet-4# With thinking levelpi --thinking high "Solve this complex problem"
Press Enter to queue a steering message. It’s delivered after the current tool execution, interrupting remaining tools.Use this to redirect the agent mid-turn:
> Agent is running bash commands...> You type: "Actually, use Python instead"> Press Enter> Agent stops after current command and receives your message
2
Follow-up Messages
Press Alt+Enter to queue a follow-up message. It’s delivered only after all work is complete.Use this for new requests:
> Agent is working...> You type: "Also check the test coverage"> Press Alt+Enter> Agent finishes current work, then receives your message
3
Managing Queued Messages
Escape: Abort and restore queued messages to editor
# Start Pi with high thinking for planningpi --thinking high# In Pi:> "Create a new TypeScript library for parsing markdown"> Agent creates files...> /tree # Review what was created> /name markdown-parser> /session # Check session location and stats
Continuing Work
# Resume previous sessionpi -c# Or select from listpi -r# In Pi:> "Continue implementing the parser"> /model # Switch to faster model for iteration> Ctrl+P # Cycle between configured models
Branching for Experiments
# In Pi:> "Let's try a different approach"> /fork # Creates new session from current point> Agent continues in new branch> /export experiment.html # Save for later review