Start here
Quickstart
Install bay, set your checks, start a runner, then start and merge a first change.
This page takes a repository to its first merge. You install bay, commit a config and a policy to main, and start a runner. Then an agent opens a change with bay start and submits it with bay merge.
- 01
Install bay
Run the script on each machine that runs agents or a runner.
sh curl -fsSL https://getbay.io/install.sh | sh - 02
Check the machine
Fix each red row before you go on. Each red row names its fix. Until the next step turns on the agent hook, the
hooksrow readsoff. Security and privacy says what bay guards with the hook, and without it.sh bay doctor - 03
Configure the repository
.bay/config.tomlnames the agent product, and Configuration lists its keys. Each check's command lives in.bay/policy.toml, reads abay.check.request/1on stdin, and writes abay.check.result/1on stdout. Test one before you commit it:bay plugin test check -- <command>runs bay's contract cases and changes nothing. Commit the config and push it to main, since bay reads it only from main. Then runbay installin this clone to add the hook entries, and other clones need no step of their own. Once the policy below is on main, merge the new.claude/settings.jsonwithbay save "add bay hooks", and every clone then runs bay's hooks.toml # .bay/config.toml [agent] product = "claude" - 04
Set the required checks
.bay/policy.tomlon main lists each required check, with itsexpected_minimum: the fewest tests it must collect.when_pathsnames the files a check tests, and a change no check covers merges at once, with no runner. Theadapterlist names every file that decides a pass, and bay runs those files from the base. A change to the policy or a check's files also runs its own new files, and both must pass. Without.bay/policy.tomlon main, the runner blocks every merge withPOLICY_MISSING, so push the first policy to main yourself. A repository that wants no checks says so:unchecked = truein its policy.toml # .bay/policy.toml (on main) revision = 5 # an integer; every policy change raises it [[check]] id = "tests" environment = "linux-x86_64" command = "scripts/bay-check tests" when_paths = ["src/**", "tests/**", "pytest.ini", "scripts/bay-check", "scripts/bay-check.d/**"] # a change elsewhere skips it adapter = ["scripts/bay-check", "scripts/bay-check.d/", "pytest.ini"] inputs = [] # inputs beyond the tree; "commit" or "history" keys evidence by commit expected_minimum = 400 # required, no default timeout_s = 1800 path = ["/usr/local/bin", "/usr/bin", "/bin"] # absolute directories; the check's PATH env = ["DATABASE_URL"] # the only variables passed from the runner retry_on_failure = 1 # rerun a failure on the same tree, up to 5 times allow_flaky = false # a failure then a pass is flaky: CHECK_FLAKY [[check]] id = "e2e" environment = "linux-x86_64" command = "scripts/bay-check e2e" when_paths = ["src/**", "e2e/**", "scripts/bay-check", "scripts/bay-check.d/**"] adapter = ["scripts/bay-check", "scripts/bay-check.d/"] expected_minimum = 20 [[quarantine]] # optional: one check set aside for a stated time id = "e2e" # a required check with expected_minimum above zero must remain environment = "linux-x86_64" reason = "red on main since change k3m7p2ra; fix in progress" end = "2026-10-25" # a date or a Change-Id owner = "platform-team" # optional: who answers for it since = "2026-10-18" # optional: when it was set aside; bay status shows its age [limits] # optional; each key a positive integer max_file_mib = 10 # any one file the change adds or changes, in MiB max_files = 200 # the files it touches max_added_lines = 5000 # the lines it adds; a binary file adds none max_waiting_approvals = 5 # changes that may wait for a yes at once - 05
Start a runner
A runner is optional: without one,
bay merge --waitandbay savemerge right where they run. With one, the runner finishes each merge after its agent leaves. Run it under a supervisor, such as the onebay runner installwrites, and run at least two. Each check runs in a sandbox:bwrapon Linux,sandbox-execon macOS, unless the machine setsbay.runnerSandboxtonone. There, a check sees only its candidate, its own files and system files, with no network. Setnetwork = trueon a[[check]]that needs the network.sh bay runner run - 06
Start a change
The agent says what the work is, in a few words, and names the paths it needs. bay opens a sparse view of those paths and prints its result.
--paths .opens the whole tree. SetBAY_ACTORto name the agent, or bay uses your user name.sh bay start "fix the login page" --paths src/api tests/api - 07
Edit, then merge
The agent edits files in the view, then commits them with a message that main's commit keeps.
bay mergereturns at once with an operation id, and a runner checks the candidate and merges it. A change no check covers merges at once. To hear the outcome, runbay merge <change> --wait=3600as a background task. A person who edits the main checkout directly runsbay save <intent>. Run bay without a runner explains it.sh bay merge - 08
Read the state
bay statusdescribes your own changes, at most 20, with each state and why it waits. It names everyone else's underdetail.more_changes.bay status <change>reads one. A refusal names what you can still do and when to retry. For a failed check, the refusal andbay statussay why each failed unit failed. Itssaycounts your open changes by who owes the next step, and names the ones that need someone.sh bay status