@dibssoftware/dibs 0.0.178 → 0.0.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +40 -2
  2. package/README.md +49 -196
  3. package/bin/dibs-guard.mjs +10 -1
  4. package/bin/dibs.mjs +72 -31
  5. package/docs/benchmarks.md +1 -1
  6. package/docs/files.md +1 -1
  7. package/docs/guard.md +6 -0
  8. package/docs/machines.md +1 -1
  9. package/docs/questions.md +7 -3
  10. package/docs/reference.md +157 -0
  11. package/docs/relay.md +9 -7
  12. package/docs/releasing.md +11 -8
  13. package/docs/scheduling.md +6 -6
  14. package/docs/windows.md +14 -0
  15. package/package.json +2 -1
  16. package/skills/dibs/SKILL.md +104 -83
  17. package/src/acquire.mjs +102 -34
  18. package/src/agents.mjs +7 -22
  19. package/src/alerts.mjs +157 -57
  20. package/src/answers.mjs +2 -2
  21. package/src/board.mjs +3 -4
  22. package/src/broker.mjs +26 -11
  23. package/src/commands.mjs +39 -14
  24. package/src/config.mjs +27 -6
  25. package/src/cool.mjs +104 -9
  26. package/src/diskwarn.mjs +32 -35
  27. package/src/events.mjs +13 -2
  28. package/src/files.mjs +52 -67
  29. package/src/guard.mjs +52 -6
  30. package/src/guardd.mjs +97 -0
  31. package/src/guardw.mjs +19 -0
  32. package/src/hogs.mjs +18 -5
  33. package/src/later.mjs +20 -25
  34. package/src/lock.mjs +292 -0
  35. package/src/measure.mjs +9 -4
  36. package/src/news.mjs +101 -0
  37. package/src/notes.mjs +171 -0
  38. package/src/notices.mjs +52 -13
  39. package/src/ondemand.mjs +6 -3
  40. package/src/override.mjs +60 -14
  41. package/src/plain.mjs +7 -4
  42. package/src/platform.mjs +165 -35
  43. package/src/preempt.mjs +54 -6
  44. package/src/primer.mjs +43 -15
  45. package/src/proc.mjs +39 -8
  46. package/src/progress.mjs +33 -4
  47. package/src/questions.mjs +8 -22
  48. package/src/relay.mjs +10 -22
  49. package/src/remote.mjs +12 -8
  50. package/src/schedule.mjs +182 -44
  51. package/src/serve.mjs +22 -3
  52. package/src/service.mjs +4 -3
  53. package/src/state.mjs +139 -47
  54. package/src/stats.mjs +3 -2
  55. package/src/talk.mjs +335 -73
  56. package/src/trust.mjs +7 -1
  57. package/src/util.mjs +28 -2
  58. package/src/version.mjs +1 -1
  59. package/src/web.mjs +19 -27
  60. package/src/worker.mjs +2 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,44 @@
2
2
 
3
3
  Each version's notes are shown once to every Claude session the first time it runs that version, so write them for agents: what to do differently, not how it works inside.
4
4
 
5
+ ## 0.0.180
6
+ - Slots are a hard limit again. A session's hold now covers one of its runs per resource at a time, so a second run from the same session or its subagents needs a slot of its own and passes the memory and disk checks. On 11-10 five subagent runs under one playwright hold started at once and froze the Mac. If your subagents share a hold, expect them to queue.
7
+ - dibs no longer crashes (exit 70) or exits 75 with "state lock stuck" when two dibs write at once. Every shared file in ~/.dibs uses one new lock. A slow holder is waited for and never taken over; a dead, zombie or stopped one is. If a live dibs hangs holding the lock for over a minute, `dibs alerts` and the board name it ("dibs is stuck behind pid N") with the fix, and plain `dibs` shows the last state instead of waiting. A stale lock dibs can't remove ends the wait with exit 75 naming the path.
8
+ - Under lasting memory pressure, dibs stops one paused job (lowest priority, then most memory) and puts it back at the front of its line to run again from the start, rather than pausing more: a paused job's memory goes to swap. Only jobs dibs can run again, and never one a person or agent paused.
9
+ - A wait or exit 74 for disk now says which floor holds the job (5 GB, or 3 GB for `-p high`/`urgent`/`--by` with `-m`) and, when you passed a smaller `--disk`, that it doesn't lower it: `--disk` is what the job writes, not the floor. Only a `--disk` of 1 GB or less on test, deploy or a lock (under 100 MB elsewhere) starts below the floor, keeping 1 GB free past it. To get unstuck, free disk.
10
+ - A low or idle job holding a slot that a normal (or higher) job waits for is lifted off background priority until nobody waits on it, so it isn't starved behind a busy machine while others queue for it. The waiter is told; nothing to do.
11
+ - Low disk is a wait now, never a refusal at the start. A `dibs run`, `dibs hold` or `dibs later` job short of disk keeps its place and starts the moment there's room, so stop writing `until df ...` loops before a ship. Exit 74 now means the run needs more than the whole disk, or (outside Claude Code) the wait limit ran out while disk held it.
12
+ - Jobs that write next to nothing start below the 5 GB floor, keeping 1 GB free: a command whose own last runs (two or more) ate under 100 MB, or, before it has runs, one that says so with `--disk` (under 100 MB anywhere; 1 GB or less on test, deploy or a lock of your own: say `--disk 200M` on a test suite that writes nothing). The first run of anything else keeps the floor, since a first `npm ci` or bundling deploy writes gigabytes. A run that eats more takes the exemption away until its runs come back down.
13
+ - A job the person is waiting on (`-p high`, `-p urgent`, or `--by` with `-m`) no longer waits for the room dibs keeps for swap, and may start down to 3 GB free instead of the 5 GB floor, as long as its own need is free. Use those only when a person really waits.
14
+ - Under 1 GB free, the watcher pauses the dibs job writing the most, whatever its priority (a deploy included), and resumes it at 2 GB. Its session gets a notice and the person an alert. Don't end it or run it again: free your own build output and scratch folders.
15
+ - A quick command booked small (its runs used under 512 MB) no longer waits on the memory budget: a one-second test waited 29 minutes for it.
16
+ - A command whose last runs all used 512 MB or less is judged by that, not by its `--mem`: it starts under high (not critical) memory pressure, and other jobs' bookings they don't use no longer hold it. Memory waits name the jobs using the most memory, not the ones booking the most.
17
+ - A running job that has gone well past where its command's own runs reach their peak memory counts at what it uses (plus 1 GB), not its `--mem`, so it no longer holds others on "the machine doesn't have the room". A command that peaks late keeps its booking until then. Runs from before this release don't say when they peaked, so this starts after a command's next few runs.
18
+ - `dibs listen` no longer stops after an hour. It waits until something comes for you, however long that takes, and when your session ends it exits on its own without a word. You don't need to restart it on a timer any more: start it once, and again each time it hands something over. `--for 30m` still sets a limit, with exit 3 when it runs out.
19
+ - Faster: dibs reads the process table, start times and the machine before it takes the state lock, never while holding it, and every dibs shares one machine reading. `dibs service install guard` keeps one process answering the Claude Code hook, so a tool call no longer starts Node; without it the hook works as before.
20
+ - The throttle watcher spots stuck cores (load 5 or more per core while a quarter of the CPU sits idle): it stops lowering processes and, after 5 minutes, alerts the person to restart the Mac. Build and test tools left running for 3 hours with their script deleted get an alert naming them; nothing is killed.
21
+ - Messages: each conversation with the person holds only what the two of you said. What agents tell each other and dibs's own notices are separate streams, never the person's unread. Your messages to another agent are signed with a name a reply reaches. To answer an agent, use `dibs say --to <that agent>`: plain `dibs say` goes to the person, and dibs now says so when you use it right after another agent's message. Outside Claude Code, messages arrive with your next dibs command.
22
+ - After the Mac sleeps, waiters keep their places even when something wrote the state file during the sleep. Nothing to do.
23
+ - Windows: `irm https://dibs.cc/install.ps1 | iex` installs dibs natively, with `dibs.cmd` and a Git Bash `dibs`. It works with gaps (no pausing or measuring yet): docs/windows.md.
24
+ - history.jsonl moves aside at 2 MB like the event log. Nothing to do.
25
+
26
+ ## 0.0.179
27
+ - Alerts are only for what the person should know: deploys, high, urgent or `--by` jobs, the same command failing 3 times in a row, lost jobs and crashes. Everything else is in `dibs alerts --all`. Times from another day say which day. Nothing for you to do; don't dismiss alerts the person should see.
28
+ - Notices about your jobs go only to the session they're about, once per change. dibs no longer prints "used up to N cores, pass --cpu N": it learns that silently. A progress task belongs to the agent that posted it, and its nudge goes to that agent.
29
+ - A failed job leaves the plain board after 30 minutes, and a job stopped on purpose never shows there. A message handed over as you stop now arrives as hook feedback, not as a "Stop hook blocking error".
30
+ - New for the person: the page's Schedule gives jobs that ran at once lanes of their own instead of drawing one bar over another, and merges one agent's back-to-back runs into one bar.
31
+ - A job sent `--on` an on-demand machine that dibs already knows can't wake runs on the machine that sent it, saying why, instead of being refused; before, the answer depended on which side of the check it landed.
32
+ - Start `dibs listen` with run_in_background now, and keep it armed: start it again every time it exits. Its exit wakes you, even while you sit idle waiting on others, when a message, an answer in words or a notice about your jobs arrives (it prints everything queued at that moment), when dibs on this machine is updated (it prints what changed for you), or when a newer dibs is out (the person upgrades with `curl -fsSL https://dibs.cc/install.sh | sh`; don't upgrade it yourself). Without it, a message waits for a tool call you'll never make. Exit 3 means nothing came in 60 minutes (`--for 30m` sets it): start it again. Messages that arrive while you work still come with your next tool call; none is lost or handed over twice. One per agent; a newer one replaces the old. If you end a turn after yours ended without starting it again, the hook keeps you going once to do it. The board and `dibs tell` say who is listening.
33
+ - `dibs tell <name>` reaches the running session with that name, the most recently active one if two share it, never an old thread or a dead session that had it. It now says when that agent is idle and not listening: it won't see the message until it next works.
34
+ - `dibs boost <id> -m "why"` with no priority now means high (it said so on stderr) instead of a usage error, and the priority may come before the id. With no priority and no reason, dibs says what's missing. `dibs help` now lists `tell` and `boost`.
35
+ - `dibs say --to <agent> "..."` now sends that agent a message, the same as `dibs tell <agent> "..."`, instead of exiting 2. `--to person` is still the desk's reply to the person.
36
+ - `dibs progress list` shows your session's open tasks (every agent in it): owner, state, ETA and last post. `--all` for every session's, `--json` for data. Close one with `--done`, as before.
37
+ - A job paused for low disk (or for someone's urgent work, or by hand) now says plainly what happened: its processes were stopped and continue where they were when it resumes; a request waiting on a server meanwhile may have timed out on the far side, so check its output for timeouts.
38
+ - In your own session's scratchpad, the hook now lets you delete cache and build folders (Cache, Code Cache, GPUCache, DerivedData, .build, build, dist, .next, .turbo, .cache, node_modules/.cache) whoever made them, and lets the main thread delete what a subagent made once that subagent has finished. Other sessions' folders are still off limits.
39
+ - What every agent is told first is now short: what to wrap, what needs no dibs (long jobs that mostly wait on the network and use little CPU, memory or disk: crawlers, pollers, HTTP checks; the hook leaves them alone too), `dibs listen`, keep waiting on memory and disk, exit 75 and 74, ask only before what you can't undo, post progress. Everything else (holds, file leases, every exit code, other machines, later, questions, the page and MCP) is reference in the dibs skill and dibs.md under "When you need it". Read it there when you need it.
40
+ - dibs now leaves its instructions where you look first: the install writes `dibs.md` (the same text as the dibs skill) into the folder dibs is installed in, and adds a short note between `<!-- dibs:start -->` and `<!-- dibs:end -->` to `~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md` and the current repo's `CLAUDE.md` and `AGENTS.md`, pointing at it. If you see that note, read the dibs.md it names before builds, tests, simulators or deploys. Don't edit between the markers: every upgrade rewrites those lines. `dibs init` writes them by hand, `dibs init --repo` also adds the note to a repo with no CLAUDE.md, `dibs init --remove` takes them out.
41
+ - The quick lane: a command that runs in under 15 seconds starts at once. Wrap it with `--quick` (or pass `--est 10s`) the first time; after that dibs knows from its runs. It goes past the line, full test or browser slots, high (not critical) memory pressure, swap and the load cool-down; the disk floor, critical pressure, file holds and other agents' holds still stop it. On the simulator it goes to the front of the line rather than alongside; a quick deploy starts beside another repo's deploy, and goes to the front behind its own repo's. At most 2 run at once, and they never pause anyone. The board shows them as quick. A run that takes longer loses the pass until it runs under 15 s again, and dibs tells you: don't put `--quick` on anything longer.
42
+
5
43
  ## 0.0.178
6
44
  - Deploys are one at a time per project now, not per machine. A deploy from another repo starts beside one that's running (up to 3 projects at once); a second deploy of the same repo still waits its turn. The project is the repo's origin URL (the same in every clone and worktree), or the folder outside git. Keep wrapping deploys in `dibs run deploy`: nobody needs to go around dibs for a quick deploy stuck behind another project's long upload.
7
45
  - dibs says out loud what goes wrong, to the person, not only to the agent whose job it is: the board, `dibs --json` (`alerts`), the dibs page and the Mac app (with a notification, at most one per cause every 30 minutes) show each problem with its cause and the one fix, until it resolves, then when it did. `dibs alerts` lists them; `dibs alerts dismiss <id>` closes one for a day. The causes: a job waiting past 10 minutes and three times its usual wait (worst when it's high, urgent or has `--by`), memory pressure or swap holding jobs back for 10 minutes (with the five biggest memory users on the machine, apps dibs didn't start included, and what to close), a slot held by a job that has used no CPU for 20 minutes while others wait, jobs that failed, were stopped, or were lost on another machine (exit 76 or 77), dibs's own crashes (exit 70), a service that's down or that launchd restarted, the Claude Code hook failing, and free disk under the floor. Nothing for you to do, except: don't dismiss alerts the person should see.
@@ -420,8 +458,8 @@ Each version's notes are shown once to every Claude session the first time it ru
420
458
  - A job that ends while the disk is full still hands back its own exit code, and its processes are still killed. dibs says it couldn't record the end; the next dibs command cleans up the lease.
421
459
 
422
460
  ## 0.0.82
423
- - File leases now cover every git worktree of a repo. `dibs hold files:format/SPEC.md` takes the same lease from any worktree, so an agent editing that file from another worktree waits, and the guard refuses its edits. Before, each worktree had its own lease and they never collided.
424
- - When a file is held from another worktree, dibs says so: "format/SPEC.md is leased to alex-d3 in another copy of this repo (wt-trust)". Wait for it the usual way; don't edit it from your own worktree to get around the lease.
461
+ - File leases now cover every git worktree of a repo. `dibs hold files:docs/SPEC.md` takes the same lease from any worktree, so an agent editing that file from another worktree waits, and the guard refuses its edits. Before, each worktree had its own lease and they never collided.
462
+ - When a file is held from another worktree, dibs says so: "docs/SPEC.md is leased to alex-d3 in another copy of this repo (wt-docs)". Wait for it the usual way; don't edit it from your own worktree to get around the lease.
425
463
 
426
464
  ## 0.0.81
427
465
  - dibs no longer starts work on a machine that's already overloaded. Below minDisk nothing starts, urgent work and runs inside your own hold included.
package/README.md CHANGED
@@ -1,235 +1,88 @@
1
1
  # dibs
2
2
 
3
- Three coding agents, one Mac, one simulator. One installs its build over the app another is tapping through, a third starts a fourth `xcodebuild`, memory runs out, and the simulator crashes for all of them.
3
+ Air traffic control for your coding agents.
4
4
 
5
- dibs makes agents take turns on the things that exist once on your machine (the simulator, Xcode builds, test suites, browser runs, deploys) and lets everything else run in parallel. It's a single Node CLI with no dependencies and no daemon.
5
+ You run several AI coding agents at once (Claude Code, Codex, Cursor, Gemini CLI) on one computer. They don't know about each other. One reinstalls an app in the iPhone simulator while another is halfway through testing it, and four builds at once run the machine out of memory. dibs makes them take turns on the things only one of them can use at a time, lets them message each other and you, and only asks you the questions that can't be undone.
6
6
 
7
- ## Install
7
+ <picture>
8
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/dibs-page-dark.png">
9
+ <img alt="The dibs page: every agent's running and waiting jobs, their progress posts, and what needs you" src="https://raw.githubusercontent.com/dibssoftware/dibs/main/docs/images/dibs-page.png">
10
+ </picture>
8
11
 
9
- macOS or Linux, Node 22.23.4, 24.22.1 or 26.12.1 or newer. Older builds of those lines have the Brotli decoder bug (CVE-2026-111497), so upgrade Node first if yours is behind. No sudo.
12
+ ## Install
10
13
 
11
14
  ```bash
12
- curl -fsSL https://dibs.cc/install.sh | sh
15
+ curl -fsSL https://dibs.cc/install.sh | sh # or: npm i -g @dibssoftware/dibs
16
+ dibs guard install # Claude Code agents use dibs without being told
13
17
  ```
14
18
 
15
- It downloads the release tarball from dibs.cc, checks its sha256, puts dibs in `~/.dibs-cli` and links `~/.local/bin/dibs`. If anything fails, it says what and exits nonzero, having installed nothing. Each release's tarball and sum are at `https://dibs.cc/releases/dibs-v<version>.tar.gz` and `.tar.gz.sha256`.
19
+ macOS and Linux, with Node 22.23.4 or newer. No sudo and no dependencies. The install also tells your agents dibs is there: it writes their instructions to `~/.dibs-cli/dibs.md` and adds a short note pointing at it to `~/.claude/CLAUDE.md` and Codex's `AGENTS.md`.
16
20
 
17
- Or a pinned version from GitHub: `curl -fsSL https://raw.githubusercontent.com/dibssoftware/dibs/v0.0.178/install.sh | sh`. Or clone the repo and run `DIBS_SOURCE=<the clone> sh install.sh`.
21
+ ## What your agents do with it
18
22
 
19
- ## The first five commands
23
+ An agent puts `dibs run` in front of anything that would collide. It waits for its turn and hands it on the moment the command ends, however it ends. Everything else still runs at once.
20
24
 
21
25
  ```bash
22
- dibs run sim -m "checkout flow" -- ./ui-test.sh # wait for the simulator, run, free it on exit
23
- dibs run test --est 2m -- npm test # a test suite, side by side with others when there's room
24
- dibs hold sim --for 20m -m "screenshot pass" # keep it across several commands; dibs release sim gives it back
25
- dibs # the board: who has what, who's next
26
- dibs why # where you are in line and what you're waiting for
27
- ```
28
-
29
- The board reads like this:
30
-
26
+ dibs run test -- npm test # wait for a turn at the test runner, then run the tests
27
+ dibs run sim -- ./ui-test.sh # the iPhone simulator, one agent at a time
28
+ dibs # the board: who has what, who's next, how much memory is left
29
+ dibs tell web-app "use the staging database" # a message that reaches that agent on its next step
30
+ dibs question "Ship build 123?" --options yes,no --recommend yes --one-way "testers get it at once"
31
31
  ```
32
- 2 running, 1 waiting. Next up: api-refactor for the simulator, as soon as ios-checkout finishes.
33
32
 
34
- Simulator ios-checkout has reserved it, up to 15 min left
35
- Next: api-refactor
36
- Xcode builds web-app is building, about 1 min left
37
- Free Private simulators, Browser tests, Test runs, Deploys, Heavy jobs
33
+ The last line is the only kind of question that reaches you. Agents decide anything that can be undone themselves, and dibs keeps a record of who did what.
38
34
 
39
- This machine quiet: 42% of memory free, 31 GB of disk free
40
- ```
35
+ With `dibs guard install`, an agent that forgets gets turned away with the exact `dibs run` line to use instead. Nothing is approved on your behalf.
41
36
 
42
- A turn lasts exactly as long as the command. When it exits, crashes or gets `kill -9`'d, its whole process tree is killed and the next agent goes. No timeouts to tune, no stale locks.
37
+ ## What you get
43
38
 
44
- ## Who goes next
39
+ - **The board.** Plain `dibs` says who has what and who's next, in sentences.
40
+ - **A page for you.** Every agent's jobs, progress posts, questions and alerts, live, at `http://127.0.0.1:7421` (`dibs web`). You can move a job up, pause, resume or stop it from there.
41
+ - **On your phone.** `dibs connect` opens the same page on a phone or any browser, end to end encrypted, or through a dibs account that sees all your machines.
42
+ - **Messages.** One thread per agent. You write to an agent and it reads it on its next step; agents write to each other the same way. `dibs listen` wakes an idle agent the moment a message arrives.
43
+ - **Questions only when it can't be undone.** An agent asks with its recommendation and keeps working. You answer from the page, the Mac app or the terminal.
44
+ - **Alerts with the fix.** When something goes wrong (a long wait, a stuck job, memory holding work back, a full disk), dibs says what and the one thing to do about it.
45
+ - **Your own Claude can see it.** The page is also an MCP server, so you can ask Claude "what are my agents doing?".
46
+ - **More than one machine.** Add another computer with `dibs connect --machine`, and agents send work to whichever machine is free.
47
+ - **A Mac app.** The board in your menu bar: [dibs.cc/mac](https://dibs.cc/mac).
45
48
 
46
- Mostly first come, first served, bent by four things. Short jobs move up: a command that usually takes 30 seconds goes ahead of a 20-minute suite that arrived a few minutes earlier, and one that takes under 15 seconds slips in beside running work. Priority shifts your place (`-p high` is worth an hour, `-p low` costs ten minutes). An agent that has had the same resource for most of the last hour drops back a little. A deadline (`--by 23:30`) pulls you forward as it gets close. Every shift is capped, so nobody waits forever.
49
+ ## Learn more
47
50
 
48
- Then the machine gets a say. dibs measures what each command really uses and books that, keeps running jobs inside a memory and CPU budget, and holds new work while the Mac is swapping or short on disk. One job always gets to run. The whole set of rules, with the numbers, is in [docs/scheduling.md](docs/scheduling.md).
51
+ - [dibs.cc](https://dibs.cc)
52
+ - [docs/reference.md](docs/reference.md): every command, the rules to paste into your agents' instructions, exit codes, settings
53
+ - [docs/](docs/): how turns are decided, the guard, questions, scheduled runs, private simulators, file locks, more machines, the relay
49
54
 
50
- **Make agents use it.** Agents forget to wrap commands, so add the guard hook. From Terminal:
55
+ ## Details
51
56
 
52
- ```bash
53
- dibs guard install
54
- ```
57
+ **Install.** `install.sh` downloads the release from dibs.cc and checks its sha256 before installing anything, puts dibs in `~/.dibs-cli` and links `~/.local/bin/dibs`. If anything fails, it says what and installs nothing. Each release is at `https://dibs.cc/releases/dibs-v<version>.tar.gz`, with its `.sha256` beside it. A pinned version from GitHub: `curl -fsSL https://raw.githubusercontent.com/dibssoftware/dibs/v0.0.180/install.sh | sh`. From a clone: `DIBS_SOURCE=<the clone> sh install.sh`.
55
58
 
56
- Or as a plugin, in a Claude Code session (Codex reads the same plugin; [docs/guard.md](docs/guard.md) has its commands):
59
+ **Windows.** From PowerShell, no admin rights needed: `irm https://dibs.cc/install.ps1 | iex`. It checks the sha256 the same way, puts dibs in `~\.dibs-cli`, and makes `dibs.cmd` (PowerShell and cmd) and `dibs` (Git Bash, where Claude Code runs its commands on Windows) in `~\.local\bin`.
57
60
 
58
- ```
59
- /plugin marketplace add dibssoftware/dibs
60
- /plugin install dibs@dibs
61
- ```
61
+ **Node.** 22.23.4, 24.22.1, 26.12.1 or newer. Older builds of those lines have the Brotli decoder hole (CVE-2026-111497), and dibs's services refuse to install on them.
62
62
 
63
- The guard rewrites a bare `xcodebuild` or `npm test` into `dibs run ...` only in bypass-permissions sessions, where the agent already runs everything without asking. In every other session it blocks the command and tells the agent the exact `dibs run` line to use, so the retry goes through your normal permission prompt. It never approves anything for you, and if it can't parse a command or hits an error, it lets the command through. The same hook turns away edits to files another agent has leased, starts each new session and subagent with a few lines on how to use dibs, and hands each agent your messages and dibs's notices about its own jobs (one looks stuck, used far more memory than it asked for, or was paused) on its next tool call. If you set `agents.slots` in `~/.dibs/config.json`, it also caps how many subagents run at once across every session; there's no cap until you do. Details: [docs/guard.md](docs/guard.md).
63
+ **Your agents' notes.** The install writes `~/.dibs-cli/dibs.md` (the agent instructions for this version) and a short marked note pointing at it to `~/.claude/CLAUDE.md`, to `~/.codex/AGENTS.md` if you use Codex, and to the `CLAUDE.md` and `AGENTS.md` of the git repo you ran it in, if those exist. The note sits between `<!-- dibs:start -->` and `<!-- dibs:end -->`, and an upgrade rewrites only those lines. `dibs init` does it by hand (`--repo` also makes this repo's `CLAUDE.md`), `dibs init --remove` takes it out, and `DIBS_NO_AGENT_NOTES=1` before the install line skips it.
64
64
 
65
- If you run one agent at a time, you don't need this.
65
+ **The Claude Code plugin.** Instead of `dibs guard install`, in a Claude Code session: `/plugin marketplace add dibssoftware/dibs`, then `/plugin install dibs@dibs`. Codex reads the same plugin ([docs/guard.md](docs/guard.md)).
66
66
 
67
- **Upgrade** by running the install line again. It swaps `~/.dibs-cli` in one step, and your queue and settings in `~/.dibs` stay. Then `dibs guard install` again, from Terminal, so the hook has every event the new version listens to. A plugin install updates with `claude plugin update dibs@dibs` in Terminal, or in Claude Code from `/plugin`, Installed, dibs, Update now. Run `/reload-plugins` to load it in a session that's already open.
67
+ **Upgrade** by running the install line again (or `npm i -g @dibssoftware/dibs`), then `dibs guard install` again. Your queue and settings in `~/.dibs` stay.
68
68
 
69
- **Uninstall**, from Terminal:
69
+ **Uninstall:**
70
70
 
71
71
  ```bash
72
- dibs guard remove # or claude plugin uninstall dibs@dibs for a plugin install
73
- dibs service remove serve worker throttle # only if you installed services
74
- rm -rf ~/.dibs-cli ~/.local/bin/dibs ~/.dibs # ~/.dibs is the queue, history and settings
72
+ dibs init --remove # dibs.md, and the dibs note in CLAUDE.md and AGENTS.md
73
+ dibs guard remove
74
+ dibs service remove serve worker throttle web # only the ones you installed
75
+ rm -rf ~/.dibs-cli ~/.local/bin/dibs ~/.dibs # ~/.dibs is the queue, history and settings
75
76
  ```
76
77
 
77
- ## Tell your agents
78
-
79
- Paste this into your `CLAUDE.md` or `AGENTS.md` (the Claude Code plugin ships the same thing as a skill):
80
-
81
- ```markdown
82
- ## dibs (shared machine resources)
83
- Other agents share this machine. Wrap anything that collides in dibs; plain reads, edits and small commands need nothing.
84
- - `dibs run <resource> -m "why" -- <cmd>`: `test` (`npm test`, vitest, `node --test`), `xcode-build`, `sim` (the shared simulator), `sim-own` (a private one, udid in `$SIM`: `sh -c '... "$SIM"'`), `playwright --port WEB` (use `$WEB`), `deploy`, `heavy`. Need two? `dibs run sim,xcode-build -- <cmd>`, never one while holding the other.
85
- - Across several tool calls: `dibs hold sim --for 20m -m "why"`, keep wrapping each command in `dibs run sim -- ...` (it starts at once under your hold), and `dibs release sim` when done.
86
- - In Claude Code a `dibs run` waits as long as it takes. A tool call that moved to the background is still waiting: don't run it again (dibs refuses the copy, exit 2).
87
- - Before editing files other agents may touch: `dibs hold 'files:src/auth/**' -m "why"` (from the git root; quote the glob). If your edit is refused, wait or message the holder; don't write the file another way.
88
- - Post progress as often as you commit: `dibs progress "what you just did or found, with numbers" --task <name> --eta 30m`, then `--blocked` or `--done`. The person reads it live. An overdue task gets you a notice: post a new `--eta` or `--done`.
89
- - Decide two-way doors yourself. Ask the person only what can't be undone: `dibs question "Delete the old bucket?" --options yes,no --recommend yes -m "nothing reads it" --one-way "the 4,210 files are gone for good"`, keep working, then the same command with `--wait` prints only the answer. Exit 75 there means no answer: don't do the step.
90
- - `dibs say "done: tests pass"` leaves the person an FYI. A line starting `Message from the person:` is really theirs: act on it, and reply with `dibs say`.
91
- - A wait on memory, swap or disk protects the machine: keep waiting, never lower `--mem` or raise `-p` to get past it. A line from dibs about one of your jobs (stuck, over its memory, paused, a task overdue) is about your own work: act on it.
92
- - You may boost, pause, resume or stop any job (`--owner <its session>` when it isn't yours); dibs records who did it. Raise to high or urgent with `-m` only when a person is waiting now or something is broken. A job "stopped by" someone was ended on purpose: find out why before running it again.
93
- - Other machines: `dibs run test --anywhere -- <cmd>` or `--on <machine>`. Later: `dibs later test --at 02:00 -m "why" -- <cmd>`.
94
- - Exit codes: 75 gave up waiting, never ran (rerun the same command within 2 minutes), 74 not enough disk, 76 lost before it started (send again), 77 lost after it started (it may have run: check first), 70 dibs crashed.
95
- - `dibs` shows the board, `dibs help all` every command. Something wrong with dibs: `dibs ask "..."`.
96
- ```
78
+ **Words dibs uses.** A *resource* is something agents take turns on: `test`, `sim`, `xcode-build`, `playwright`, `deploy`, `heavy`, or a name you make up. A *turn* lasts exactly as long as the command. A *hold* (`dibs hold sim --for 20m`) keeps a turn across several commands. A *lease* on files (`dibs hold 'files:src/auth/**'`) keeps other agents' edits off them.
97
79
 
98
- ## Commands
99
-
100
- ```bash
101
- dibs run sim,xcode-build -- ./build-and-install.sh # everything you need, at once
102
- dibs run playwright --port WEB --port API -- npx playwright test # free ports in $WEB and $API
103
- dibs run test -p high -m "release blocker" --by 23:30 -- npm test
104
- dibs run test --after #42 -- npm run e2e # joins the line once your job #42 has ended
105
- dibs hold sim --for 20m -m "screenshot pass" # across several tool calls; again to extend
106
- dibs release sim
107
- dibs hold 'files:src/auth/**' -m "auth refactor" # other agents' edits there are turned away
108
- dibs run quota:asc --cost 3 -- ./upload.sh # share an API's rate limit between scripts
109
- dibs when sim # when you'd get it, without joining the line
110
- dibs who sim # who holds it, until when, who's next
111
- dibs why # where you are, when you start, what you're waiting for (--detail: the math)
112
- dibs mine sim # exit 0 if you hold it, 1 if not
113
- dibs yield web-app # let another agent go first
114
- dibs pace quiet # how hard dibs drives this machine: quiet, normal or max
115
- dibs sims # the private simulator pool
116
- dibs setup scratch # the admin commands for a capped scratch volume for build output (macOS)
117
- dibs changes # what changed in recent versions
118
- dibs question "Ship 123 now?" --options yes,no --recommend yes -m "tests pass" --one-way "testers get it at once" --wait # only one-way doors reach the person
119
- dibs questions # what agents are asking you, with what they recommend; dibs answer <id> <option, or your own words>
120
- dibs hours 09:00-23:00 # outside your hours, questions below urgent wait for the morning
121
- dibs threads # one thread per agent: its notes and questions, your messages; dibs threads read <agent>
122
- dibs tell web-app "use the staging database" # reaches the agent on its next tool call, or as it finishes its turn
123
- dibs tell desk "why is my build waiting?" # the agent config.json names as "desk" answers you with dibs say --to person
124
- dibs alerts # what's wrong and the one fix for each: long waits, memory holding work back (and what to close), stuck jobs, failed or lost jobs, dibs itself, a full disk
125
- dibs alerts dismiss <id> # close one for a day; it comes back if its cause is still there
126
- dibs history # the last 7 days: busy time, waits and who waited, by resource, agent and hour
127
- dibs stats # waits against run times, today and the last 7 days: the share of jobs that waited longer than they ran
128
- dibs stats --me # your own: jobs, run and wait time, failures by exit code, what held you back, top commands, ETAs met (--agent <name>, --since 30d, --json)
129
- dibs later sim --at 02:00 -m "snapshot suite" -- ./snapshots.sh # run it tonight; returns at once with its id
130
- dibs later test --after web-app:deploy -- npm run smoke # when that agent's deploy ends (--after-ok: only if it passed)
131
- dibs later list # scheduled, waiting, running, and how the finished ones ended; dibs later cancel <id>
132
- ```
133
-
134
- Anyone can override any job, the person or an agent. An agent acting on a job that isn't its own names the owner with `--owner <session>` (or `session/agent`), as the board shows it, or nothing changes (exit 2, with the owner, its `-m` and the command to rerun); the person never needs it. Every answer starts with whose job it was: `boosting #10167: alex-c8 deploy 'shop-api first deploy'`. `dibs boost <id> high -m "why"` (the `#` on `dibs --detail`), `dibs pause <id>` and `dibs resume <id>`, `dibs stop <id>` (kills the job; its agent is told who stopped it), and `dibs cap <agent> low` (that agent never waits or runs above low until `dibs cap <agent> off`). The same goes for `answer`, `questions dismiss`, `hours`, `pace <word>`, `tell`, `threads read`, `join`, `invite`, `pair --machine`, `kick`, `limit`, `service install`/`remove`, `guard install`/`remove` and `serve --force`: nothing is the person's alone.
135
-
136
- Every one of them is logged with who ran it: `dibs history --json` has an `override` event with `by` (the agent's session name, or `the person`). The board says it too: `[boosted by web-app: release blocked]`, `[paused by web-app]`, `capped: pushy at low (by web-app)`. A message an agent sends with `dibs tell` arrives as `Message from web-app (another agent, not the person)`, and an agent that answers a question is named to the one that asked. An agent raising a job to high or urgent passes `-m`, so everyone sees why. The machine's own limits (memory, swap, disk, and never pausing every job) hold for everyone.
137
-
138
- A waiting `dibs run` or `dibs hold` is a shell blocked on a FIFO (about 1.5 MB, no CPU), and one broker process decides for every waiter on the machine: it starts when someone waits and exits after a quiet minute. Before 0.0.102 each waiter was a Node process of its own, 35 to 65 MB polling the state every 1.5 seconds, which with dozens waiting came to gigabytes and kept the state lock busy most of the time. To go back to that, in `~/.dibs/config.json` (or `DIBS_THIN=0` for one caller):
139
-
140
- ```json
141
- { "waits": "fat" }
142
- ```
143
-
144
- Nothing changes in how agents call dibs, what it prints, or its exit codes. Jobs other machines send here and `dibs later` jobs wait thin too. `--after` still waits in Node (it waits outside the line until the other job ends), as does a run sent with `--anywhere` or `--on`, whose sender follows it over the network while it waits on the other machine. Anything that goes wrong with a thin wait (a broker that died, got stuck or couldn't start, a wait that fell back to Node, a crash) leaves an event of kind `thin` in `~/.dibs/events.jsonl`: `grep '"kind":"thin"' ~/.dibs/events.jsonl`.
145
-
146
- ## Watching your agents: the page and MCP
147
-
148
- ```bash
149
- dibs service install web # or: dibs web (http://127.0.0.1:7421)
150
- dibs pair # a one-time code, e.g. K7QM-4XNA: one use, 10 minutes
151
- ```
152
-
153
- Open http://127.0.0.1:7421 and type the code. The rail on the left switches between views:
154
-
155
- - **Now**: alerts first: anything wrong, why, and the one fix, until it resolves (then when it did). Then every agent's running and waiting jobs on a timeline that spans only the time something is in, file locks, tasks with their ETAs, and every `dibs progress` post, live. Click a job to make it go first, give it back its normal place, let others go first, pause, resume or stop it (stop asks twice). Pick an agent to hold all its jobs back (`dibs cap`).
156
- - **Questions**: what agents asked you at one-way doors. Answer with an option or your own words, or say not now.
157
- - **Messages**: one thread per agent. What you send reaches the agent with its next tool call.
158
- - **Stats**: run and wait time by agent and by resource, how often jobs waited longer than they ran, failures by exit code, what held jobs back, top commands, ETAs met, a daily trend, a day-by-hour heatmap, and the machine's load, memory and disk over time. Agents get the same numbers from `dibs stats --me`.
159
- - **Scheduled**: `dibs later` runs coming up and ended this week; cancel one.
160
- - **History**: `dibs history` for the past day, week or 30 days, and every override with who made it.
161
- - **Settings**: the speed (`dibs pace`), your hours, and the Claude Code hook.
162
-
163
- Every change on the page runs the same CLI command you would, as you, so `dibs history` and the board name you, and the CLI's own rules apply. Changes need the page's sign-in; nothing else can make them.
164
-
165
- The same server is an MCP server at `http://127.0.0.1:7421/mcp`, so your own Claude can answer "what are my agents doing?". Add it to Claude Code with `claude mcp add --transport http dibs http://127.0.0.1:7421/mcp`; the client opens a sign-in page in your browser, and you type a code from `dibs pair`. With a plain `dibs pair` code it gets read-only tools: `board`, `agents`, `agent`, `progress`, `stats`, `questions`, `history`, `resource`, `machines` and `messages`. A code from `dibs pair --allow-actions` adds tools that act: post progress, answer questions, message agents and you, hold and release, and boost, pause, resume and stop jobs. It acts as an agent named after the client (`mcp-<name>`), never as you, so agents treat its messages as a peer's. A model reads text agents wrote, and text can steer a model, so give actions only to a client you'd trust with them. A code from `dibs pair --allow-commands` also lets a client signed in here (never through mcp.dibs.cc) queue commands to run on this Mac with `queue_run`, the way `dibs later` does. `dibs pair --list` shows what's signed in and `dibs pair --revoke <id|all>` signs it out.
166
-
167
- It answers only on 127.0.0.1 unless you pass `--bind <address>` (your Tailscale address, say), and only to requests that name that address, so a web page can't reach it by DNS rebinding. Codes and tokens are stored hashed in `~/.dibs/web.json`. After 10 wrong codes in 10 minutes every try is refused until the window passes; open codes stay good. To let claude.ai or another Claude account read your board, `dibs relay mcp on` serves it at `https://mcp.dibs.cc/mcp` through the relay (docs/relay.md).
168
-
169
- ## Mac app
170
-
171
- `app/` builds a Mac app (macOS 26) over the same commands: the live board with boost, pause, stop and cap buttons, agents' questions to answer, the week's history, and the pace, in a window and the menu bar. It runs the `dibs` on your PATH and reads nothing else. A signed download will be at https://dibs.cc/mac/; until then, build it yourself. To build it yourself you need Xcode 26 and xcodegen (`brew install xcodegen`): [app/README.md](app/README.md) has the steps.
172
-
173
- Priority is `-p urgent|high|normal|low|idle`. `urgent` and `high` need `-m` and everyone sees them. `low` and `idle` run at background priority, and may be paused while urgent work borrows their slot. `--est 5m` tells dibs how long a new job takes, so short jobs can move up. `--by 23:30` moves you up as a deadline gets close.
174
-
175
- Agents show up by their Claude Code session name. Anywhere else, dibs names them after the folder they run in; set `DIBS_AGENT=name` to pick your own.
176
-
177
- ## Exit codes
178
-
179
- Agents branch on these, so they don't change.
180
-
181
- | code | meaning |
182
- |---|---|
183
- | the command's own | it ran |
184
- | 75 | dibs stopped waiting in line. The command never started and did not fail. Run the same command again within 2 minutes to keep your place. For `dibs question --wait`: no answer (timed out or dismissed), nothing was decided |
185
- | 74 | not enough free disk, and nothing running would free it. Other sessions' `/private/tmp/claude-*` folders are off limits for making room |
186
- | 76 | lost the coordinator or the other machine before a remote job started. Nothing ran there: sending it again is safe |
187
- | 77 | lost the other machine after a remote job started. It may have run, or may still be running: check before running it again |
188
- | 127 | the command didn't start |
189
- | 2 | bad usage, a job asking more memory or cores than the machine ever hands out (it says the most it can ask), a resource name close to a real one (`simulator` for `sim`), an agent's high or urgent boost without `-m`, `--on` on a machine that isn't in a group, or a `dibs run` you already have waiting or running (wait for that one) |
190
- | 1 | nothing matched: `mine` with nothing held (the clean result after a release), `release` with nothing to give back |
191
- | 70 | dibs itself crashed: a bug in dibs, not your command. Report it with `dibs ask "..."`. If your command already ran, you get its code instead |
192
-
193
- Inside Claude Code, `dibs run` waits as long as it takes: when the tool call hits its timeout, Claude Code moves it to the background and tells the agent when it ends. Everywhere else (Codex, scripts, a terminal) dibs gives up after 8 minutes with exit 75, which fits a 10-minute tool call. `--wait` lifts the limit, `--max-wait 20m` sets your own.
194
-
195
- ## Resources
196
-
197
- | name | slots | memory | cores | free disk | pausable |
198
- |---|---|---|---|---|---|
199
- | sim | 1 | 3G | 1 | 8G | no |
200
- | sim-own | 4 on 16 GB (RAM / 4G, at most 4), and only as many as free memory fits | 3G | 2 | 6G | no |
201
- | xcode-build | 2 | 4G | 4 | 4G | no |
202
- | playwright | 2 | 3G | 2 | 3G | yes |
203
- | test | 3 | 2G | 3 | | yes |
204
- | deploy | 1 per project (its repo's origin, or the folder outside git), up to 3 projects at once (`exclusiveBy: "repo"`, `across: 3`) | 0.5G | 1 | | no |
205
- | heavy | 1 | 4G | 4 | 10G | yes |
206
- | any other name | 1 | 1G | 1 | | no |
207
- | `files:<path or glob>` | one holder per path | 0 | 0 | | no |
208
- | `quota:<name>` | a token bucket from config | 0 | 0 | | no |
209
-
210
- A name close to a real one (`simulator`, `tests`, `xcode`) is refused with exit 2 and the right name, since two agents slipping differently would both get the real thing at once. A name of your own that looks like none of them starts a queue of its own.
211
-
212
- Running jobs share a budget of 8 GB and 6 cores while the machine is busy, so light jobs run side by side and heavy ones take turns. The cores count what running jobs are measured using, not what they asked for. dibs measures what each job really uses, failed and killed runs included, and plans the next run of the same command at that, when it's more than asked (a command it hasn't measured yet goes by the same program on the same resource, so a new Playwright spec starts at what the others used); `--mem` and `--cpu` say what you need up front. Override any of it in `~/.dibs/config.json`; you only need the keys you change. State lives in `~/.dibs`. A resource you make up can have a name people read on the board: `"resources": { "gpu": { "slots": 1, "label": "The GPU" } }` (a quota takes `"label"` too).
213
-
214
- ## More
215
-
216
- - [docs/scheduling.md](docs/scheduling.md): how a turn is decided, what a lease guarantees, nested runs, measuring what jobs use, rate-limit quotas, pausing low-priority work, `dibs pace`, running jobs side by side, resetting a resource after each use, throttling
217
- - [docs/files.md](docs/files.md): file leases, and which edits the guard turns away
218
- - [docs/questions.md](docs/questions.md): agents queuing questions for the person, `--wait`, working hours
219
- - [app/README.md](app/README.md): the Mac app
220
- - [docs/simulators.md](docs/simulators.md): `sim-own`, the pool of private simulators
221
- - [docs/guard.md](docs/guard.md): the hook, what it matches, the subagent limit, installing it for Claude Code and Codex, your own rules
222
- - [docs/machines.md](docs/machines.md): sending jobs to other machines, adding one (`dibs pair --machine` on the coordinator, `dibs join <code>` on the new machine), tokens, and keeping a project's code on the machines you name
223
- - [AGENTS.md](AGENTS.md): working on dibs itself
224
-
225
- Platforms: CI runs the full suite on macOS and Ubuntu on every push. Linux uses the same code paths (`ps`, process groups, `/proc/pressure/memory`). Windows support exists and is untested.
80
+ **Platforms.** macOS and Linux run the full suite in CI on every push. Windows works, with gaps (no pausing or measuring yet): [the list](docs/windows.md).
226
81
 
227
82
  ## License
228
83
 
229
84
  dibs is free to use, change and share under the [GNU Affero General Public License v3](LICENSE) (AGPL-3.0-only), at home or at work. If you ship a changed dibs, or run one for other people over a network, the AGPL says you share your changes under the same license.
230
85
 
231
- If your company can't use AGPL software, or you want to build dibs into something you don't open source, a commercial license is available from Creayo LLC: licensing@dibs.cc.
232
-
233
- ## Contributing
86
+ If your company can't use AGPL software, or you want to build dibs into something you don't open source, buy a commercial license from Creayo LLC: licensing@dibs.cc.
234
87
 
235
- Bug reports, ideas and pull requests are welcome. Before your first pull request is merged you sign a contributor license agreement, so Creayo LLC can offer your change under both licenses: [CONTRIBUTING.md](CONTRIBUTING.md) says how. [AGENTS.md](AGENTS.md) is how the code is worked on.
88
+ Contributions are welcome: [CONTRIBUTING.md](CONTRIBUTING.md). Before your first pull request is merged you sign a contributor license agreement, which lets Creayo LLC offer your change under both licenses.
@@ -1,4 +1,13 @@
1
- #!/usr/bin/env node
1
+ #!/bin/sh
2
+ ":" //; D=${DIBS_HOME:-$HOME/.dibs}; S=$D/guard.sock; if [ -S "$S" ] && command -v curl >/dev/null 2>&1; then in=$(cat); out=$({ printf '%s\000%s\000' "$PPID" "$PWD"; env -0; printf '\000%s\000' "$in"; } | curl -sf --max-time 2 --unix-socket "$S" --data-binary @- http://guard/ 2>/dev/null); case $out in ok*) r=${out#ok}; r=${r#?}; [ -n "$r" ] && printf '%s\n' "$r"; exit 0;; esac; printf '%s' "$in" | node "$0"; exit $?; fi; exec node "$0"
3
+ // Line 2 is read by sh and ignored by Node (a string, then a comment). As a
4
+ // script it is the hook's fast way in: when the resident guard is running
5
+ // (dibs service install guard, src/guardd.mjs), sh sends the call down its
6
+ // socket, with this hook's parent pid, folder and environment, and prints the
7
+ // answer. With no guard running, no curl, or no "ok" back within 2 s, it runs
8
+ // the hook in Node below, as it always did. Run as `node dibs-guard.mjs` (the
9
+ // plugin, Windows) it is the Node hook straight away.
10
+ //
2
11
  // The Claude Code hook behind `dibs guard`. It loads only the guard and its
3
12
  // file leases (plus the subagent limit, for subagent events, and src/talk.mjs
4
13
  // when the person has a message waiting), so a tool call pays for a few small