hive.terminal-tools-troubleshooting
하는 일
이 스킬은 AI에게 터미널 명령의 이상한 결과를 해결하는 방법 목록을 제공합니다. AI 실행 결과가 헷갈리거나 오류가 나온 모든 사람을 위한 것입니다.
사용하는 경우
- ✓명령이 오류 없이 끝났는데 아무것도 출력하지 않을 때.
- ✓종료 코드가 없거나 결과에 시간 초과나 만료된 핸들이 보일 때.
- ✓AI가 작업이 너무 많다거나 세션이 바쁘다는 메시지를 받은 경우.
스킬 링크
https://github.com/aden-hive/hive/blob/main/core/framework/skills/_preset_skills/terminal-tools-troubleshooting/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 명령이 실행됐는데 아무것도 출력되지 않았습니다. 원인을 찾아서 출력 내용을 보여 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 증상을 알려진 원인, 예를 들어 오류 스트림으로 간 출력이나 비워지지 않은 버퍼와 맞춰 보고, 맞는 해결 방법을 적용합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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.
자주 묻는 질문
출력이 왜 가끔 비어 있나요?
출력이 오류 스트림으로 갔거나, 크기 제한에 잘렸거나, 프로그램이 끝나기 전에 비워지지 않았을 수 있습니다.
종료 코드가 없다는 것은 무슨 뜻인가요?
보통 명령이 백그라운드로 넘어갔거나, 시간 초과되었거나, 시작 전에 실패했다는 뜻입니다.
출력 핸들은 얼마나 유지되나요?
5분 뒤에 만료되므로, AI는 바로 읽어야 합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 11k
- 순위
- #11816
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
browser-edge-cases
11k에이전트가 LinkedIn, X 같은 까다로운 사이트나 스크립트가 많은 페이지에서 실패하는 브라우저 자동화를 고치도록 돕습니다.
hive.browser-automation
11k에이전트가 hive-browser 도구로 내 Chrome 브라우저를 제어하도록 가르칩니다. 스크린샷과 클릭을 사용합니다.
hive.colony-progress-tracker
11k에이전트가 작업을 맡고 단계와 점검 내용을 공유 데이터베이스에 기록하도록 돕습니다. 작업이 진행되는 동안 추적됩니다.
hive.context-preservation
11k에이전트가 긴 도구 결과에서 핵심 사실을 메모로 저장해, 오래된 세부 내용이 기억에서 지워지기 전에 보존하도록 돕습니다.