shell-safety
Skill1 starsChanged 3 months agoMITView on GitHub
Prevent interactive CLI commands from freezing agent sessions. Hard ban on interactive commands (more/less/pause/choice/start /WAIT) with non-interactive equivalents, a mandatory timeout rule, and a pre-flight checklist. Use when running shell commands, diagnosing hangs, or choosing safe CLI alternatives. 防止交互式命令冻结 agent 会话,提供安全替代。
4 other projects use a version of this.
Adopted by
Most recently taken up by
- alexderz/agentic-toolboxtheir own version, first seen Oct 17, 2026
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- buriedsignals/spotlighttheir own version, first seen Aug 26, 2026
- sentineldesk/agenttheir own version, first seen Aug 24, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- buriedsignals/spotlight★ 59same name
- alexderz/agentic-toolbox★ 5same name
- aprameyak/coding-skills★ 1same name
- sentineldesk/agent★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 80
Every shell call MUST include a timeout.
- Distinctive: line 89
Never omit the timeout. The default is "wait forever" — exactly what you're preventing.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shell-Safety
Overview
Prevent interactive CLI commands from freezing agent sessions. When running inside a headless shell-execution tool (the subprocess has no interactive terminal / TTY), commands that wait for keyboard input (more, less, pause, choice, start /WAIT) will block forever, freezing the calling agent until the process is killed externally.
This skill enforces a hard ban on interactive commands and provides non-interactive equivalents for every common use case.
Ban List (NEVER use these)
| Command / Pattern | Why banned |
more | Paginates, waits for keypress |
more.com | Same as more (explicit extension) |
less | Paginates, waits for keypress |
pause | "Press any key to continue..." |
choice | Interactive menu prompt |
start /WAIT app | Waits for GUI window to close |
cmd ... | more | Pipe into pager = indefinite block |
* | more +N | Skip-N pager variant, same effect |
Any command that requires human interaction is forbidden in a headless agent shell. Assume the shell has no keyboard or display.
Safe Replacements
Counting matches / lines
:: Banned
findstr /i "pattern" file | more +0 | find /c "pattern"
:: Correct (native find /c)
findstr /i "pattern" file | find /c /v ""# Single line counting
(Select-String -Path file -Pattern 'pattern').CountViewing output (non-interactive full dump)
:: Banned
type file | more
more file
:: Correct
type filePause / confirmation — NEVER use in scripts run by agents
:: Banned
pause
:: Correct: just skip it. The agent doesn't need human confirmation mid-script.
rem (remove the pause entirely)Waiting for external processes
:: Banned
start /WAIT notepad.exe
:: Correct: timeout-controlled wait for known processes
timeout /T 10 /NOBREAK
tasklist | findstr processnameTimeout Rule (MANDATORY)
Every shell call MUST include a timeout. This is the hard kill switch:
run_shell(command="...", timeout_ms=60000) # 60s max- Short lookups (findstr on small files):
timeout_ms=15000 - Medium scans (grep on <100 files):
timeout_ms=30000 - Long commands (builds, tests):
timeout_ms=300000(5 min) - Never omit the timeout. The default is "wait forever" — exactly what you're preventing.
Pre-Flight Checklist (before every shell call)
- No
more,less,pause,choice,start /WAITanywhere in the command string or pipeline - No
more.comexplicit extension (PATH shims can't intercept it) - A timeout is set and reasonable for the expected runtime
- If counting/filtering: use
find /c /v ""or PowerShellSelect-String+.Countinstead of piping through pagers - If viewing output:
type(Windows) orcat(cross-platform) — NEVER pipe to a pager
Why This Exists
A real incident: an agent session froze for 12+ minutes because the model generated:
findstr /i "/api/health" logs\endpoint_hits.jsonl | more +0 | find /c "/api/health"more +0 waited for keyboard input that would never arrive. The pipe chain blocked, the model waited on its shell tool, and the session appeared dead — the only recovery was externally killing the findstr and more.com processes.
This skill plus a companion PATH-level shim (which replaces more/less/pause with non-interactive equivalents) form a two-layer defense against this class of bug.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

