Common issues
Fixes for the problems people hit most, from a shell that is not protected to a locked terminal.
Risky commands run without a challenge
Check the live shell first:
shellfirm doctor| Finding | Cause | Fix |
|---|---|---|
[XX] session … has NOT loaded the shellfirm hook | The shell was started before shellfirm init, or without rc files (bash --norc) | Restart that shell (exec bash, exec zsh, exec fish, …) or open a new terminal |
[XX] binary shellfirm is not on PATH | The binary was removed, or nvm use switched Node.js versions | See binary not found in PATH |
[XX] rc_file … does not load the shellfirm hook | The hook line is missing from the rc file | shellfirm init <shell> |
[XX] hook_loaded | A new interactive shell does not load the hook, for example because the rc file returns before the hook line | Make sure the hook line is reached, then run doctor again |
[XX] enter | Something rebound Enter so it no longer goes through shellfirm | doctor names the known plugin conflicts; to check bindings you changed in this session, run __shellfirm_doctor_probe | shellfirm doctor --stdin. See Plugins and frameworks |
Other things to check:
- bash with ble.sh. ble.sh replaces readline, so shellfirm's Enter
binding is not used. Lines get garbled (
syntax error near unexpected token '}') and each prompt warnsthe last command did not pass through shellfirm (Enter was rebound) and was NOT checked; without atuin, Enter can do nothing at all.doctordoes not detect it;echo $BLE_VERSIONprinting a version (or, when Enter does nothing,grep -n ble.sh ~/.bashrcmatching) means ble.sh is loaded. ble.sh is not supported; see Plugins and frameworks. - The shell is not tested. PowerShell and Oils hooks are shipped but not yet tested end to end. See Shell setup.
- The command is not risky by any check.
shellfirm check -c '<command>'tells you whether something matched and why a match did not apply (ignored by your settings,below your min_severity,skipped, <path> does not exist). - You run a script. The hook checks the line you type. It does not read
the contents of
./cleanup.sh. See Known limitations.
After upgrading from 0.3.10
Restart every open shell. The shell hooks changed (hook version 14). A
new bash, zsh or fish picks them up automatically; an open one keeps the old
hook until you restart it (exec bash, exec zsh, …). Nushell, elvish and
xonsh embed the hook in the rc file: run shellfirm init --all again to
update it. shellfirm doctor reports a shell that still runs an old hook.
Re-run shellfirm connect <agent> for each AI agent you connected. The
0.3.10 hook line keeps working, but shellfirm status reports it as a legacy
hook, and Cursor gains its preToolUse hook only this way. Then restart the
agent sessions.
The full checklist is in Upgrading to 0.4.0.
Too many prompts
shellfirm has no "allow once" switch. Choose what fits:
shellfirm config severity High # only prompt for High and Critical
shellfirm config ignore git:reset # never prompt for this one check
shellfirm config groups --disable heroku # turn off a group you never use
shellfirm config challenge Enter # lighter challenge (Critical still asks for yes)The banner tells you the id to ignore:
Not risky for you? Stop asking with `shellfirm config ignore git:reset`.Notes:
fs-strict:recursive_deletionis a broad catch-all forrm -rf. Ignoring it silences it for every command it matches; the banner says so.- A recursive delete of a folder with uncommitted or untracked files is High,
so it still asks with
min_severity: High. See Uncommitted work. - Checks that a project policy (
.shellfirm.yaml) enforces still prompt;shellfirm policy showlists them.
The settings file is invalid
Every command names the file, the line and the column, and keeps working with built-in defaults only for the invalid keys. The file is never overwritten:
shellfirm: warning: invalid settings file /home/dev/.config/shellfirm/settings.yaml: challenge: unknown variant `Banana`, expected one of `Enter`, `Math`, `Yes` at line 1 column 12
shellfirm: using built-in defaults for the invalid values (the file was not modified). Fix it with `shellfirm config edit`.shellfirm config setters refuse to change an invalid file (exit 78):
shellfirm: error: invalid settings file /home/dev/.config/shellfirm/settings.yaml: challenge: unknown variant `Banana`, expected one of `Enter`, `Math`, `Yes` at line 1 column 12
The file was not changed. Fix it with `shellfirm config edit`, or start over with `shellfirm config reset` (the old file is backed up).Fix it with shellfirm config edit (an invalid edit is rejected), or start
over with shellfirm config reset (backs up the old file). Values are
case-sensitive: challenge: Yes, not yes.
A warning about SHELLFIRM_CONFIG_DIR
shellfirm: warning: SHELLFIRM_CONFIG_DIR=/nope: no such directory; using the default configuration directory (fix: `unset SHELLFIRM_CONFIG_DIR`, or create that directory)The variable names a directory that does not exist. The shell hook keeps
checking every line against the default location and prints this once per
session. Run unset SHELLFIRM_CONFIG_DIR or create the directory. Other
commands (check, config, status) stop with exit 2 instead.
The prompt takes a moment to appear
Before the banner, shellfirm measures what the command would affect (files,
branches, resources). It spends at most blast_radius_budget_ms on it per
command: 400 ms by default, 5000 at most. When it takes longer than 200 ms
you briefly see:
shellfirm: checking impact… (Ctrl-C cancels)Ctrl-C there cancels the command at once. To change the budget:
shellfirm config impact-budget 200 # wait less (counts may stop early)
shellfirm config impact-budget 2000 # wait longer for exact counts
shellfirm config impact-budget 0 # no impact measurement at allA count that ran out of time is a stated lower bound, for example
more than 100,000 files (stopped counting). See
Blast radius.
"Another git process seems to be running"
Older versions could leave a stale .git/index.lock behind after checking a
command, so the next git add or git commit failed. 0.4.0 fixed this: every
git query shellfirm runs uses --no-optional-locks, and a query stopped by
the time budget gets SIGTERM first so git removes its lock files. If you
still have a stale lock from an older version, and no git command is running,
delete .git/index.lock.
An AI agent runs commands without shellfirm
-
Re-run
shellfirm connect claude-code(orcursor). It upgrades the hook in place and writes a backup. -
Restart the agent session. Agents read hooks when a session starts.
-
Check
shellfirm statusunder Agent integrations:Output claude-code (user): hook yes, file tools yes, fail-closed yes, MCP yes -
Make sure the agent can find the
shellfirmbinary on itsPATH.
The shell hook does not protect agents: agents run commands without your interactive prompt. Use the agent hooks. See AI agents.
status shows hook OFF
The hook is installed, but the agent's own settings turn hooks off. The line names the file and how to turn it back on:
claude-code (user): hook OFF, file tools yes, fail-closed yes, MCP yes (disableAllHooks is true in /home/dev/.claude/settings.json: Claude Code runs no hook (remove it or set it to false))For Claude Code, remove disableAllHooks (or set it to false) in the
managed, local, project or user settings file named there. For Codex CLI, set
[features] hooks = true in config.toml. For Gemini CLI, /hooks disable shellfirm is undone by running shellfirm connect gemini again;
hooksConfig.enabled: false you turn back on yourself. Apart from Gemini's
/hooks disable, re-running connect does not change these switches.
If you set CLAUDE_CONFIG_DIR, shellfirm reads and writes Claude Code's files
there ($CLAUDE_CONFIG_DIR/settings.json, $CLAUDE_CONFIG_DIR/.claude.json).
Cursor shows fail-closed no
That is expected. connect cursor leaves Cursor's failClosed off, because
Cursor treats shellfirm's silent answer for a safe command as a failure and
would block every command. If the Cursor hook itself fails or times out,
Cursor runs the command. shellfirm never exits without a decision for risky
input: a crash becomes a deny.
Codex CLI does not run the hook
Codex runs a new or changed hook only after you trust it, and codex exec
skips an untrusted hook without a warning. Start the interactive codex once
and trust the hook (or open /hooks). Re-running shellfirm connect codex
after a change to the hook line needs a new trust. See
Codex CLI.
Cline does not run the hook
In the VS Code extension, turn on Enable Hooks in Cline's settings (Cline
3.36 or later). shellfirm status shows the reminder on the cline line. See
Cline.
A risky command is blocked instead of asked
Codex CLI, Windsurf, Cline and OpenCode hooks cannot ask, so shellfirm blocks every command it would ask about, with the reason and a safer alternative. If the command is intended, run it yourself. To ask instead, use an agent whose hooks can ask (Claude Code, Cursor, Gemini CLI, Qwen Code, Copilot CLI).
Claude Code older than 2.1.295
onFailure: block needs Claude Code 2.1.295 or later. For older versions run
shellfirm connect claude-code --no-fail-closed.
Nushell runs a risky command without a challenge
Nushell cannot cancel a command line from a hook. For built-in commands
(rm, mv, cp, save, …), custom commands and programs run by path,
shellfirm shows no challenge: it prints a warning and the line runs:
shellfirm: WARNING: this line is risky (fs-strict:recursive_deletion, fs:recursively_delete_outside), but shellfirm cannot stop nushell built-ins like rm, custom commands or programs run by path: they may still run. External programs on this line will not start.External programs (^rm, git, kubectl) get the normal challenge. If
you cancel, shellfirm clears PATH for that line, so nushell then reports
Command `rm` not found. That error is expected: the program did not start.
Treat Nushell protection as a warning, not a guard. See
Nushell limitation.
shellfirm: binary not found in PATH
shellfirm: binary not found in PATH; commands are NOT being checkedThe hook fails open so that a missing binary never locks your shell. It warns once per session, then every line runs unchecked. Common causes:
- npm under nvm, fnm or volta. A global npm install belongs to one
Node.js version. After
nvm use <another version>theshellfirmcommand is gone. Install it once per Node.js version, or install it outside Node.js (Homebrew,cargo install shellfirm --locked, a release binary). - The binary was uninstalled but the hook line is still in the rc file.
Reinstall, or remove the hook (
shellfirm init --uninstallbefore you remove the binary, see Uninstall).
If the binary is there but cannot start (a missing interpreter, a build for another platform), the hook warns on every line instead:
shellfirm: warning: /usr/local/bin/shellfirm is installed but could not run (exit 127); this command was NOT checked. Run `shellfirm doctor`.npm install -g fails with EACCES
npm's global folder belongs to root. Do not use sudo npm. Use a Node.js
version manager, or set a prefix you own
(npm config set prefix ~/.npm-global, then add ~/.npm-global/bin to
PATH). On macOS, Homebrew works too. See
Installation.
$? is wrong after a blocked line
In bash, zsh and fish, $? after a line shellfirm blocked is still the
previous command's status: the line never ran, and a key binding cannot set
the status. The line is kept in the editor (Ctrl-U clears it). Scripts should
use shellfirm check --exit-code. See
Exit codes.
Commands without a terminal are blocked
A challenge needs a terminal. Without one (CI, a script, </dev/null) the
shell hook blocks the command and exits 74:
shellfirm: cannot prompt (no terminal); command blocked: fs:recursively_delete, fs-strict:recursive_deletion require the `Yes` challengeThe audit log records it as NoTerminal. In automation use
shellfirm check instead. See
Automated scripts.
The shell is locked: every command fails
If every line you type is refused, including shellfirm itself, remove the
hook line by hand and open a new terminal. Use an editor that does not start
your shell (a GUI editor), or another shell without the hook
(bash --norc, /bin/sh).
| Shell | rc file | Line or block to remove |
|---|---|---|
| Zsh | ~/.zshrc | eval "$(shellfirm init zsh)" |
| Bash | ~/.bashrc | eval "$(shellfirm init bash)" |
| Fish | ~/.config/fish/config.fish | shellfirm init fish | source |
| Nushell | ~/.config/nushell/config.nu | The embedded hook block |
| PowerShell | ~/.config/powershell/Microsoft.PowerShell_profile.ps1 | The embedded hook block |
| Elvish | ~/.config/elvish/rc.elv | The embedded hook block |
| Xonsh | ~/.xonshrc | The embedded hook block |
| Oils | ~/.config/oils/oshrc | The hook line |
shellfirm init marks what it adds with the comment # Added by shellfirm init. Open a new terminal afterwards: the old one keeps the hook it
loaded. Then find the cause (shellfirm status, shellfirm doctor) and
reinstall with shellfirm init.
A stale SHELLFIRM_CONFIG_DIR or an invalid settings file never locks the
terminal: the hook warns and keeps going with defaults.
The database wrapper does not catch a statement
- SQL statements are checked when they end:
;for SQL clients, aGOline forsqlcmd. A statement without;waits for more input. - Override the delimiter for one session:
shellfirm wrap --delimiter ';' mysql. - A wrapper script needs
--tool:shellfirm wrap --tool psql ./my-psql.sh.
See Database wrapper.