-
Notifications
You must be signed in to change notification settings - Fork 7
📖 docs: add token-efficient agent supervision use case #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,6 +51,42 @@ N paired peers exchange structured digests each morning. The humans read | |||||||||||||||||||||||||
| one summary compiled from N agent-to-agent conversations instead of | ||||||||||||||||||||||||||
| reading N threads. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Token-efficient agent supervision | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| A supervised-agent setup runs one or more Claude Code sessions around the | ||||||||||||||||||||||||||
| clock via `/loop` scheduling, polling for work every 15 minutes. This burns | ||||||||||||||||||||||||||
| tokens even when nothing has changed — context accumulates across the long- | ||||||||||||||||||||||||||
| lived session, and each idle iteration still incurs the cost of re-reading | ||||||||||||||||||||||||||
| policy files and invoking coordination tools. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ClawdChan can replace parts of this pattern. Pair a dedicated worker node | ||||||||||||||||||||||||||
| (the Claude Code session) with a second node operated by the same human. | ||||||||||||||||||||||||||
| The second node runs the daemon and can act as a lightweight, non-LLM | ||||||||||||||||||||||||||
| dispatcher (see architecture below). | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **Iteration digest.** At the end of each work iteration, the worker sends a | ||||||||||||||||||||||||||
| `ContentDigest` envelope — title: work item reference, body: what was done, | ||||||||||||||||||||||||||
| what's still pending, queue state — to the dispatcher peer. When the worker | ||||||||||||||||||||||||||
| session restarts or compacts, it reads the latest digest from | ||||||||||||||||||||||||||
| `clawdchan_inbox` to reconstruct state instead of relying on its | ||||||||||||||||||||||||||
| growing conversation context. The digest is fixed-size by construction; | ||||||||||||||||||||||||||
| conversation context is not. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **Event-driven dispatch.** Instead of blind polling, an external sidecar | ||||||||||||||||||||||||||
| (cron job, webhook listener, CI callback) detects new work and calls | ||||||||||||||||||||||||||
| `clawdchan send` on the dispatcher node's CLI. The worker's agent picks it | ||||||||||||||||||||||||||
| up on its next `clawdchan_inbox` call. This decouples "is there work?" (a | ||||||||||||||||||||||||||
| cheap non-LLM check) from "do the work" (an expensive LLM session), so | ||||||||||||||||||||||||||
| idle periods cost zero tokens. | ||||||||||||||||||||||||||
|
Comment on lines
+77
to
+80
|
||||||||||||||||||||||||||
| `clawdchan send` on the dispatcher node's CLI. The worker's agent picks it | |
| up on its next `clawdchan_inbox` call. This decouples "is there work?" (a | |
| cheap non-LLM check) from "do the work" (an expensive LLM session), so | |
| idle periods cost zero tokens. | |
| `clawdchan send` on the dispatcher node's CLI against the pre-existing | |
| dispatcher↔worker thread. In practice, the sidecar must know that thread | |
| id (or a unique prefix), either by storing it when the thread is created | |
| with `clawdchan open` or by resolving it via `clawdchan threads` before | |
| sending. The worker's agent picks the message up on its next | |
| `clawdchan_inbox` call. This decouples "is there work?" (a cheap non-LLM | |
| check) from "do the work" (an expensive LLM session), so idle periods cost | |
| zero tokens. |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“idle periods cost zero tokens” conflicts with the later caveat that the CC session must already be alive and polling clawdchan_inbox (which still consumes some tokens). Consider rephrasing to reflect reduced/minimal token cost, or explicitly describe a workflow where the CC session is only started on demand by external orchestration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text says “dispatcher (see architecture below)”, but this page doesn’t include an architecture diagram/section below. Either remove the reference or add the referenced diagram/anchor so readers can find it.