Skip to content

Linux host scripts

The detailed view of a building block of 5.1; its summary is 5.2.10.

Aspect Detail
Role the bash scripts for the Linux host, run by the owner or the user claude in a terminal: the tokens of the Claude Code sessions, the host's status, the hardening of a new host, the one-time root steps, the shared worktree folder, the intake session
Interfaces the token file that login shells, the home session's unit and the sandboxes' token helper read (7.1.1); GitHub's API for a token's account, scopes and revocation; Bitwarden for the vault setup; the sandbox scripts use the token helper and the root packages script
Code scripts/linux; their tests in scripts/tests
Decided by root CLAUDE.md (CLAUDE.md), "Rules the scripts follow"; #157 (the bot account), #319 (user units), #333 (the shared worktree folder), #415 (Bitwarden)
Deployment run from a checkout on the Linux host; the token helper is copied to the user claude's own folder by the sandbox setup (7.1.1)
Status built
Script Role
set-token.sh stores one value in the token file, read with hidden input and validated
rotate.sh checks every token, gets new ones (GitHub by device flow), tests each before staging it, and revokes the replaced ones only once they are no longer in use (setup/token-rotation.md)
lib.sh, service-keys.sh, github-account.sh shared by the two above and status.sh: the staging, the list of tracked keys, which account a token acts as
status.sh the setup at a glance, staged and active apart; read-only
sbx-token the sandboxes' token helper: prints one token from the token file for sbx, so the value never reaches a command line
harden.sh hardens a new host before anything else runs there: the admin account, Tailscale, claude without sudo, automatic updates, key-only SSH, ufw; run as root by the owner (#892)
root-steps.sh the one-time root steps of the user-unit setup, run by an admin account from the owner's own clone
sandbox-root-packages.sh the packages provisioning needs, installed as root inside a sandbox VM, never on the host
claude-vault-setup.sh the owner's part of putting the service user's tokens on Bitwarden
worktree-base.sh the shared worktree folder outside every checkout (sdlc/parallel-work.md)
claude-intake.sh starts an intake session with the intake plugins on for that session only (setup/claude-baseline.md)

How to use them: setup/linux-host.md.