Debug the request that holds the own instruction

This commit is contained in:
2026-12-04 06:47:41 +01:00
parent 308e2fc518
commit 3a287c90a9
+4
View File
@@ -113,6 +113,10 @@ def failures(requests: mock_messages_api.Requests, before: dict[str, str]) -> li
found.append(f"no chunk finished within {PATIENCE} s; the loop's tmux windows show:\n{windows()}")
if not any(SETUP_INSTRUCTION in text for text in texts):
found.append(f"none of claude's {len(texts)} requests held the setup's CLAUDE.md, so the loop's home did not load")
for n, text in enumerate(texts):
if OWN_INSTRUCTION in text:
i = text.index(OWN_INSTRUCTION)
print("DEBUG", n, len(texts), text[max(0, i - 700):i + 100], "\nSTART", text[:600], file=sys.stderr)
if any(OWN_INSTRUCTION in text for text in texts):
found.append("a request held the person's own CLAUDE.md, so `~/.claude` loaded in the loop")
after = snapshot(HOME / ".claude", HOME / ".claude.json")