Working in a Session

Giving the agent context

In the promptWhat it does
@path/to/fileAttach a file
Ctrl+VPaste an image or text (screenshots work)
/skill:<name>Use a skill
^Pick a model to handle part of the request (see Subagents)

You can also run commands yourself without asking the agent:

PrefixWhat it does
!Run a shell command, e.g. !git status
$Run Python code (requires puq setup python)

Steering while the agent works

You don’t have to wait for the agent to finish.

KeyEffect
EnterSend a message now; the agent reads it at its next step
Ctrl+Enter / Ctrl+QQueue a message for after the current task finishes
Alt+UpTake the last queued message back into the editor
EscStop the current response

Side questions

Ask something without disturbing the main conversation:

/btw what does the retry option in fetchUser do?

The answer uses the current session’s context but is not added to the conversation. Run /btw alone to see earlier side questions.


Undoing changes

puq code takes a snapshot of your files before each message you send.

CommandEffect
/undoRestore files to how they were before your last message
/redoRe-apply what /undo reverted

Snapshots are stored in your project’s git repository under a separate internal ref. They never touch your branches, staging area, or commit history.

Undo works in git repositories. You can still use git directly (!git diff, !git checkout -- file) at any time.

To go back in the conversation instead of the files, use /branch (pick an earlier message) or /tree. See Sessions & Shortcuts.


Tracking progress

For multi-step work the agent keeps a todo list, shown above the prompt.

CommandEffect
/todoShow the list
/todo editEdit the list in your editor
/todo expandShow every item
/todo collapseShow a short preview

Long sessions

Every model has a limited context window. When a session gets long, puq code automatically compacts it: older messages are replaced by a summary so the agent can keep working.

Compact manually at any time, optionally telling it what to keep:

/compact
/compact keep the database migration details

Tips:

  • Start a new conversation with /new when you switch to an unrelated task.
  • /clear empties the conversation but keeps the session on disk.
  • Put rules that must survive long sessions in RULES.md.

Magic keywords

Some words in your prompt give the agent extra instructions for that message:

KeywordEffect
ultrathinkThink carefully step by step; uses the highest reasoning level when thinking is on auto
orchestrateSplit the work into parts, delegate to subagents in parallel, and verify each part
ultrathink about the failure modes before changing this API
orchestrate the migration described in docs/plan.md

Keywords must be lowercase, standalone words. Words inside code (`ultrathink`) or file names are ignored. Turn them off in /settings → Interaction → Magic Keywords, or with puq config set magicKeywords.enabled false.


Voice

ActionHow
Dictate a promptHold Space, speak, release
Live voice conversationCtrl+L or /live

Install the speech components first with puq setup speech.


Other useful commands

CommandDescription
/modelChoose the model and set model roles
/settingsOpen the settings panel
/reviewAsk the agent to review your current changes
/copyCopy a message or code block
/hotkeysShow all keyboard shortcuts
/extensionsShow loaded context files, skills, and extensions
/exitQuit puq code