Run long, unattended agent CLIs and task commands through the homebased daemon, and handle the HOMEBASED_EVENT callbacks it sends back. Use when the user invokes $homebased or $hbd, when work should run in the background and report back, when a HOMEBASED_EVENT arrives, to check, cancel, or resubmit tasks, when this session is a homebased worker, or to read or compact an agent thread's context, or read a T3 thread's messages, on a Fleet machine. Do not use for work that finishes inside the cur...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Homebased?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/avencera-homebased)
---
name: homebased
description: "Run long, unattended agent CLIs and task commands through the homebased daemon, and handle the HOMEBASED_EVENT callbacks it sends back. Use when the user invokes $homebased or $hbd, when work should run in the background and report back, when a HOMEBASED_EVENT arrives, to check, cancel, or resubmit tasks, when this session is a homebased worker, or to read or compact an agent thread's context, or read a T3 thread's messages, on a Fleet machine. Do not use for work that finishes inside the current turn."
---
# Homebased
`homebased` (`$homebased`, `$hbd`) is a user daemon that runs detached tasks, GPU/CI queue jobs, and services, and sends `HOMEBASED_EVENT` messages to the submitting Codex thread, Claude Code session, or T3-owned Antigravity conversation. Submit work, end the turn, and act when events arrive.
## Rules that hold everywhere
- **Delivery belongs to `homebased`.** Never run `codex queue` or write to a Claude Code messaging socket yourself, and never tell a worker to do either.
- **Leave `thread` out.** Submit fills in a worker's parent task thread, or the calling session (`CODEX_THREAD_ID`, `CODEX_SESSION_ID`, `CLAUDE_CODE_SESSION_ID`, `ANTIGRAVITY_CONVERSATION_ID`). A plain terminal submits detached work whose events reach no session.
- **Pick the right workload.** Prefer `homebased task run --name "<goal>" -- <program> <args...>` for long commands and CI watchers; use a JSON spec with `task submit` only for `agent`, `container`, or fields `task run` lacks. Use `agent` only when a model must reason and report.
- **Set `name` to a short goal label**, not the agent or CLI. Pass `--json` on data commands and parse the result.
- **Do not poll in a loop.** Submit, tell the user the id, end the turn, and wait for events. Event delivery is at-least-once: deduplicate by `(task, seq)`, `(job, seq)`, or `(watch, seq)`.
- **Chain phases upfront with `--after <id>`** (or `after` in the spec) rather than waiting for events to submit the next phase.
- **Inside T3 Code** (`t3-code` MCP tools present), read [t3.md](references/t3.md) before submitting: it defines runner choice (in-session subagent, T3 subagent via `delegate_task`, child thread via `homebased t3 launch --child`, worker), `homebased wait --next`, and `homebased wait --long` (sleep on >1h work). Follow the `T3:` wait line printed on stderr. Launch child threads only with `homebased t3 launch --child` (never `t3_thread_launch`).
- **Submit on the thread's machine.** To run elsewhere, pass `--machine` (and `--wait-for-machine` for machines that sleep; see [submit.md](references/submit.md#wait-for-an-offline-machine)).
- **Send all GPU work through the resource queue**, and keep GPU jobs to GPU work only: chain builds, data prep, CPU eval, reports, and uploads as CPU tasks with `--after`. Act on `JOB_GPU_IDLE`, read `gpu_summaries` before resubmitting, and follow the 20-minute idle-cancel and macOS memory rules in [resource-queue.md](references/resource-queue.md).
- **Send offloaded builds and tests through the CI queue:** `homebased ci run --class <class> --git -- <command...>` ([ci-queue.md](references/ci-queue.md)). For batch work needing cloud machines, use a pool (`homebased pool create`, then one `ci run --class <pool>` per unit; [pools.md](references/pools.md)) — never create cloud machines or write a dispatcher yourself.
- **Host memory admission (`--mem-peak`) is opt-in.** Run memory-heavy work as a task so the daemon's cgroup cap applies, but leave `--mem-peak` off by default (including builds, tests, CI watchers, and waiting tasks). Opt in on Linux only when an OOM kill would waste significant work, sized from a comparable run's high water + ~10%; see [submit.md](references/submit.md#wait-for-host-memory). Tasks hide GPUs (`CUDA_VISIBLE_DEVICES=""`) unless `--gpu-visible` is passed.
- **`.envrc` loads automatically for `task` workloads** when direnv already allows it in `cwd` (variable names or skip reason appear at the top of `output.log`; fix a skipped load with the user rather than wrapping the command). Pass `--no-envrc` (`"envrc": "ignore"`) to disable. Agent and container workloads never load `.envrc`.
- **Workers park on long commands:** submit them as tasks/jobs, report `waiting` with notes, and exit. On `TASK_WAITING`, do nothing ([worker.md](references/worker.md), [events.md](references/events.md#parked-workers)).
- **Long-lived processes nothing waits on** (dev servers, proxies, emulators): start with `homebased service start --name <label> [--port <n> | --ready-line <regex>] -- <command...>`, never a background shell command, and stop with `homebased service stop <id>` when done. Always-on machine daemons belong under `[services.<name>]` in `config.toml` ([services.md](references/services.md)).
- **Direct messages:** `homebased message send --machine <name> --thread <ref>` queues behind a running turn; add `--steer` only when it must interrupt the current turn. Use `--worker <task>` to steer a running Claude worker, and `task followup` for a finished worker. Add `--at <time>` or `--in <duration>` to send later, and `--self` with either to wake your own thread then ([messages.md](references/messages.md#send-at-a-set-time)).
- **Thread management:** `homebased thread context [--children]`, `read`, `compact`, `watch`, `interrupt [--stop]`, `answer`, `report`, and `detach` work across Fleet ([threads.md](references/threads.md)).
- **Remote T3 threads:** use `homebased t3 launch --machine <name>` (and `t3 project add` / `t3 project icon`); read [t3.md](references/t3.md#launching-a-thread-on-another-machine) first.
- **Quick overview & daemon lifecycle:** `homebased status` summarizes this machine; `homebased ls` (`list`, `ps`) lists active tasks, jobs, services, and standing services; `homebased queue` is `resource jobs`. Use `homebased daemon stop` or `homebased daemon restart`, never raw `systemctl` or `launchctl`.
## Route
Pick the first row that matches, then read only that file.
| Situation | Read |
| --- | --- |
| `HOMEBASED_TASK_ID` is set in this session's environment | [worker.md](references/worker.md) — you are the worker, not the orchestrator |
| A `HOMEBASED_EVENT ` arrived with `"event":"SERVICE_EXITED"` | [services.md](references/services.md#service_exited) |
| Any other `HOMEBASED_EVENT ` arrived | [events.md](references/events.md) |
| GPU work, resource queues, job specs, priority, preemption, or Attention | [resource-queue.md](references/resource-queue.md) |
| Offloaded builds/tests on CI slots (`ci run`, `ci slots`, `ci drain`) | [ci-queue.md](references/ci-queue.md) |
| Batch work on temporary cloud machines (`pool create`, `machine_released`) | [pools.md](references/pools.md) |
| Writing an agent/container spec, `mem_peak`, `after`, `wait_for_machine`, or `task followup` | [submit.md](references/submit.md) |
| Listing, showing, reading logs, waiting, cancelling tasks, or worker token usage | [inspect.md](references/inspect.md) |
| Starting, listing, reading, or stopping dev servers, emulators, or standing services | [services.md](references/services.md) |
| Inside a T3 Code thread, child threads, or launching a T3 thread on another machine | [t3.md](references/t3.md) |
| Thread context, messages, compaction, watches, interrupts, answers, `report`, or `detach` | [threads.md](references/threads.md) |
| Sending a direct message to a session, thread, or running worker | [messages.md](references/messages.md) |
| Configuring Fleet, iroh links, or discovering machines | [fleet.md](references/fleet.md) |
| A command exited non-zero, `daemon_unavailable`, or socket down | [errors.md](references/errors.md) |
| `homebased` is missing, daemon not installed, HTTPS dashboard, or binary rebuilt | [setup.md](references/setup.md) |
## Minimal flow
```bash
homebased task run --name "release build" --timeout 2h -- cargo build --release
homebased task run --name "CI for #123" -- gh pr checks 123 --watch --interval 30
homebased --json task submit --spec spec.json --dry-run # agent or container: validate first
homebased --json task submit --spec spec.json
```
Each prints the task id. End the turn; events arrive later as one line: `HOMEBASED_EVENT {...}`.
```bash
id=$(homebased --quiet service start --name api --port 8787 -- pnpm wrangler dev --port 8787)
# ... use the service ...
homebased service stop "$id"
```