feat(fleet): Stage 0 — repo-agnostic Linux VM host for the agent fleet - #1
Open
IsraelAfangideh wants to merge 1 commit into
Open
IsraelAfangideh wants to merge 1 commit into
IsraelAfangideh wants to merge 1 commit into
Conversation
Provision one fat Linux VM to run the Claude Code fleet off the laptop, with almost no rebuild. Repo-agnostic and multi-host (GitHub + Bitbucket): the research code in this repo is unrelated; fleet/ just lives here. - bootstrap.sh: idempotent host provisioning — Docker CE (native, replacing OrbStack's Mac shim), Node + Claude Code, uv, tmux/git; swap, swappiness, inotify and open-file tuning so the box holds many concurrent sessions. - bin/fleet-credentials: multi-host git auth. SSH host-key trust and/or per-host HTTPS token helpers reading 0600 token files — tokens never touch env vars, mounts, or the agent (the Stage-1 vault principle, applied early). - bin/fleet-clone + config/repos.tsv: clone/replicate many repos across hosts; fresh clones run a setup command, existing repos only fetch; one failure never aborts the sweep. - bin/fleet-worktree, bin/fleet-session: thin multi-repo git-worktree helper and a tmux-backed session wrapper (reattachable equivalent of `claude --bg`, so you drive the box from Mac or phone and survive SSH drops). - bin/fleet-doctor: preflight for hardware headroom, tooling, tuning, and creds. - Dockerfile.workspace: optional generic native-Docker image, seed of a Stage-1 environment. Makefile + README runbook, with an explicit Stage 0 -> Stage 1 map. All scripts pass shellcheck and were exercised end-to-end (clone/fetch/setup, worktree lifecycle, credential-helper output, tmux session lifecycle). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016MdFBB1nCBndDK7KtS5t2P
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Stage 0 of moving the Claude Code agent fleet off the laptop: a self-contained kit to provision one fat Linux VM and replicate the setup there, with almost no rebuild. Your
/goalbehavior, routines, dispatcher, and worktrees run unchanged — just on a box that won't swap itself to death at ten concurrent sessions.Everything lives under
fleet/. It is repo-agnostic and multi-host — it manages many repos across GitHub and Bitbucket. The research code in this repository is unrelated;fleet/just happens to live here (this was the branch's repo).On Linux, OrbStack disappears — it's the Mac shim for fast containers; Linux gets them natively through Docker, so
bootstrap.shinstalls Docker CE directly and that whole layer is gone.What's included
bootstrap.shuv, tmux/git; swap,vm.swappiness, inotify watches, and open-file limits tuned for many concurrent sessions.bin/fleet-credentials0600token files — tokens never touch env vars, mounts, or the agent.bin/fleet-clone+config/repos.tsvbin/fleet-worktree/bin/fleet-sessiongit worktreehelper and a tmux-backed session wrapper (reattachable equivalent ofclaude --bg) — drive the box from Mac or phone, survive SSH drops.bin/fleet-doctorDockerfile.workspaceMakefile,README.mdReal config is git-ignored; only
*.examplefiles ship.Credential principle (early Stage-1 vault behavior)
HTTPS tokens live only in
~/.config/fleet/*.tokenat mode0600, read on demand by a git credential helper, wired into the remote by git. They are never printed, never baked into env vars / mounted files / a system prompt, and never handled by the agent — so push/pull work from inside every session without the model seeing a credential.Testing
All scripts pass
shellcheckand were exercised end-to-end against local bare repos (no network/auth needed):fleet-clone: fresh clone runs setup once; re-run only fetches; a deliberately broken repo fails without aborting the sweep (regression-tested — caught and fixed aset -e+[ ] && cmdabort bug).fleet-worktree:add/list/path/rmlifecycle, branch names sanitized into paths.fleet-credentials:git credential fillreturns the correct per-host username+token (GitHubx-access-token, Bitbucketx-token-auth) from the0600files.fleet-session: tmux session create / list / idempotent reattach / kill.fleet-doctor: correct PASS/WARN/FAIL classification on a live box.Stage 0 → Stage 1
Each piece maps onto cloud Managed Agents so nothing is throwaway:
Dockerfile.workspace→ environment, token files/helpers → vaults,~/.claudeconfig → agent,fleet-session→ session per ticket, SSH/tmux ping → webhooks (session.status_idle), the dispatcher → a scheduled deployment. Details infleet/README.md.🤖 Generated with Claude Code
https://claude.ai/code/session_016MdFBB1nCBndDK7KtS5t2P
Generated by Claude Code