hedge-hub
Skill0 starsChanged 13 days agoMITView on GitHub
Manage your machines from the Hedge hub. Use to roll out a profile or engine change to every machine, to change one machine, or to look up which machines Hedge manages.
- Reads credentials
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- packs/base/AGENTS.mdAGENTS.md
- packs/communication/AGENTS.mdAGENTS.md
- packs/memory/AGENTS.mdAGENTS.md
- packs/orchestration/AGENTS.mdAGENTS.md
- packs/pull-requests/AGENTS.mdAGENTS.md
- packs/security/AGENTS.mdAGENTS.md
- src/reconciler/fixtures/engine/packs/base/AGENTS.mdAGENTS.md
- src/reconciler/fixtures/engine/packs/pull-requests/AGENTS.mdAGENTS.md
- writing-voiceSkill
- dreamSkill
- mode-autoSkill
- mode-fullSkill
- mode-supervisedSkill
- writing-voiceSkill
- full-stopSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Leave them out of a rollout.
- Very specific: line 29
Push: Commit the profile change in the profile checkout and push it.
- Very specific: line 34
Hub: Run hedge update, then hedge doctor.
- Distinctive: line 69
When you start outside the hub, start a T3 thread on the hub that runs these steps.
- Very specific: line 74
Put shared setup in the profile and roll it out.
- Very specific: line 125
The balancer: Every 5 minutes, hedge cli-proxy-balance reads the weekly usage of each subscription and gives the highest priority to the …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hedge hub
The hub is the devbox that the profile's hub names (hedge hub here).
It reaches every devbox over SSH and the Mac through its T3 link. Make each
change in the profile, push it, and roll it out from the hub.
The machines
- The hub: this machine.
hedge hub statusprints this machine's name and the hub that the profile names.hub.aliasis the SSH name other machines use for it. - Devboxes: the
devboxeslist in the profile'shedge.json, plus the oneshedge devboxlists on the hub, without duplicates. Reach each one by its SSH name. - The Mac: a T3 environment link on the hub.
t3_environment_linkslists it. - Boxes: short-lived devboxes from the pool.
hedge box listlists them. Leave them out of a rollout.
profileDir in ~/.config/hedge/machine.json names the profile checkout.
Roll out a change
- Push. Commit the profile change in the profile checkout and push it.
An engine change needs no commit here: it reaches a machine through
hedge updateonce it is on the engine's main branch, or in a release for the release channel. Done whengit statusin the profile checkout is clean and its branch matches its remote. - Hub. Run
hedge update, thenhedge doctor. Done when both exit 0. Devboxes. For each devbox in turn, run the same two commands in a login shell over SSH, with a total limit of 10 minutes:
timeout 600 ssh -o BatchMode=yes -o ConnectTimeout=10 <devbox> 'f="$HOME/.local/share/hedge/engine/hedge"; bash -lc "sh $f update && sh $f doctor"'Done when each devbox has exited 0 or has a failure to report.
- Mac. Find the Mac with
t3_environment_links. Callt3_thread_launchwith itsenvironmentId,scratch: true,runtimeModefull-access, and a prompt that runshedge update, thenhedge doctor, stops at the first failure, and reports each exit code and everyTo do:line. Wait witht3_thread_wait. Done when the thread answered, or when the link is missing, expired, or timed out: then report the Mac as pending with the reason. - Report one line per machine: updated and verified, pending, or the
failure with its last output line. Relay every
To do:line; those are steps only the person can do. Done when every machine from The machines, boxes aside, has a line.
When a step fails
- Unreachable devbox: report it as pending. It takes the change on its
next
hedge update. - Out of time: the command exits 124 when a devbox takes longer than 10 minutes. Report it as failed with "timed out after 10 minutes" and go on to the next devbox. Do not wait for it or run it again.
hedge updaterefuses: the engine checkout has local changes, or the profile did not fast-forward. Report the line it printed and skip that machine.hedge applyconflicts: a file Hedge wants exists with other content. Report each path and wait for the person: adopting discards that content, so only they decide. Apply their answer withhedge apply --adopt <path>.
When you start outside the hub, start a T3 thread on the hub that runs these steps.
Change one machine
Put shared setup in the profile and roll it out. Keep a value for one machine
in that machine's own local files, outside the profile. To add a devbox, run
hedge devbox add <ssh name> on the hub: it sets the host up as a devbox and
lists it.
Own-account balancing
This workflow is off by default. Read its terms note first:
hedge packs lists it while the Hub pack is on, and prints it again when the
person turns the workflow on with
hedge packs --workflows own-account-balancing=on. Only the person does that. Balancing is only for
the person's own subscriptions, never for someone else's.
- The proxy. On the hub,
hedge applyrunshedge cli-proxy install. It installs the pinned CLIProxyAPI release, checks its SHA-256, and runs it as the user servicehedge-cli-proxy.serviceathttp://127.0.0.1:8317, loopback only. Its files are in~/.local/share/hedge-cli-proxy/. The client key is in~/.config/hedge/cli-proxy.keyand the management key in~/.local/share/hedge-cli-proxy/management.env, both mode 600. Install keeps a file that Hedge did not write and stops at a linked path. - The Codex catalog. Codex and T3 offer only the service tiers that the
proxy's model catalog lists for a model. Upstream's catalog lists only
priority, but Codex accounts also serveultrafaston GPT-6.2 Sol, GPT-6.2 Astra, GPT-6.1 Sol and GPT-6 Astra. So the proxy reads its Codex catalog from~/.local/share/hedge-cli-proxy/codex-catalog.json(models.codex-catalogin its config): upstream's catalog with theultrafasttier added. Install writes it, each balancer run fetches it again when it is 3 hours old, andhedge cli-proxy catalogfetches it now. A failed or empty fetch keeps the last file. The doctor warns while the file is missing. - The model registry. The proxy routes by a second file, upstream's
models.json, with one model list per Codex plan (codex-pro,codex-team, and so on). It sends a model only to subscriptions whose plan lists it. Hedge writes it to~/.local/share/hedge-cli-proxy/models-catalog.json(models.catalogin the config) on the same schedule as the catalog. When Codex accounts serve a new model before upstream lists it,earlyModelsinpacks/hub/lib/codex-catalog.tsadds it to both files as a copy of the model it succeeds, in the registry only for the plans it names: GPT-6.2 Sol copies GPT-6.1 Sol, and GPT-6.2 Astra copies GPT-6 Astra, both forcodex-pro, because a Business seat refuses them. Upstream's own entry replaces the copy once it appears. - Subscriptions. The person adds each of their own Claude accounts on the
hub, or their Codex accounts on the
codexplan. Setup never waits for them: the proxy installs and runs with none. Until the proxy holdshub.proxyAccountsof them that work (2 by default),hedge applyandhedge doctorshow aTo do:line with the login command, and nothing fails.hedge cli-proxy accountscounts them; it exits 4 while too few work. On thebothplan it counts Claude subscriptions, andhedge cli-proxy doctornames the Codex ones beside them. Keep the login URL and callback values out of logs and Git. - The balancer. Every 5 minutes,
hedge cli-proxy-balancereads the weekly usage of each subscription and gives the highest priority to the one whose weekly quota resets first. A full or unreadable subscription gets priority 0. A Claude subscription with extra usage turned on (a Team seat) would bill past its windows, so the balancer turns it off while any window is full and on again when all have capacity. It lists the ones it turned off in~/.local/state/hedge/cli-proxy-paused.json, so a subscription turned off by hand stays off. To allow paid extra usage on a Claude subscription, add its full Auth Index to the JSON array in~/.local/share/hedge-cli-proxy/allow-extra-usage.jsonon the hub. The next balance run resumes any listed subscription it paused. Find the full index in the management panel or theauth_indexfield from the authenticatedGET /v0/management/auth-filesresponse on the hub. Full subscriptions get priority 0 for routing new sessions. A session already bound to an exempt subscription can still incur extra usage.hedge cli-proxy-balance --dry-runprints the ranking and changes nothing. Unreadable usage does not fail the run. Its log lines name a subscription by provider and short id, such asClaude subscription aaaabbbb, never by its file name, which holds the account's email. The short id is the first 8 characters of the subscription's Auth Index in the management panel. When the Auth Index holds other characters than letters, digits,-and_, the short id is the first 8 characters of the SHA-256 of the file name instead:printf %s <file name> | sha256sum | cut -c1-8on the hub finds it. When the proxy says a subscription's login expired (invalid_grant) while that subscription fails, the balancer's log line says so, andhedge cli-proxy doctorwarns with the same short id and its sign-in command. Only working subscriptions count towardhub.proxyAccounts. Usage that is unreadable for another reason has no such warning: it clears on a later run. - Claude Code. On the
claudeandbothplans, on the hub and on each devbox, Hedge setsenv.ANTHROPIC_BASE_URLto the proxy andapiKeyHelperto a command that reads the client key file. The key is never in the settings file. - Codex. On the
codexandbothplans, Hedge sets Codex'smodel_providertohedge-proxy, a provider that reads the same key file. - Devboxes. The hub's SSH tunnel to each devbox carries port 8317. On the
hub,
hedge cli-proxy doctorprints one connect command per devbox; it sends the key on standard input, then runshedge applyon the devbox. Connect only saves the key, andhedge applywrites the Claude and Codex settings. When the hub hands a box over, it sends the key, runs connect, then runshedge applyon the box. When that apply exits 0, the hub says when an agent there keeps its own sign-in. When it exits nonzero, a timeout included, the hub says only the exit code andhedge box run <box> -- hedge apply. - When the proxy is down. Hedge's Claude settings wait for
hedge cli-proxy check, and its Codex settings wait forhedge cli-proxy check codex. Both checks only read. On the hub, both also fail whilehedge cli-proxy doctorfinds the proxy unsafe: a plugin Hedge did not install, or panel files that do not match their pins. When the proxy is unsafe, or does not serve an agent with this machine's key,hedge applyleaves that agent's settings out and removes Hedge's own values, so the agent uses its own sign-in, and the next apply changes nothing. When the proxy does not answer at all, a check passes for an agent whose settings hold Hedge's whole proxy route, sohedge applykeeps that route and open sessions work again once the proxy answers; without the whole route it fails, and apply adds none. A Claude credential beside Hedge's proxy address leaves with it, unless a pack sets that same value now, and aTo do:names it. Only the Hub pack may set Hedge's proxy values; a profile that sets one fails to load and names the setting.hedge applyandhedge doctorname the failed check. When the proxy answers the key but lists no model for the agent, the check exits 4: the agent stays on its own sign-in, and the line is aTo do:with the login command, not a failure. TheTo do:names the agent whose model is missing. Most often the proxy holds none of that agent's subscriptions that work. Runhedge cli-proxy doctoron the hub to tell the two cases apart: it counts the subscriptions that work, and fails when one works but the proxy lists no model for it.hedge cli-proxy connectthen saves the key, andhedge applykeeps the agent on its own sign-in until the proxy serves it. A later apply then sends the agent there. Connect still changes nothing when the proxy does not answer or refuses the key. The first apply after the proxy answers again sends the agent back to the proxy. - The panel. The Proxy panel workflow is off by default and needs
own-account balancing. With
hedge packs --workflows proxy-panel=on,hedge cli-proxy installadds the pinned CLIProxyAPI management panel with quota history charts, drain forecasts, and Reset weekly and Reset Fable buttons, and the quota-ledger plugin that keepshub.proxyHistoryDaysof history (35 by default). Both downloads must match their SHA-256. The balancer then records each subscription's quota windows in the ledger on every run. The panel is athttp://127.0.0.1:8317/management.htmlon the hub, and on each devbox through its tunnel; it is never behind the hub's HTTPS. Sign in with theMANAGEMENT_PASSWORDin~/.local/share/hedge-cli-proxy/management.envon the hub. A reset button spends a banked reset, which does not come back: the first click arms it, and a second click within 5 seconds spends it. Hedge ownsconfig.yaml, so a panel edit to it lasts until the nexthedge apply. Turning the workflow off first restarts the proxy with the panel closed, then removes the page and the pinned plugin and keeps the history file.hedge cli-proxy doctorfails while a closed panel still answers, when the page does not match its pin (CLIProxyAPI may have fetched an unpinned one), and on any plugin Hedge did not install: with plugins on, anyone with the management key can install others from CLIProxyAPI's plugin store. Turning the panel off keeps those and names them. Every tunnelled client reaches the proxy as 127.0.0.1, so 5 wrong panel sign-ins from any devbox ban 127.0.0.1 from the management API for 30 minutes. That also stops the balancer and the doctor on the hub until the ban ends. - Stop on one machine.
hedge cli-proxy disconnectremoves the settings and the key. Then runclaudeand enter/login.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

