Guide · Agent skill
How to use the Background Job Control agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The Background Job Control skill teaches an AI agent how to run commands that take more than a minute, keep them going while it does other work, and read their output in small pieces. It is written for the Hive terminal-tools server and is useful if you run builds, long test suites, dev servers, or streaming logs through an agent. After reading this guide you will know how to install the skill, how to ask for it in plain language, and how to stop jobs safely.
Quick start
- 1Download the ZIP. Get the skill ZIP from this page. It contains SKILL.md and references/signals.md.
- 2Install it. Unzip it into ~/.claude/skills/ for all projects, or into .claude/skills/ in one project. In the Claude apps, upload it under Settings → Capabilities → Skills instead.
- 3Confirm the Hive terminal-tools server is running. The skill needs the terminal_job_start, terminal_job_logs and terminal_job_manage tools from that server.
- 4Ask for a long-running task. Describe a build, test run, dev server or log to watch in plain language. The agent starts it as a background job and gives you the job ID.
- 5Poll or wait for output. The agent reads output using next_offset each time, or blocks with wait_until_exit until the job exits or the timeout passes.
- 6Stop the job if needed. Ask the agent to stop the job. It checks capabilities first, then uses the escalation order for your platform.
What the skill makes the agent do
Without this skill, an agent either waits for a command to finish or loses track of it. With the skill installed, the agent starts long-running work as a background job, gets back a job ID, and keeps working while the job runs.
The skill covers three Hive tools: terminal_job_start launches a job, terminal_job_logs reads its output, and terminal_job_manage handles stopping it, sending stdin, and listing jobs.
- Builds, deploys and long test runs
- Dev servers and other processes you want to monitor
- Commands that terminal_exec moved to the background on its own
How to install the Background Job Control skill
Download the skill ZIP from this page. Then choose one of the two install routes below.
For Claude Code, unzip the file into ~/.claude/skills/ to make it available everywhere, or into a project's .claude/skills/ folder to limit it to that project.
In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.
- Personal install: ~/.claude/skills/
- Project install: .claude/skills/ inside your project folder
- Claude apps: Settings → Capabilities → Skills
How to trigger the skill with natural requests
You do not need a special command. Ask for something that takes time, or that you want to keep watching, and the agent should pick up the skill. The skill's description says it applies when a command runs longer than a minute, streams logs, or should keep running while other work happens. It also applies when terminal_exec has already moved a command to the background and returned a job_id.
Plain requests that fit the skill include asking the agent to run the full test suite while it keeps reviewing code, or to start the dev server and tell you when it is ready.
- Run the full test suite in the background and keep working on the bug meanwhile.
- Start the dev server and watch its log for errors.
- Follow the log file build.log and tell me when the build fails.
- Stop the background build that is still running.
Read job output without losing or repeating lines
The agent reads output in pieces. Each call to terminal_job_logs returns a next_offset value, and the agent passes that value back as since_offset on the next call. This is how it avoids both replaying old lines and skipping new ones.
If the agent has fallen behind, the response includes truncated_bytes_dropped. A value above zero means the output buffer discarded bytes you had not read yet, so the job is producing output faster than it is being read. The fix is to poll more often, or to accept the gap and continue from next_offset.
To wait for a job to finish in one call, the agent can block on the server with wait_until_exit and a timeout.
- Output is held in a 4 MB ring buffer per stream.
- Use merge_stderr=True when the output should be read as one ordered stream, such as most servers and build tools.
- Use merge_stderr=False when stderr is only errors and stdout is data.
terminal_job_logs(job_id="job_xxx", since_offset=N, wait_until_exit=True, wait_timeout_sec=30)Stop a background job safely on Linux, macOS or Windows
Before sending any signal, the agent should ask the server which actions it supports. The capabilities action returns the platform, the supported actions, and the meaning of each signal.
On Linux and macOS, the escalation order is signal_int first, then signal_term if the job does not stop, and signal_kill only as a last resort. signal_term allows up to 2 seconds before forced cleanup. Whether the program cleans up depends on the program itself.
On Windows, signal_term and signal_kill both forcefully terminate the whole job process tree, with no application cleanup. signal_int and other POSIX signals return unsupported_action. If the program has a documented shutdown command read from stdin, the agent can write it first, then force termination.
- Check what is supported: terminal_job_manage(action="capabilities")
- Linux/macOS order: signal_int, then signal_term, then signal_kill
- Windows: signal_term or signal_kill only, both forceful
- After signaling, confirm the exit with wait_until_exit and wait_timeout_sec=2
terminal_job_manage(action="capabilities")Know the limits and safety notes
The most important rule is that background jobs end when the terminal-tools server restarts. The desktop runtime restarts terminal-tools when Hive restarts, and there is no way to reattach. Using nohup does not prevent this. Anything that must keep running across restarts needs a real service manager.
The server allows a maximum number of concurrent jobs, set by TERMINAL_TOOLS_MAX_JOBS with a default of 32. When that cap is reached, terminal_job_start returns an error until jobs exit or are stopped. Output is kept in memory only, so it is not available after a restart. The 50 most recent finished jobs remain listed, and older ones are dropped first in first-out order.
The skill runs scripts, but it does not use the network.
- Jobs end when terminal-tools restarts; no reattach.
- nohup does not change this.
- Default cap is 32 concurrent jobs (TERMINAL_TOOLS_MAX_JOBS).
- Finished jobs: the 50 most recent are kept for inspection.
- Output lives in memory only and is not kept across restarts.
What people use it for
- Run a full test suite while the agent keeps fixing failing tests in other files.
- Start a dev server and watch its log until it reports ready.
- Follow a streaming log file while the agent investigates an error.
- Stop a stuck build on Windows or Linux without leaving a half-finished process running.
Frequently asked questions
What is the Background Job Control agent skill?
It is an agent skill, a folder with a SKILL.md instruction file and reference notes, that teaches an AI agent how to run long commands as background jobs. It uses the Hive terminal_job_start, terminal_job_logs and terminal_job_manage tools to start, read and stop them.
How do I install the Background Job Control skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for all projects, or into .claude/skills/ in a specific project. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.
What do I need to use this skill?
You need the Hive terminal-tools server, which provides the terminal_job_start, terminal_job_logs and terminal_job_manage tools. The skill runs scripts and does not use the network.
Is the skill free, and what is its licence?
The source project, aden-hive/hive, is licensed under Apache-2.0. This page does not state pricing for the skill, so check the directory listing for any cost details.
Why did my background job stop after Hive restarted?
Background jobs end when the terminal-tools server restarts, and there is no way to reattach to them. Running nohup does not prevent this. For anything that must keep running, use a separate service manager.
Can I use this instead of a plain terminal command?
For quick commands that finish in seconds, the plain terminal_exec tool is simpler. Use this skill for commands that run longer than a minute, stream logs, or need to keep running while the agent works.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you regularly run builds, long tests, dev servers or streaming logs through an AI agent and want it to keep working while they run. Pick something else for permanent services that must survive restarts, for quick commands that finish in seconds, or for environments where forced process termination is unacceptable, since on Windows stopping a job kills its whole process tree without cleanup.
Download the skill