hive.terminal-tools-troubleshooting
What it does
This skill gives an AI a list of fixes for odd results from terminal commands. It is for anyone whose AI run produced confusing output or errors.
When to use it
- βWhen a command finishes without an error but prints nothing.
- βWhen the exit code is missing or a result shows a timeout or an expired handle.
- βWhen the AI gets a too many jobs or session busy message.
Skill link
https://github.com/aden-hive/hive/blob/main/core/framework/skills/_preset_skills/terminal-tools-troubleshooting/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βMy command ran but printed nothing. Can you find out why and show me the output?β
5 new skills a week. 1 minute to read.
How it works
The AI matches the symptom to a known cause, such as output sent to the error stream or a buffer that was not flushed, and applies the recipe that fits.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Troubleshooting terminal-tools
Recipes for surprising results. Match the symptom to the section.
Empty stdout despite the command "should have" produced output
Possible causes:
- Output went to stderr instead. Check
stderrin the envelope (or usemerge_stderr=Truefor jobs). - Output was fully truncated because
max_output_kbis too small. Checkstdout_truncated_bytes > 0. Bumpmax_output_kbor paginate viaoutput_handle. - Command produced no output (correct, just unexpected β
silentflags, no matches). - Pipeline issue: the last stage of a pipe ran but stdout went elsewhere (
> /dev/null, redirected via2>&1). - Process is buffering its output and didn't flush before exit. Add
stdbuf -oL(line-buffered) orunbufferto the command.
exit_code: null
| Cause | Other field |
|---|---|
| Auto-backgrounded | auto_backgrounded: true, job_id: <X> |
| Hard timeout, process killed | timed_out: true |
| Pre-spawn failure (command not found) | error: ... set, pid: null |
Still running (in terminal_job_logs) |
status: "running" |
output_handle returned expired: true
5-minute TTL. Either (a) you waited too long, or (b) the store evicted it under memory pressure (64 MB total cap, LRU eviction). Re-run the command.
To reduce risk: paginate the handle as soon as you receive it, or use terminal_job_* for huge outputs (4 MB ring buffer with offsets β no expiry).
"too many jobs" / JobLimitExceeded
TERMINAL_TOOLS_MAX_JOBS (default 32) hit. Either:
- Wait for jobs to exit (poll with
terminal_job_logs(wait_until_exit=True)) - Kill old jobs:
terminal_job_manage(action="list")to see what's running, thensignal_termthe abandoned ones - Raise the cap via env (rare)
"session busy"
A terminal_pty_run was issued while another _run is in flight on the same session. PTY sessions are single-threaded conversations. Wait for the prior call to return, or open a second session.
"PTY cap reached"
TERMINAL_TOOLS_MAX_PTY (default 8) hit. Close idle sessions (terminal_pty_close). Idle reaping is lazy; force it by opening β no, actually, opening throws when the cap is hit. Just close manually.
warning is set, the command worked
Informational only. The pattern matched (e.g. rm -rf literally appears, or git push --force was used). The command ran. The warning is your "did I mean to do that?" prompt β verify the side effect was intended before continuing.
semantic_status: "ok" but exit_code: 1
Working as designed. Some commands use exit 1 for legitimate non-error states:
grep/rgexit 1 when no matches foundfindexit 1 when some directories were unreadable (typical on/proc, etc.)diffexit 1 when files differtest/[exit 1 when condition is false
The semantic_message field explains. Trust semantic_status, not raw exit_code.
semantic_status: "error" but exit_code: 0
Shouldn't happen. If it does, file a bug.
truncated_bytes_dropped > 0 in terminal_job_logs
Your since_offset was older than the ring buffer's floor β bytes evicted before you could read them. Either:
- Poll faster (lower latency between calls)
- Use
merge_stderr=True(single 4 MB ring instead of 4 MB Γ 2) - Accept the gap and move forward from
next_offset
terminal_pty_open succeeds but the first _run times out
The session may not have produced its first prompt sentinel within the 2-second startup window. Try:
- A
terminal_pty_run(sid, read_only=True, timeout_sec=2)to drain whatever's accumulated - A noop command (
terminal_pty_run(sid, command="true")) to force a prompt cycle
Could also indicate the bash process died at startup β terminal_pty_run(sid, ...) would then return "session has exited".
shell="/bin/zsh" returned an error
By design. terminal-tools is bash-only on POSIX. Use shell=True (default /bin/bash) or omit shell= to exec directly.
A command in shell=True is interpreted differently than expected
Bash, not zsh, semantics. **/* doesn't recurse without shopt -s globstar; =cmd expansion doesn't work; arrays use arr[idx] not ${arr[idx]} differently than zsh. When in doubt, the foundational skill's "bash, not zsh" section is the canonical statement.
FAQ
Why is the output sometimes empty?
Output may have gone to the error stream, been cut by a size limit, or not been flushed before the program exited.
What does a missing exit code mean?
It usually means the command was moved to the background, timed out or failed before it could start.
How long are output handles kept?
They expire after five minutes, so the AI should read them promptly.
Details
Original description by the author
Read when a terminal-tools call returned something surprising β empty stdout despite no error, exit_code is null, output_handle came back expired, "too many jobs" / "session busy" / "too many PTYs", warning was set unexpectedly, semantic_status disagrees with exit_code. Diagnostic recipes only β load on demand. Don't preload; the foundational skill covers the happy path.
repo: aden-hive/hive
Popularity
- GitHub stars
- 11k
- Ranking position
- #11816
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
browser-edge-cases
11kHelps your agent fix browser automation that fails on tricky sites such as LinkedIn, X or pages with heavy scripts.
hive.browser-automation
11kTeaches your agent to control your own Chrome browser with the hive-browser tool, using screenshots and clicks.
hive.colony-progress-tracker
11kHelps your agent claim tasks and record its steps and checks in a shared database, so work is tracked as it goes.
hive.context-preservation
11kHelps your agent save key facts from long tool results into notes before older details are removed from its memory.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.