kavin525zhang/llm_reasoning_framework/terminal-tools-job-control
- community
Checking that the SKILL.md file is still in the repository.
Use when launching anything that runs longer than a minute, anything that streams logs, anything you want to keep running while doing other work — or when terminal_exec auto-backgrounded on you and returned a job_id. Teaches the start→poll→wait pattern with terminal_job_logs offset bookkeeping, the `wait_until_exit=True` blocking-poll idiom, the truncated_bytes_dropped resumption signal, the merge_stderr decision, the SIGINT→SIGTERM→SIGKILL escalation ladder via terminal_job_manage, and the hard rule that jobs die when the terminal-tools server restarts. Read before calling terminal_job_start, or right after terminal_exec auto-backgrounded.
Install
npx vskill@latest install kavin525zhang/llm_reasoning_framework/terminal-tools-job-controlSKILL.md
The same SKILL.md was published earlier as aden-hive/hive/terminal-tools-job-control.
Background job control
Background jobs are how you do things that take time without blocking your conversation. Three tools cover the surface: terminal_job_start, terminal_job_logs, terminal_job_manage.
When to use a job
- Builds, deploys, long tests
- Processes you want to monitor (streaming a log file, a dev server)
- Anything that auto-backgrounded from
terminal_exec(you have ajob_id; pivot to this skill's idioms)
For one-shot work expected to finish quickly, terminal_exec is simpler. The auto-promotion mechanic in terminal_exec is your safety net — start with terminal_exec, take over with this skill if needed.
Lifecycle
After exit, the job is retained for inspection (terminal_job_manage(action="list")) until evicted by FIFO (50 most recent exits kept).
Offset bookkeeping — the only rule that matters
The job's output lives in a 4 MB ring buffer per stream. Each call to terminal_job_logs returns:
data— bytes betweensince_offsetandnext_offsetnext_offset— pass this assince_offseton your next calltruncated_bytes_dropped— non-zero when yoursince_offsetwas older than the ring's floor (you fell behind)
Always carry `next_offset` forward. Don't replay from 0 — that's an offset reset, you'll see the same data twice and miss the part that fell off.
When truncated_bytes_dropped > 0, the buffer evicted N bytes between your last call and now. Treat it as a signal that the job is producing output faster than you're consuming. Either poll more often or accept the gap and read from next_offset going forward.
merge_stderr — interleaved or separate
Pick merge_stderr=True when:
- The job's logs are designed to be read together (most servers, build tools)
- You don't need to distinguish "this was stderr"
Pick merge_stderr=False when:
- stderr is genuinely error-only and stdout is data
- You'll process them differently
Signal escalation
The idiom: signal_int → wait 2-5s → signal_term → wait 2-5s → signal_kill. Most well-behaved processes handle SIGINT (graceful) and SIGTERM (cleanup, then exit). SIGKILL bypasses cleanup — use only when the process is truly unresponsive.
After signaling, check exit with terminal_job_logs(job_id, wait_until_exit=True, wait_timeout_sec=2).
Stdin
For tools that read stdin to EOF, close_stdin after writing flushes them. For interactive tools that read line-by-line, just write each line.
Take-over: when terminal_exec auto-backgrounds
When terminal_exec returned auto_backgrounded: true, job_id: <X>, the process is already in the JobManager with its output flowing into the ring buffer. Your transition is seamless:
Or block until exit and grab everything:
Hard rules
- Jobs die when the server restarts. The desktop runtime restarts terminal-tools when Hive restarts. There's no re-attach. If you need durability, use
nohup+terminal_execto detach into the system's process tree and track the PID yourself. - Server-wide hard cap on concurrent jobs (
TERMINAL_TOOLS_MAX_JOBS, default 32). Past the cap,terminal_job_startreturns an error. Wait for jobs to exit or kill old ones. - No cross-restart output. Output handles and ring buffers are in-memory only.
See references/signals.md for the full signal catalog.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingHarness/hive/core/framework/skills/_preset_skills/terminal-tools-job-control/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kavin525zhang/llm_reasoning_framework/terminal-tools-job-control)