zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 9da03fadf4d90d317d6c7c768e61771a72ea029e (tree)
parent 09eac343fba91ce69647e6ba8f4b7cfb742ab2f2
Author: Motiejus Jakštys <motiejus@jakstys.lt>
Date:   Wed, 25 Feb 2026 19:09:17 +0000

CLAUDE.md: clarify loop exit conditions — never stop mid-loop

Three changes to prevent the agent from stopping between iterations:

1. Add bold "Do NOT stop between iterations" notice at the top of
   the main loop — each commit is a checkpoint, not a stopping point.

2. Main loop step 6: reinforce "keep looping until blocked or all
   corpus tests pass."

3. Module-system sub-loop: step 5 now says "immediately continue to
   step 3. Do NOT stop here." Step 6 is renamed "Exit condition"
   with explicit criteria (gap zero, num_passing incremented, tests
   pass).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Diffstat:
Mstage0/CLAUDE.md | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/stage0/CLAUDE.md b/stage0/CLAUDE.md @@ -15,6 +15,10 @@ tests pass. Repeat until all corpus tests in `stage0/corpus.zig` pass: +**Do NOT stop between iterations.** Each commit is a checkpoint, not a +stopping point. Continue looping until all tests pass or you are +genuinely blocked (need user input to proceed). + 1. **Bump.** Increment `num_passing` by 1 in `stage0/corpus.zig`. 2. **Run.** `zig build test-zig0` — observe the failure. 3. **Port.** Mechanically copy the needed logic from `src/Sema.zig` into @@ -27,7 +31,8 @@ Repeat until all corpus tests in `stage0/corpus.zig` pass: - Add functions in the same order as in the original Zig file. 4. **Test.** `zig build test-zig0` — iterate until the new test passes. 5. **Clean up & commit.** See [Cleaning Up](#cleaning-up). -6. **Go to 1.** +6. **Go to 1.** Do NOT stop between iterations — keep looping until + blocked or all corpus tests pass. ## When stuck @@ -85,10 +90,13 @@ entries so that IP indices in the function body AIR match. - `ensureFileAnalyzed` → recursively processes imported modules. - `zirExport` → forces resolution of exported declarations. 4. **Test.** `zig build test-zig0` — the gap should shrink. -5. **Clean up & commit** (see [Cleaning Up](#cleaning-up)). Keep +5. **Clean up & commit** (see [Cleaning Up](#cleaning-up)), then + **immediately continue** to step 3. Do NOT stop here. Keep `num_passing` at whatever value passes; don't bump it until the gap reaches zero. -6. **Repeat** until the gap is zero and `num_passing` can be incremented. +6. **Exit condition:** the gap is zero, `num_passing` is incremented, + and `zig build test-zig0` passes. Only then return to + [The loop](#the-loop) step 6. ### Important constraints