/antsy:antsyfrom antsy
The fail-fast operating philosophy: define how work fails before starting it, never wait on a clock or estimate durations, leave nothing hanging, trace everything with OpenTelemetry, test cheapest-first, treat machine memory as shared, and attribute compute and spend to a purpose. Use it whenever you start anything that runs longer than a moment (builds, test suites, servers, renders, training, local models, deploys, CI), whenever you are tempted to sleep, poll, or say "this should take about N minutes", before any paid API or GPU call, before heavy local work on a shared machine, when adding logging or telemetry to code, when deciding how to wait for something, when first doing long-running work in a project with no .antsy.json, and when judging whether compute, money, or a data set is being used well (ML, evals, tests, automations).
Ships in antsy. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Antsy is impatient with failure, not with work. The goal is to learn that something has failed at the first moment it is knowable, at the lowest cost, without a human or a model sitting and watching. Waiting is an event, not a duration.
If antsy isn't on PATH (antsy version fails), the skill was installed without its plugin.
Install the binary with curl -fsSL https://raw.githubusercontent.com/shinyobjectz/antsy/main/scripts/install.sh | sh
(or cargo install --git https://github.com/shinyobjectz/antsy --locked), and for the hooks and
monitor, the Claude Code plugin: claude plugin marketplace add shinyobjectz/antsy then
claude plugin install antsy@antsy. The rules below still apply without it.
The plugin gives you a binary, antsy, and hooks that run on every session. The hooks are cheap
state-file reads; they speak only when something failed or a rule is about to be broken.
Nothing needs initializing. When a project has no .antsy.json, the session-start context says
so; before its first long-running work, run antsy init and follow references/setup.md. It's a
short decision tree: attach watches to what's already running, tune the failure lines and heavy
commands, find the free rung for paid calls, check telemetry and build settings, then write the
config.
Decide how it fails before you start it. Every job that runs longer than a moment gets a failure-mode contract before it begins: what liveness looks like and how long silence means a hang, how much memory it may hold, what it may cost, and which output lines mean it has already failed. Write the contract into the command, not your head:
antsy run --name api-tests --stall 90s --mem 6G --fail-on 'FAILED|AssertionError' -- pytest -x tests/api
If you can't say what failure looks like, you aren't ready to start. Read
references/failure-modes.md for the contract checklist and recipes per kind of job.
No clocks. You can't estimate how long work takes, and plans built on estimates rot. So:
sleep to wait for something. The pre-Bash hook denies sleeps over a few seconds and
unbounded while/until … sleep loops.run_in_background (you're notified when it exits),
then keep doing useful work. For things you didn't start, add an antsy watch and a background
antsy wait, or run the Monitor tool on antsy events --follow.--stall is liveness (silence means hung), not a deadline. --max is a generous ceiling for
things that are alive but never finish, not a prediction. Neither is a schedule.Leave nothing hanging. Everything you start has an owner and something listening for it.
Before you end a turn, every job is either finished, stopped (antsy stop ID), or has a
waiter. The Stop hook blocks once when a detached job or watch has nobody listening, and when
failures arrived that you haven't looked at. antsy run kills the job's whole process group
when it ends, so nothing it started outlives it. When a session ends, its watches and detached
jobs are stopped, since nobody is left to hear about them (on_session_end: "keep" to opt out).
Trace everything. Programs run under antsy run get TRACEPARENT, ANTSY_JOB, and an
OTLP/JSON endpoint pointing at the antsy daemon (127.0.0.1:4318) unless one is already set.
When you write or touch code that does I/O, a network call, a queue, or a long computation,
instrument it: spans around units of work, error status on failure, structured error logs.
Error spans and ERROR logs become failure events for the session that owns them, without
anyone reading the trace. Read them back with antsy traces --job ID or --errors. See
references/telemetry.md.
Test cheapest first. Before a call that costs money, climb the cost ladder: static checks,
unit tests with fakes, recorded replays, a local or smaller model, one tiny real call, then the
full paid run. Cache every paid response you might need again. Log real spend with
antsy spend <usd> <what>; the daily cap fails fast, and paid-looking commands get a reminder.
See references/cost.md.
Memory is shared. Other agents and the user's apps live on this machine. Before heavy local
work (builds, local models, renders, big test suites), run antsy board: it shows free memory,
every agent's running jobs with their measured memory, and any external memory killer. Give
heavy jobs --mem (a cap) and --need-mem (admission): antsy refuses a job that would push
free memory under the floor instead of letting the machine swap. Never add a second
machine-wide killer where one exists; antsy defers to memguard, earlyoom, and systemd-oomd. Rust
builds and local models have their own guidance in references/memory-and-builds.md.
Attribute and account. Every run and dollar should say what it is for: --for "<question or goal>" on antsy run and antsy spend, or export ANTSY_FOR=… for the session's current
purpose. Note what it bought with antsy note ID|PURPOSE "<finding>" --useful|--waste. Review
antsy account (session start shows a one-line summary). It shows where compute and money
went, how much is unattributed, which jobs are stuck in failure loops, and which big purposes
have no outcome. This is judgment, not enforcement: re-allocate when the numbers and the value
don't match. For ML, evals, test suites and automations, map the data first (sources, slices,
labels, splits, coverage) and attribute every result to the slice or change that explains it.
See references/data-and-allocation.md.
When woken, double-check. A failure event is a lead, not a verdict. Read the log tail
(antsy log ID), confirm with a second signal (exit code, test output, the trace), fix, and
rerun the narrowest thing that proves the fix.
| Command | Use |
|---|---|
antsy run [flags] -- <cmd> | Run under a contract. Flags: --name, --stall 2m, --max 2h, --mem 8G, --need-mem 4G, --fail-on RE (repeatable), --no-default-fail-on, --grace 3s, --progress-file F, --cost-usd 0.40, --for PURPOSE, -q. --mem auto caps at 30% over the job name's highest recent peak. |
antsy watch pid <pid> [--mem 8G] [--stall 5m --progress-file F] | Watch a process you didn't start. |
antsy watch log <file> [--fail-on RE] [--until RE] [--stall 2m] | Fail on a log line, finish on another. |
antsy watch check --every 30s [--until-ok] [--until RE] [--fail-on RE] -- <probe> | Cheap polling done by the daemon (CI status, a health URL, a file appearing). |
antsy wait [ID…] | Block until listed IDs end (exit 1 on a failure), or until this session's next result. Run with run_in_background. Returns at once if nothing is running. |
antsy events [-f] [--all] | Recent results and failures; -f streams them for the Monitor tool. |
antsy board [--mine] | Memory, every agent's jobs and watches, today's spend. |
antsy log ID / antsy stop ID… / antsy stop --mine | Inspect or stop. |
antsy traces [--job ID] [--errors] [--service S] [--slow MS] | Read spans back: what a job or service did, where it failed, what was slow. |
antsy history [NAME] | What past runs of a job measured (outcome, duration, peak). Data for the next contract. |
antsy config | Effective settings and which file each layer came from. |
antsy spend [USD WHAT] | Spend ledger with a daily cap (exit 3 over it). |
antsy note ID|PURPOSE TEXT [--useful|--waste] | Record what a run or purpose bought. |
antsy account [--days 7] [--by for|name|mode|session] | Where compute and money went; failure loops; purposes with no outcome. |
antsy init [--write] | Scan the project and draft its .antsy.json (see references/setup.md). |
Exit codes from antsy run: the child's own code, or 121 stall, 122 memory cap, 123 fail_on line,
124 max ceiling, 125 refused at admission (memory or budget), 126 stopped on request, 128+N signal.
A build or test suite. Run it in the background with a contract, then keep working:
antsy run --name build --mem 12G -- cargo build --release # Bash with run_in_background: true
You're notified when it exits. A compile error stops it within the grace period, a hang stops at
--stall, and memory overruns stop at --mem.
A dev server you need to stay up. Start it under antsy run in the background, then confirm
readiness with a bounded probe instead of sleeping:
antsy run --max 30s --name ready -- sh -c 'until curl -sf localhost:3000/health; do sleep 1; done'.
CI or a deploy you can't see. Let the daemon poll for free, and wake on the result:
antsy watch check --name ci --every 30s --until '^success$' --fail-on '^(failure|cancelled)$' \
-- gh run view 123456 --json conclusion -q .conclusion
antsy wait # Bash with run_in_background: true
Something already running. antsy watch pid <pid> --mem 8G, or antsy watch log app.log
for its log. Then a background antsy wait.
Before ending a turn. Run antsy board --mine. Stop what you no longer need; make sure a waiter
or the plugin monitor covers the rest.
The antsy daemon (started on demand, one per user, exits when idle) evaluates watches, notices
supervisors that vanished (and kills their process groups), samples memory, and reads OTLP
traffic. It writes events to ~/.antsy/events.jsonl. You hear about them through four channels,
none of which costs tokens while nothing is happening:
antsy events --follow), which streams this session's failures as they happen;antsy wait in a background Bash, which exits on the next result and wakes you;For waiting on state antsy can't see at all, /loop with a long ScheduleWakeup interval is the
fallback heartbeat; pace it to how fast the state actually changes, and prefer an antsy watch check probe that turns it into an event.
Defaults live in the binary. Override per user in ~/.antsy/config.json and per project in the
nearest .antsy.json (top-level keys replace defaults): stall, max, fail_on, ignore, grace,
free_floor_pct, mem_killer (auto | antsy | off), external_killers, sleep_max_s, heavy,
paid, spend_cap_usd_day, otlp_port, forward (an OTLP/HTTP collector to copy traces to),
idle_exit, nudge (once | always | off), and on_session_end (stop | keep). antsy config
prints the result. A project should commit its .antsy.json with
its own failure lines and heavy commands.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub shinyobjectz/antsy --plugin antsy