AI Foundry · agents

Yaroslav's agentic setup on AI Foundry

The knowledge base and the maintenance procedure for Yaroslav's agents on the AI Foundry lab machines (aifoundry1–3 at Studio 45), and since Fri 9 Oct 2026 on a fourth machine, mordast, on another tailnet. The design principle: every machine has an agent, and he can reach each one from his phone. Point any agent here to make sure all six Claude accounts, Antigravity and Codex run on all three machines, and to bring back whatever is not live. To do something similar on your own machines, point your agent here too. Written Wed 7 Oct 2026 (week 41) on the Intel; Codex added the same afternoon from aifoundry2. Live state: the agents dashboard. This page and the dashboard are public: anyone with the link can open them, though neither is listed. This page is the published copy of MAINTENANCE.md in his aifoundry-setup repo, which stays private because it holds email addresses. So the files named here (LESSONS.md, the why behind each piece; RESTORE.md, rebuilding a wiped machine; README.md; HOSTS.md) are not linked.

1. The target: thirty-one agents on four machines

🛑 An account is its KEY, and no name carries an account number (his ask, Tue 13 Oct 2026, week 42: "can you do a refactor where you drop the numbers? IE, I want claude-yaroslavvb3-gmail not claude3-yaroslavvb3-gmail. I still have an ordering, but the ordering is implicit. The reason is that I may add or remove some accounts, and the numbers leave gaps"; scope he chose, "Everything, by name"). The key is the email's local part with .→-, plus -, plus the first label of the domain; the home is ~/.claude-<key> and the tmux session claude-<key>. The rows below are in the table's order, and that order names nothing — re-ordering it changes nothing on disk.

aifoundry1 aifoundry2 aifoundry3 mordast
yaroslavvb-gmail (yvb): yaroslavvb@gmail.com, home ~/.claude-yaroslavvb-gmail, tmux claude-yaroslavvb-gmail:rc Remote Control server Remote Control server, plus the pinned session ed6d06d5 in claude-yaroslavvb-gmail:main Remote Control server Remote Control server
yaroslavvb2-gmail (yvb2): yaroslavvb2@gmail.com, home ~/.claude-yaroslavvb2-gmail, tmux claude-yaroslavvb2-gmail:rc Remote Control server Remote Control server Remote Control server Remote Control server
yaroslavvb3-gmail (yvb3): yaroslavvb3@gmail.com, home ~/.claude-yaroslavvb3-gmail, tmux claude-yaroslavvb3-gmail:rc Remote Control server Remote Control server Remote Control server Remote Control server
yaroslavvb-mlcollective (mlc): yaroslavvb@mlcollective.org, home ~/.claude-yaroslavvb-mlcollective, tmux claude-yaroslavvb-mlcollective:rc Remote Control server Remote Control server Remote Control server Remote Control server
yvb-agent-spacesheep (sheep): yvb-agent@spacesheep.dev, home ~/.claude-yvb-agent-spacesheep, tmux claude-yvb-agent-spacesheep:rc Remote Control server Remote Control server Remote Control server Remote Control server
yaroslav-nekko (nekko): yaroslav@nekko.ai — 🛑 PLACEHOLDER, machines = - — — — —
Antigravity: one Google account per machine, ~/.gemini, tmux agy:rc, agy 1.3.5 and full turbo (agy-turbo check) everywhere since Wed 14 Oct 2026 Google account 1, yaroslavvb@gmail.com Google account 2, yaroslavvb2@gmail.com Google account 3, yaroslavvb3@gmail.com installed Wed 14 Oct 2026, on his ask; the Google account he signs in
Codex: ChatGPT account yaroslavvb@gmail.com (Pro), ~/.codex, no server of its own sessionpipe's hooks approved; spacesheep reaches it the same the same —
Devin: yaroslavvb@gmail.com (Max), the devin CLI, and a personal outpost (devin-worker.service) signed in, outpost aifoundry1 signed in, outpost aifoundry2 (since 9 Oct) signed in, outpost aifoundry3 signed in, outpost mordast

Each machine's target is TARGETS in bin/aifoundry-agents. mordast (since Fri 9 Oct 2026) is not a lab machine: it is on another tailnet, its user is yaroslav (home /home.local/yaroslav), and it runs the Claude accounts, Devin and, since Wed 14 Oct 2026, Antigravity (his ask: "upgrade Antigravity on all the machines, including Mordast"; it had none). No Codex there.

The count: 31. Each lab machine runs 8 (5 Claude + Antigravity + Codex + Devin), so 24, and mordast runs 7 (5 Claude + Antigravity + Devin). The nekko row is never a fault anywhere: its key, home name and tmux name are reserved, it is never signed in and never served, because he has no Claude Pro on it (his words, Sun 11 Oct 2026: "I actually don't have Claude Pro, so don't sign into the Necko AI. Keep it as a placeholder.").

Two accounts joined on Sat 10 Oct 2026 (week 41), his ask: every account reachable from its own phone, on every machine but the M5 (that one is his laptop, where Claude is the desktop app). The names then moved three times in four days, so read any older doc by its EMAIL, never by its number:

homes when why
~/.claude + ~/.claude-yv2 … -yv5 to Sat 10 Oct 2026 -yv4 said nothing about whose login it held, and three homes turned out to hold the wrong account
~/.claude-<key> Sat 10 Oct 2026 "the .claude-yv4 should have enough information to figure out original account". That afternoon ~15:40 PDT the numbers 4 and 5 swapped accounts
~/.claude<n>-<key> Sun 11 Oct 2026 "uniform naming for all Claude home directories" — the bare ~/.claude stopped being an account at all
~/.claude-<key> Tue 13 Oct 2026 the numbers dropped: "I may add or remove some accounts, and the numbers leave gaps"

A machine on any earlier generation is moved over by claudes homes migrate then --apply --retire-old (LESSONS.md §1.1): it moves each home by the login it holds, carries that login with it, splits the shared ~/.claude's own login out into its keyed home, and deletes nothing.

The accounts are not written in any script. They come from one table, claude_accounts.tsv: authored in flush-util on the Macs, shipped byte-identical to ~/.config/claude-accounts.tsv on each machine (MANIFEST, and aifoundry-agents install), and read there by bin/claudes and bin/aifoundry-agents — each keeping only the rows whose machines column names that machine. aifoundry_agents install on the Mac compares the two copies' shasum and refuses to ship on a mismatch. Each script keeps a copy of the table as a literal, used only when the file cannot be read at all — a table that parsed and names no account for this machine means it serves none. To add or move an account: edit flush-util's copy, cp it into this repo, commit, install.

How he reaches them:

State on Sat 10 Oct 2026 (week 41), midday PDT: the target became 26. Claude accounts 3 and 4 are deployed on all four machines and signed out everywhere — his sign-in, one browser per account (claudes login 3, claudes login 4, or aifoundry_agents fix). Accounts 1 and 2 are untouched and still live on aifoundry1–3. On mordast, account 1's home holds yaroslavvb2@gmail.com (WRONG ACCOUNT since ~10:04 that morning) and account 2 is signed out: both are a sign-in in the right browser, and nothing on that machine will start a server until the email matches.

State on Fri 9 Oct 2026, 17:3x PDT: 16 of 18 live. Devin runs on all four machines (aifoundry2 and mordast since 9 Oct); mordast's two Claude accounts wait for his sign-in and first-run answers (aifoundry_agents fix mordast).

State on Wed 7 Oct 2026, 15:40 PDT: 12 of 12 live. Both Claude accounts and Antigravity run on all three machines (the Claude servers on aifoundry1 and aifoundry3 since 14:12). Codex 0.161.0 is installed on all three, sessionpipe's twelve hooks are approved in it (his ask: "Make sure codex is installed on all of the machines … and sessionpipe approved"), and he signed it in to ChatGPT at 15:22 (device codes). A test session on each machine ran a command and reported to spacesheep. Still open, his and needing root: Codex's sandbox cannot start for unconfined programs, such as sessionpipe's daemon (§5, sandbox blocked), so until setup/codex-apparmor.sh runs on a machine, each command there runs outside the sandbox after an automatic review.

2. How it stays up through a restart

3. The dashboard

Yaroslav's AI Foundry agents shows every agent, one card per machine. Tap an agent to see its state, the command that fixes it, and a prompt to hand to an agent. The lab dashboard and the AI Foundry hub link to it.

4. The procedure, for an agent pointed here

  1. Look. Read the dashboard, or run ~/git0/flush-util/aifoundry_agents status on a Mac, or ssh aifoundryN ~/.local/bin/aifoundry-agents status from a lab machine. Each agent is live, or it has a state and the command that fixes it.
  2. Fix what needs nobody (§5, "anyone" rows): watchdogs, the stream, a dead server or daemon, a disconnected daemon, scripts out of date.
  3. Never do his steps. The first-run answers, every sign-in and approving Codex hooks are his. The agents' own safety checks refuse them anyway, and a sign-in code pasted into a chat ends up in the session log, which sessionpipe mirrors to spacesheep. (codex-hooks trust --yes is for when he asked for the approval in his own words, as on 7 Oct.)
  4. Hand him his steps in one message that ends your turn. Usually that is one command, run at a terminal on the Intel or the M5: ~/git0/flush-util/aifoundry_agents fix <machines>. It asks before each step and prints any sign-in link he needs to open.
  5. Verify on the dashboard: every agent live, and no warnings on the machine cards.
  6. If you changed a script: commit in aifoundry-setup, push (from aifoundry2, or from a Mac clone), then run ~/git0/flush-util/aifoundry_agents install (§6). On aifoundry2, run ~/claude/aifoundry-setup/snapshot.sh --commit. A lesson that cost real time goes into LESSONS.md, linked from here only if it changes the procedure.

Run the session on aifoundry2 in ~/claude (the lab door), or on the Intel in ~/git0/gyroscope (the private door) when aifoundry2 itself is down. A Claude session started by a machine's Remote Control server must never stop that server. An Antigravity task must never restart its own daemon.

5. Runbook: every state and what fixes it

On a machine the commands live in ~/.local/bin; over ssh, spell the path out: ssh -t aifoundry1 ~/.local/bin/aifoundry-agents consent yvb2.

State What it means Who Fix
No reading The machine is off or offline, or its stream service stopped anyone, then him ssh aifoundryN uptime. If it answers: ssh aifoundryN ~/.local/bin/aifoundry-agents stream install. If not, it is down: there is no remote console, so ask Roman or #community-lab to power it on
Claude · First run Signed in, but the first-run answers are missing, so no server can start (LESSONS.md §1.7) him aifoundry_agents fix aifoundryN, or aifoundry-agents consent <handle> on the machine (a handle, key or email — 🛑 a bare number is refused, with the account it used to mean). By hand: tmux attach -t '=claude-yaroslavvb-gmail' (that account's own session: claude-yaroslavvb2-gmail … claude-yvb-agent-spacesheep; claudes status prints it), answer, /exit, y to "Enable Remote Control?", then Ctrl-b d
Claude · Signed out No login on the machine, or it lapsed him aifoundry_agents fix aifoundryN. It runs claudes login <handle> and prints the claude.ai link: open it signed in as that account, and paste the code back. Renewing drops that account's server for about a minute
Claude · Wrong account The home is signed in to another Claude account him claudes login <handle> in a browser signed in to claude.ai as that account — the login follows the browser, not the --email it is given (LESSONS.md §1.8). claudes login prints which account that must be, and aifoundry-agents checks the email as soon as the login lands
Claude · Down Signed in and answered, but no server is running anyone Wait a minute for the watchdog, then claudes up. Read tmux capture-pane -p -t '=claude-yaroslavvb-gmail:rc' (that account's own session, from claudes status; the quoted = is what makes the target exact, because tmux matches prefixes) and claudes status
Claude · Connecting The server runs but has no connection to claude.ai anyone Give it two minutes. Then read the pane, and check the machine's network (tailscale status, DNS)
Claude · full (warning) 64 of 64 sessions, so the app says "disconnected" anyone End old phone workers by pid, from claudes status (LESSONS.md §2.3)
Claude · lapses in under 7 days (warning) The login lapses soon him aifoundry_agents fix aifoundryN offers the renewal
Antigravity · Signed out ~/.gemini holds no login him aifoundry_agents fix aifoundryN. It runs agys login and prints the Google link: open it as the machine's Google account (§1), and paste the code back. By hand: agys login, then agys code CODE
Antigravity · Wrong account Signed in to a Google account other than the machine's him agys stop, remove ~/.gemini/antigravity-cli/antigravity-oauth-token, then agys login
Antigravity · Down Signed in, no daemon running anyone Wait a minute for the watchdog, then agys up, and read tmux capture-pane -p -t agy:rc
Antigravity · Disconnected The daemon runs, but its last logged connection status is not "Connected" anyone, but never an Antigravity task on that machine agys restart
Antigravity · turbo not fully on (warning) agy-turbo check fails: some setting or rule is missing, so dashboard tasks stop to ask (before 14 Oct 2026 this checked the preset only, and reads outside the workspace still asked) him (it restarts the daemon) agy-turbo shows which; agy-turbo on (refused while a task runs, unless --now), or answer yes in aifoundry_agents fix
Antigravity · old binary (warning) The daemon runs an agy binary an update replaced (agy.<n>.old) anyone Nothing: the watchdog restarts it on the new binary once idle. To upgrade on purpose: agys update
Codex · Signed out No ~/.codex/auth.json him Once per ChatGPT account, turn on device code login (chatgpt.com → Settings → Security). Then aifoundry_agents fix aifoundryN, or ssh -t aifoundryN ~/.local/bin/codex login --device-auth: open the link it prints, sign in to ChatGPT, enter the one-time code. It waits in the terminal until done
Codex · Hooks to approve sessionpipe's hooks are new or changed, so Codex runs none of them and its sessions go unreported (LESSONS.md §7.2) him aifoundry_agents fix aifoundryN, or ssh -t aifoundryN ~/.local/bin/aifoundry-agents codex-hooks trust: it lists the hooks and asks, then approves sessionpipe's and no others, as Trust in Codex's /hooks does
Codex · Not reporting sessionpipe's hooks are missing from ~/.codex/hooks.json anyone ssh aifoundryN ~/.local/bin/aifoundry-agents fix (it runs sessionpipe install --codex --backfill 0), then the hooks wait for his approval
Codex · Down sessionpipe's control daemon is not active, so spacesheep cannot start Codex here (nor message the other agents' sessions) anyone ssh aifoundryN systemctl --user restart sessionpipe-control.service; its log: journalctl --user -u sessionpipe-control.service -n 30
Codex · Not installed ~/.local/bin/codex is missing anyone OpenAI's standalone installer, read first: curl -fsSL https://chatgpt.com/codex/install.sh -o /tmp/codex-install.sh && CODEX_NON_INTERACTIVE=1 sh /tmp/codex-install.sh (it checks each download's sha256), then aifoundry-agents fix
Codex · Unknown codex app-server did not answer when asked for its hooks anyone codex doctor
Devin · Signed out No Devin login on the machine him aifoundry_agents fix <machine>: it runs devin auth login --force-manual-token-flow, which prints an app.devin.ai link; open it signed in to Devin as yaroslavvb@gmail.com and type the one-time code it shows (5 minutes)
Devin · Not reporting sessionpipe's devin hooks are missing from ~/.config/devin/config.json anyone ssh <machine> ~/.local/bin/aifoundry-agents fix (it runs sessionpipe install --devin --backfill 0)
Devin · Down The machine has an outpost, but devin-worker.service is not active anyone ssh <machine> systemctl --user restart devin-worker.service; its log: journalctl --user -u devin-worker.service -n 30
Devin · Not installed ~/.local/bin/devin is missing him (then a sign-in) curl -fsSL https://cli.devin.ai/install.sh -o /tmp/devin-install.sh && bash /tmp/devin-install.sh </dev/null, then aifoundry_agents fix <machine>
Devin · Unknown devin auth status did not answer within 25 s anyone devin auth status on the machine
Machine · sessionpipe not paired spacesheep cannot message sessions on the machine (its hooks still save them) him aifoundry_agents fix <machine>: it prints a six-digit code; type it at https://spacesheep.dev/pair on the device with his passkey
Codex · other hooks wait for review (warning) A Codex hook that is not sessionpipe's him In codex, /hooks. codex-hooks trust never approves those
Codex · sandbox blocked (warning) Codex's bubblewrap sandbox cannot create a user namespace: Ubuntu denies them to programs AppArmor does not confine (sessionpipe's daemon, ssh, cron). Each command fails once, then runs outside the sandbox after an automatic review (LESSONS.md §7.7) him (root) On the machine: sudo bash ~/claude/aifoundry-setup/setup/codex-apparmor.sh; for aifoundry1 or aifoundry3 from aifoundry2: ssh root@aifoundryN 'bash -s' < ~/claude/aifoundry-setup/setup/codex-apparmor.sh. It installs an AppArmor profile for his Codex binary alone and checks that the sandbox then starts
Machine · watchdog off A cron line is missing anyone claudes watch on, agys watch on (fix does both)
Machine · watchdog stale (over 3 min) Cron stopped running it, or a lock is stuck anyone crontab -l, ~/.claudes/watch.log. A tmux server started inside the lock keeps it (LESSONS.md §2.6)
Machine · scripts differ from the repo The installed claudes, agys, agy-turbo or aifoundry-agents is not this checkout's anyone aifoundry_agents install
Machine · no bypass default Claude's settings.json lacks what aifoundry2 has (LESSONS.md §3.1) him answer yes in aifoundry_agents fix (it runs setup/claude-settings-defaults.sh)
Machine · linger off tmux dies at the last logout him (may need root) loginctl enable-linger yaroslavvb
Machine · disk low Under 5 GB free in the home anyone Old scratchpad copies first (~/claude/private/tmp-claude-*), never another user's files

6. The commands

~/git0/flush-util/aifoundry_agents (on either Mac) runs the machine's own aifoundry-agents over ssh, one machine after another:

~/.local/bin/aifoundry-agents (on each machine, from bin/ here) does the same things there: status [--json], fix, consent <ACCT>, codex-hooks [trust [--yes]], install, and stream [install|remove|status].

consent <ACCT> gives the answers he would type in tmux. ACCT is a key, an email, a handle (yvb yvb2 yvb3 mlc sheep) or an unambiguous shortening; 🛑 a bare number is refused and the refusal names the account that number used to mean (Tue 13 Oct 2026, week 42 — the numbers 4 and 5 had swapped accounts on 10 Oct, so a number read as a row position would be right only by luck). It marks the welcome screens done, trusts ~/claude, and answers yes to "Enable Remote Control?". It first takes the watchdog's lock and closes the window that waits for the answers (otherwise the closing TUI or the next watchdog run can overwrite or race the write). Then it writes hasCompletedOnboarding, projects["~/claude"].hasTrustDialogAccepted and remoteDialogSeen into the account's .claude.json, and starts the server. It asks on the terminal and refuses without one.

codex-hooks shows Codex's own list of its hooks (hooks/list, what /hooks shows) with each one's review state. codex-hooks trust approves the ones that are sessionpipe's (from ~/.codex/hooks.json, running ~/.local/share/sessionpipe/sessionpipe-hook codex <event>) and wait for review, with the same two calls Codex's own /hooks makes, so Codex computes the hashes itself (LESSONS.md §7.2). It asks on the terminal; --yes is only for when he asked for it in his own words. fix also signs Codex in (codex login --device-auth) when he says yes.

The rest is in README.md: claudes (status, up, watch, login, pin, resume, new, pane, serve, homes, homes migrate), agys (status, up, update, busy, restart, stop, watch, login, code, new), agy-turbo (on, off, show, check). tools/agy-schema.py prints the settings an agy binary knows (after an update, to see what changed).

7. Rules

  1. His steps are his: first-run answers, every sign-in, approving Codex hooks, and turning on bypass or turbo. Hand them over; never answer them.
  2. Never print, copy or commit a login: ~/.claude*/.credentials.json, ~/.gemini/**/*token*, ~/.codex/auth.json, ~/.config/gh, ~/.config/spacesheep, ~/.ssh/id_*. A sign-in code goes into a terminal, never a chat.
  3. Kill only by a pid that claudes status, agys status or aifoundry-agents names as yours. Never by pattern: other lab users run Claude too (LESSONS.md §1.4).
  4. Every account is explicit — never set CLAUDE_CONFIG_DIR=~/.claude, and never leave it unset either. Spell the account's own ~/.claude-<key>, or use claude_as <handle|key|email> / claude_yvb … claude_sheep. A non-empty ~/.claude takes the CLI's hashed-credential branch and lands on an empty slot that reads exactly like logged out; an unset one named account 1 until Tue 13 Oct 2026 (week 42) and now names no account at all, so a bare interactive claude refuses (override CLAUDE_ALLOW_DEFAULT_HOME=1). ~/.claude is the shared settings dir and holds no login here (LESSONS.md §1.2, and his ask "have a guard against using the default home. Every account should be explicit").
  5. Never stop the server or daemon your own session runs in (§4).
  6. Nothing private goes on a lab machine: no gyroscope checkout, no people notes, no vault text. Root is shared and tailnet members can log in as other users (LESSONS.md §1.11).
  7. Never touch the ET-SoC-1 cards (/dev/et*) for this work.
  8. The dashboard stays free of names, ids, paths and secrets (§3).

8. Reaching the machines

9. Files

File What it is
bin/aifoundry-agents status, fix, consent, install and the dashboard stream, on each machine
bin/claudes, bin/agys, bin/agy-turbo the Claude accounts' servers, the Antigravity daemon, turbo
claude_accounts.tsv → ~/.config/claude-accounts.tsv the accounts table: the only place an account, its home, its tmux session and its expected login are written. A byte-identical copy of ~/git0/flush-util/claude_accounts.tsv
~/.local/bin/codex → ~/.codex/packages/standalone/current/bin/codex Codex, OpenAI's standalone install (a native binary; it updates itself)
~/.codex/hooks.json, ~/.codex/config.toml sessionpipe's Codex hooks (written by sessionpipe install --codex); config.toml holds sessionpipe's notify line and, under [hooks.state], the approvals
dashboard/index.html the live dashboard's page
agentic-setup.html, tools/md2page.py this file's published copy, and what regenerates it from this file
~/git0/flush-util/aifoundry_agents the Mac side: runs the above over ssh (in flush-util, not here)
~/.config/systemd/user/spacesheep-stream-aifoundry-agents.service the stream, written by aifoundry-agents stream install
LESSONS.md, RESTORE.md, HOSTS.md the why; a rebuild; the agent on aifoundry1 or aifoundry3

10. Changes