Configuration
Every key is plain git config, readable and removable without this tool.
The keys live under greenbelay.. Keys written as amont.agent.* by an
earlier release are migrated by greenbelay migrate; see
migrate. Environment variables start with GREENBELAY_.
The kill switches
| key | default | effect |
|---|---|---|
$GREENBELAY_OFF | unset | any value switches the guard off for that shell |
greenbelay.enabled | true | switches it off everywhere |
The environment variable is checked first, before any rule runs, because
reading a git config key costs a process and the variable costs nothing.
greenbelay.enabled is consulted only once something has already fired.
Both take git's own boolean dialect — true/false, yes/no, on/off,
1/0, case-insensitively — because git parses them, not us. A value git
refuses warns once and falls back to the default rather than failing.
Stances
| key | takes |
|---|---|
greenbelay.stance | observe | advise | deny — every rule |
greenbelay.<rule>.stance | the same, for one rule |
greenbelay.<rule>.denyAgents | repeatable: an agent type (relais:relais-worker-haiku-default) or a prefix ending in * (relais:relais-worker-haiku-*) |
Most specific wins. See stances.
denyAgents raises advise to deny for a subagent of a named type, and only
for symbol-grep-not-lsp. It is read from --global and --system config only
(a repository cannot set it), and the two lists are merged: an entry in
--system config cannot be removed from --global config, because an empty
value clears nothing. An empty value, a
bare *, or a * anywhere but the end is ignored with one warning; a scope git
refuses adds no values and is reported once. The deny is refuse-once: the first
search for a pattern by that agent is refused, and the identical retry runs. If
the refusal cannot be recorded, the rule advises instead of refusing every retry.
# add the value once (idempotent), and take it back out (exit 5 means it was already absent)
git config --global --get-all greenbelay.symbol-grep-not-lsp.denyAgents | grep -qxF 'relais:relais-worker-haiku-*' \
|| git config --global --add greenbelay.symbol-grep-not-lsp.denyAgents 'relais:relais-worker-haiku-*'
git config --global --fixed-value --unset-all greenbelay.symbol-grep-not-lsp.denyAgents 'relais:relais-worker-haiku-*'
The session notice
| key | default | effect |
|---|---|---|
greenbelay.fetch | true | may a session opening touch the network at all |
greenbelay.agentsMdNotice | true | may it mention a stale amont guidance block |
greenbelay.opener | platform opener | the command greenbelay open and preview register --open use to show a page: a template, split like shell words, {} replaced by the page inside each word (appended when absent), run with no shell. Unset: open, xdg-open or rundll32 url.dll,FileProtocolHandler {} |
checkout.defaultRemote | — | git's own key; which remote is the remote |
Showing a page: greenbelay open
greenbelay open <url|path> opens a page in a window the person sees
(work.page-shown-before-asked). A path must exist and is opened as a
percent-encoded file:// URL. The opener is spawned in its own process group
with no stdin or stdout and its error output kept in a temporary file; it is
waited for up to 2 s. Exit 0, or still running at 2 s (a browser that became
the process), counts as launched and it is never killed. Success prints
nothing; a failure prints one line naming the page, the opener's error output
and greenbelay.opener, and exits 1. A usage error exits 2.
The platform default can hand a page to an automation instance of the browser, so name the command that reaches your own:
git config --global greenbelay.opener '"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" {}'
preview register --open uses the same opener and prints its JSON after the
attempt, with "opened": true or "opened": false; an opener failure leaves
the registration standing and the exit status 0. greenbelay doctor reports
the opener (and warns, with this command, when its program is not found).
Beacons
Beacons tell a central collector which rules a release loaded and which fired (ADR-0090, blue-factory). They are off. Greenbelay writes a beacon to a local spool only when all of these hold in the hook's environment:
GREENBELAY_BEACONS_ENDPOINTis the collector's OTLP endpoint. Claude Code strips everyOTEL_*variable from a hook's environment, so the standard names cannot carry it.GREENBELAY_BEACONSison.- Nothing switches it off:
OTEL_SDK_DISABLED=true;GREENBELAY_BEACONSset to0,off,falseorno(trimmed, any case); or git configgreenbelay.beaconsset to one of those. Any off value wins, and an unrecognised value counts as off. No git config key or greenbelay file turns beacons on.
# the operator, in Claude Code managed settings (env):
# GREENBELAY_BEACONS=on
# GREENBELAY_BEACONS_ENDPOINT=https://otel.example.internal:4318
# a person who wants them off whatever the environment says:
git config --global greenbelay.beacons false
A repository's own .claude/settings.json env reaches the hook the same way
the managed one does, and greenbelay cannot tell them apart: a repository can
turn beacons on toward its own endpoint. greenbelay doctor prints the
endpoint host, so the source is visible.
A beacon holds: the rule id, the verdict (pass, warn, block), the arm,
the session id, the release, and sha256: of the repository name (guessable
for a common name). It never holds a command, a path, an excerpt or the
endpoint. greenbelay doctor says which of off (no endpoint, not opted in, an
off switch) or on the current environment gives, and whether the spool is
unwritable or full. It reads the environment of the shell it runs in, which can
differ from the hook's.
The spool is ~/.claude/greenbelay/beacons.jsonl, one JSON object per line,
written whole under a lock. Past 1 MiB it is renamed to beacons.jsonl.1 (only
when no .1 exists); with .1 present, beacons are dropped once the two files
reach 2 MiB, until a sender drains .1: until a sender exists, beacons stop at the cap and greenbelay doctor says spool full. A sender reads .1 first, then the
live file, skips a malformed or unterminated line, and removes .1 only while
holding beacons.lock in the same directory, after the collector's
acknowledgement. Greenbelay never deletes .1.
What is deliberately not configurable
Which file any of these keys can be set in. --global, then --system,
and nothing else. Not a committed file, and not the --local/--worktree
config of the repository you happen to be standing in — see
stances. Write them with
git config --global; a bare git config inside a repository writes
--local, where this tool will not look.
Whether a failure is silent. It always is. See what it will not do.
Whether the journal can affect a decision. It cannot.