Read-only mode for safe code analysis in pi coding agent.
/askcommand - Toggle ask mode on/off/ask <question>command - Enable ask mode and ask a question in one step- Restricted toolset - Only read-only tools available when enabled
- Bash allowlist - Only safe, read-only bash commands are allowed
- Status indicator - Shows "❓ ask" in footer when active
/ask
Toggle ask mode on/off. When enabled:
- Available tools:
read,bash,grep,find,ls editandwritetools are disabled- Bash commands are restricted to an allowlist (see below)
/ask what does this file do?
Enable ask mode (if not already enabled) and immediately ask a question. The agent will answer using only read-only tools.
When disabled:
- Full access is restored with all your original tools
Ask mode restricts bash to these read-only commands:
- File viewing:
cat,head,tail,less,more - Searching:
grep,find,rg,fd - Info commands:
ls,pwd,file,stat,du,df,tree - Text processing:
wc,sort,uniq,diff,sed,awk,jq - System info:
env,printenv,uname,whoami,id,date,uptime,ps,top,htop,free - Git (read-only):
status,log,diff,show,branch,remote,config - npm/yarn (read-only):
list,ls,view,info,search,outdated,audit - Version checks:
node --version,python --version - Network:
curl,wget
From npm:
pi install npm:pi-ask-modeFrom GitHub:
pi install git:github.com/markokocic/pi-ask-modeCopy the files to your extensions directory:
~/.pi/agent/extensions/ask-mode/
index.ts- Main extension codeutils.ts- Utility functions
pi will automatically load extensions from ~/.pi/agent/extensions/.
Copyright (c) 2026-present Marko Kocic
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at: https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0