From dbb38e806a703ee737472f39d753ee3fcd3da436 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 25 Sep 2026 14:38:33 +0000 Subject: [PATCH 1/3] =?UTF-8?q?artifact-audit:=20new-loop=20=E2=80=94=20na?= =?UTF-8?q?me=20the=20native=20dollar=20ceiling,=20ralph=20plugin's=20unli?= =?UTF-8?q?mited=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two drift fixes against the knowledge base (both High-confidence entries): - Step 3's budget bullet offered "remind the user of the session budget" as the fallback ceiling — a reminder is an alert, not enforcement. Claude Code ships --max-budget-usd first-party, and since v2.1.217 it also halts background subagents at the cap (primer §4, v2.1.216-220 entry). - The ralph pattern row now carries the ralph-wiggum trap where the plugin is named: --max-iterations defaults to unlimited (primer §4; sources.md, official plugin README entry). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01DexL4ENdcH1wDBuzVCs3mP --- .claude/skills/new-loop/SKILL.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.claude/skills/new-loop/SKILL.md b/.claude/skills/new-loop/SKILL.md index 1e8534a..2f55cb5 100644 --- a/.claude/skills/new-loop/SKILL.md +++ b/.claude/skills/new-loop/SKILL.md @@ -27,7 +27,7 @@ that returns clear pass/fail (e.g. `pytest test/users`, `npm test`, | Pattern | Use when | Mechanism | |---|---|---| | **`/goal`** (default) | Iterate-to-completion on a well-scoped task with a provable success condition. | `/goal` with a separate validator model (defaults to Haiku). Requires Claude Code v2.1.139+. | -| **ralph** (`/ralph-loop` or bash) | Long autonomous build where each iteration should reset context to anchor files. | Official `ralph-wiggum` plugin, or `templates/ralph/run.sh`. | +| **ralph** (`/ralph-loop` or bash) | Long autonomous build where each iteration should reset context to anchor files. | Official `ralph-wiggum` plugin (`--max-iterations` defaults to **unlimited** — always set it), or `templates/ralph/run.sh`. | | **`/loop`** | Recurring maintenance on an interval (babysit PRs, poll a deploy). | Bundled `/loop` skill (v2.1.72+); cron-backed, session-scoped; recurring tasks expire after 7 days. | Default to `/goal` for "do this task once, correctly." Use ralph for @@ -55,8 +55,11 @@ Create `loops//` (slug derived from the task) containing: 2. **No-progress detection** — instruct the loop to bail if N consecutive iterations produce no git diff / no test-state change (default N=3), and document blockers instead of looping forever. -3. **Budget ceiling** — set `MAX_BUDGET_USD` (ralph/SDK) or remind the user of - the session budget. State the expected cost order-of-magnitude. +3. **Budget ceiling** — set `MAX_BUDGET_USD` (ralph `run.sh` / Agent SDK + `max_budget_usd`), or pass `--max-budget-usd` on the Claude Code invocation + (since v2.1.217 it also halts background subagents at the cap). A reminder + about the session budget is an alert, not a ceiling. State the expected + cost order-of-magnitude. Pull the exact defaults from `guardrails/budget.env`. Reference `guardrails/checklist.md` and confirm every box is satisfied before finishing. From 171afc54764639626810bbea617179437ba10ab4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 25 Sep 2026 14:43:39 +0000 Subject: [PATCH 2/3] =?UTF-8?q?artifact-audit:=20README=20=E2=80=94=20bill?= =?UTF-8?q?ing-layer=20claim=20caught=20up=20with=20the=20KB's=202026-08-3?= =?UTF-8?q?1=20correction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "The billing layer will not save you (soft alerts only)" predates the KB correction that Anthropic now ships real enforcement surfaces (Enterprise Spend Limits API, apps-gateway spend limits, Managed Agents session budgets). The conclusion is unchanged — gateway enforcement fails open by default and none of it reaches a plain Claude Code loop automatically, so the ceiling stays in the harness — but the premise is stated accurately now. Evidence: knowledge/00-primer.md §6 "Correction (2026-08-31)" (High). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01DexL4ENdcH1wDBuzVCs3mP --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a9cc0cb..8304c76 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,11 @@ bakes in guardrails. ## The one rule **Never run an uncapped loop.** Every loop gets all three hard stops — a max -iteration count, no-progress detection, and a token/dollar budget ceiling. The -billing layer will *not* save you (soft alerts only). See +iteration count, no-progress detection, and a token/dollar budget ceiling. +Anthropic now ships some real spend enforcement (Enterprise Spend Limits API, +gateway spend limits, Managed Agents session budgets), but the gateway layer +fails open by default and none of it reaches a plain Claude Code loop +automatically — the ceiling still has to live in your harness. See [`guardrails/`](guardrails/). ## Staying current From 136827158b9cfbb2080a00aebbb610aac8e020bd Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 25 Sep 2026 14:43:40 +0000 Subject: [PATCH 3/3] =?UTF-8?q?artifact-audit:=20ralph=20run.sh=20?= =?UTF-8?q?=E2=80=94=20two=20KB-backed=20comments,=20no=20behavioural=20ch?= =?UTF-8?q?ange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CONFIG block: note that models taking more turns per unit of work (Fable 5.1-class) trip iteration/stall caps tuned on older models earlier; an early stop is a re-tuning signal (primer §4, Fable 5.1 entry, High). - AGENT_CMD: note --permission-prompts none (v2.1.259+) as the narrower deny-by-default alternative to --dangerously-skip-permissions for headless runs (primer/sources, code.claude.com/docs/en/headless, High). Cap values and enforcement logic untouched. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01DexL4ENdcH1wDBuzVCs3mP --- templates/ralph/run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/ralph/run.sh b/templates/ralph/run.sh index 84eb98d..1575f3c 100755 --- a/templates/ralph/run.sh +++ b/templates/ralph/run.sh @@ -12,6 +12,10 @@ set -euo pipefail # ---- CONFIG (edit me) ------------------------------------------------------ +# NOTE: models that take more turns per unit of work (e.g. Fable 5.1-class +# long-horizon models) trip iteration/stall caps tuned on older models earlier. +# An early stop on such a model is a re-tuning signal, not proof of failure +# (see knowledge/00-primer.md §4, Fable 5.1 breaking changes). PROMPT_FILE="PROMPT.md" MAX_ITERATIONS=20 # hard stop #1: iteration cap MAX_BUDGET_USD=10 # hard stop #3: dollar ceiling (enforced below) @@ -19,6 +23,8 @@ STALL_LIMIT=3 # hard stop #2: bail after N no-progress passe COMPLETION_MARKER="COMPLETE" SUCCESS_CHECK="${SUCCESS_CHECK:-false}" # e.g. "pytest -q" / "npm test" # Agent command. --dangerously-skip-permissions only for sandboxed/headless use. +# Narrower alternative (v2.1.259+): --permission-prompts none denies anything +# that would prompt instead of skipping permissions wholesale. AGENT_CMD=(claude -p --dangerously-skip-permissions) # ---------------------------------------------------------------------------