Start here

Install

Install bay with one command, then check the machine with bay doctor.

Install bay with one command on macOS or Linux, on ARM or Intel. The script downloads a signed release, checks it, and puts one program in ~/.local/bin. Then bay install sets up the machine and the repository, and bay doctor checks both.

Install bay

sh
curl -fsSL https://getbay.io/install.sh | sh

It installs the newest release that has a build for your machine. The script installs one program, then runs bay install. Inside a repository it also runs bay doctor. It needs no root access. It needs curl or wget, sha256sum or shasum, and ssh-keygen from OpenSSH 8.2 or newer.

Where the program comes from

The script downloads bay from GitHub Releases. Each release holds one archive per target, a VERSION file, SHA256SUMS, and its SSH signature SHA256SUMS.sig. A bay release key signs SHA256SUMS, which covers the archives and VERSION. The signed VERSION file names the release, so an older signed release cannot stand in for it.

text
https://github.com/gudjon/bay/releases/download/v<version>/bay-<target>.tar.gz

targets: x86_64-apple-darwin, aarch64-apple-darwin,
         x86_64-unknown-linux-musl, aarch64-unknown-linux-musl

What the script does

  1. 01

    Detect the platform

    The script reads the operating system and the CPU architecture.

  2. 02

    Pick the release

    It picks the newest release with a build for your machine. BAY_VERSION picks an exact version instead.

  3. 03

    Verify the signature

    It verifies SHA256SUMS against SHA256SUMS.sig with ssh-keygen -Y verify. It stops when the signature does not verify. It trusts two keys: the release key, held in hardware, and the 0.x build key.

  4. 04

    Check the sha256

    It checks that the signed VERSION file names the version it picked. It compares the sha256 of the archive with the signed SHA256SUMS. It stops on a mismatch, and it installs nothing.

  5. 05

    Install the program

    It writes the program to ~/.local/bin/bay.

  6. 06

    Run install and doctor

    It runs bay install, then bay doctor when you run it inside a repository. When ~/.local/bin is not on PATH, it names the fix and stops before both.

What bay install changes

bay install has two scopes: this machine, and the clone it runs in. bay install --machine writes only the machine's part, wherever it runs. bay update runs it this way. bay install inside a clone also writes that clone's part. Outside a clone, it writes the machine's part only.

Hook entries go into the project's settings file, and one merge of that file into main reaches every clone. The table is bay's own list, as bay help shows it. Roll bay out to many machines gives the order for a fleet.

`bay install`
Writesthe bay program and its skill in each Claude config directory
Writesin a clone, without --machine: bay's hook entries in the project's agent settings file and this clone's bay.* Git config
Nevermain: you commit and merge the settings file
Neverwith --machine: hook entries, a project's settings or its Git config

Where each part goes

The program and the skill are the machine's part. Every other row is the clone's part.

PartWhere it goes
The program~/.local/bin/bay.
The skillskills/bay/ in every Claude config directory bay finds, as the next section says.
bay's hook entries.claude/settings.json or .codex/hooks.json, when [agent] product on main names that product. A digest of other tools' entries goes in the local Git config.
bay.main and bay.remoteThe local Git config: from --main and --remote, else what they hold, else the remote's default branch and origin.
bay.machineThe local Git config, when it is unset.
The commit-graph settings belowThe local Git config.
SSH signingThe local Git config, with a key registry and a key on this machine.

Every Claude config directory

bay install and bay update write the skill into every Claude config directory they find. Your own comes first: $CLAUDE_CONFIG_DIR, else ~/.claude. Then ~/.claude, and each ~/.claude-* folder that holds settings.json, .claude.json, projects or skills. On Linux, bay also takes the config directory of each running claude session of yours under the same HOME. bay doctor checks the copy in each one, and its skill row lists each directory with its state. Name any other directory in your global Git config, one value for each directory.

sh
git config --global --add bay.claudeConfigDirs <dir>

The commit-graph

In a clone, bay install also sets Git to keep a commit-graph with changed-path Bloom filters. Git reads the graph to walk history faster. Without it, bay gives the same answers, only slower. It sets fetch.writeCommitGraph to true in the local Git config, so each fetch refreshes the graph. Unless core.commitGraph is false, it writes the first graph when the clone has none with filters.

Environment variables

Set these variables for the sh that runs the script.

sh
curl -fsSL https://getbay.io/install.sh | BAY_VERSION=<version> sh
VariableEffect
BAY_VERSIONInstall this exact version.
BAY_INSTALL_SKIP_SIGNATURE=1Check only the sha256, when ssh-keygen is missing. Read the warning below first.

Verify

At a terminal, bay doctor prints one status line. A pipe or --json gets one JSON result instead. Exit 0 means that every required row is green, and a red row names its floor and the fix. Without an agent hook, the hooks row reads off, and Security and privacy says what bay then guards. If bay --version does not print a bay version, another bay comes first on your PATH. Put ~/.local/bin first on your PATH, or remove the other bay.

text
$ bay --version
$ bay doctor
bay <version> | git <version> | claude <version> | doctor ready

Requirements

bay doctor goes red below the Git floor for the role of the machine. With Claude Code's hooks, the machine needs Claude Code 2.1.302 or newer. With Codex, it needs Codex 0.153.2 or newer.

A machine that runs checks needs a sandbox: bwrap on Linux. macOS has sandbox-exec. On Linux, bwrap must be able to cut off the network, because checks run without it. When AppArmor restricts user namespaces, as on Ubuntu 24.04 and later, bwrap cannot build the sandbox. Then the red sandbox row names an AppArmor profile for bwrap that fixes it.

WhereGitWhy
An agent view2.40 or newerThe floor. bay doctor goes red below it.
Recommended2.50 or newerBelow it, bay doctor names the features it degrades.
A bay-hosted main branch2.54 or newerThe main hook that keeps main append-only.
A runner2.50 or newerbay runner run refuses below it with TOOL_BELOW_FLOOR.

Uninstall

First remove bay's hook entries from the project's settings file, and merge that change into main. Then unset bay's local Git config in each clone where you ran bay install. Then remove the program, its kept versions, the bay skill and bay's state directory from the machine. Never delete bay refs on a shared remote: other agents still read them.

sh
# once, on main: remove bay's entries from .claude/settings.json (or .codex/hooks.json), and merge that change
# in each clone where you ran bay install:
git config --local --unset gpg.format
git config --local --unset gpg.ssh.allowedSignersFile
git config --local --unset bay.unrelated-hooks-digest
git config --local --unset bay.machine
git config --local --unset bay.main
git config --local --unset bay.remote
git config --local --unset bay.origin                # only if you set it, on the origin's own machine
git config --local --unset bay.producerName   # set by bay when this clone wrote unsigned evidence
git config --local --unset bay.registryKey    # these three: set by bay install --approver
git config --local --unset bay.approverKey
git config --local --unset bay.approverName
git config --local --unset fetch.writeCommitGraph   # these three: only if bay install set them
git config --local --unset commitGraph.changedPaths
git config --local --unset commitGraph.changedPathsVersion
git for-each-ref refs/bay/          # local bay refs; delete them only in this clone
# bay's views and sessions: remove its worktrees, then "$(git rev-parse --git-common-dir)/bay"

# on the machine
rm ~/.local/bin/bay
rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/bay/versions"
rm -rf "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/bay"   # and skills/bay in each directory doctor's skill row lists
rm -rf "${XDG_STATE_HOME:-$HOME/.local/state}/bay"
git config --global --unset-all bay.claudeConfigDirs
git config --global --unset bay.updateVersion
git config --global --unset bay.updateAuto
git config --global --unset bay.runnerSandbox
git config --global --unset-all bay.checkReadPath
git config --global --unset bay.checkStartLoad1        # these seven: only if you set them for a runner
git config --global --unset bay.checkStartCpuSome
git config --global --unset-all bay.checkStartCpuCgroup
git config --global --unset bay.checkCpus
git config --global --unset-all bay.singleMachineEnvironment
git config --global --unset bay.runnerParallelChecks
git config --global --unset bay.runnerAhead