kohen: fallback for Claude Code when the gate is down

Every Claude Code session on the dev VM goes through bikoret.ch; when
the pod is not ready the session cannot reach Anthropic (2026-10-15:
Doorpost drift → 503 → the transmitter locked out, recovered by hand).
An `env` entry in ~/.claude/settings.json overrides the shell
environment (verified), so `env -u … claude` is not a recovery while
the gate is armed there.

- scripts/claude-direct: start straight to Anthropic via a --settings
  JSON on the command line, which outranks every settings file.
- scripts/claude-bikoret: probe the gate first; if it does not answer,
  say so and exec claude-direct (BIKORET_STRICT=1 refuses instead).
- scripts/bikoret-settings on|off|status: arm/disarm the gate for every
  launcher; `on` writes the key (kohen only), `off` is the recovery.
- KOHEN.md: the fallback and the order of recovery.

Tested 2026-10-15: dead gate armed in settings → plain claude hangs,
claude-direct answers; probe at a dead host → fallback + answer; live
gate → answer with the fringe.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Scott KarpandClaude Fable 5.1 committed 2026-10-15 19:12:04 +00:00
1 parent 20cd75562c
commit 4acd56c4b6
4 files changed
+100

No files matched your search

+28
View File
@@ -620,6 +620,34 @@ Each upstream call spends one `api_calls_external` of the day's manna
the bedikah by hand still runs. Streaming is refused (422). A non-200
from the model passes through as it came. Tamid §1.1 has the contract.
**Fallback — when the gate is down, Claude Code here is down with it.**
Every request of a session behind the gate goes to bikoret.ch; if the pod
is not ready (503: stale manna at the day boundary, a Doorpost drift, a
hung rollout) the session cannot reach Anthropic at all. Note that an
`env` entry in `~/.claude/settings.json` OVERRIDES the shell environment
(verified 2026-10-15): `env -u ANTHROPIC_BASE_URL … claude` does nothing
while the gate is armed there. Three tools, all in `scripts/` (install to
`~/.local/bin`), none of which holds a key:
```bash
claude-direct # start Claude Code straight to Anthropic, whatever
# settings.json says (a --settings JSON on the command
# line outranks every settings file); OAuth as usual
claude-bikoret # start behind the gate; probes the gate first and, if
# it does not answer, says so and starts claude-direct.
# BIKORET_STRICT=1 claude-bikoret refuses instead.
bikoret-settings on|off|status
# arm / disarm the gate for EVERY launcher (desktop,
# background jobs, plain `claude`) via settings.json.
# `on` writes the courtyard key there — the kohen runs
# it, not the builder; `off` is the recovery.
```
Order of recovery: `claude-direct` (always works), then `bikoret-settings
off` if background sessions must also recover, then fix the pod
(`curl -s https://bikoret.ch/kodesh/health` names the failed check), then
`bikoret-settings on` and `claude-bikoret` again.
### The second scroll — *Mishneh haTorah*
`/kodesh/health` carries `mesorah_hash` beside `l1_hash`: the mesorah