Write the review folder under the state folder into the generated settings.json #807

Merged
lilleman merged 10 commits from item-582 into main 2026-12-04 04:51:37 +01:00
4 changed files with 4 additions and 4 deletions
Showing only changes of commit d483a1d8c2 - Show all commits
+1 -1
View File
@@ -68,7 +68,7 @@ build-release and build-epic run every claude in the loop's Claude home, `~/.loc
- every plugin the clone's `settings.json` enables, which build-release or build-epic installs;
- what Claude Code keeps in its home: your sign-in there, the sessions and the memory files.
Sign in to the loop's home once. Until you have, build-release and build-epic stop and print the line to run, `CLAUDE_CONFIG_DIR=~/.local/share/build-release/claude-home claude`: type `/login` in the claude it opens. A model you pick there with `/model` stays in the generated `settings.json`. The loop's home has no theme or status line of yours: those stay in your own `~/.claude`, for the claude you start yourself. build-release or build-epic builds the home again once the clone holds another commit, as after `self-update`, or `XDG_STATE_HOME` moves, and keeps the sign-in, the model and the sessions. The home follows the clone whose build-release or build-epic ran last, so run only the release clone's, never the development clone's: that one would point every running loop at unreleased rules.
Sign in to the loop's home once. Until you have, build-release and build-epic stop and print the line to run, `CLAUDE_CONFIG_DIR=~/.local/share/build-release/claude-home claude`: type `/login` in the claude it opens. A model you pick there with `/model` stays in the generated `settings.json`. The loop's home has no theme or status line of yours: those stay in your own `~/.claude`, for the claude you start yourself. build-release or build-epic builds the home again once the clone holds another commit, as after `self-update`, and keeps the sign-in, the model and the sessions. It builds the home again when you change `XDG_STATE_HOME`, too. The home follows the clone whose build-release or build-epic ran last, so run only the release clone's, never the development clone's: that one would point every running loop at unreleased rules.
The setup keeps each project's config, and what you choose for a project, in the config folder, `~/.config/build-release/`. Its tools keep their own state, such as transcripts, review reports and locks, in the state folder, `~/.local/state/build-release/`. The loop's Claude home is in the data folder, `~/.local/share/build-release/`, which holds what build-release builds again and what Claude Code writes. Where `XDG_CONFIG_HOME` holds an absolute path, the config folder is `build-release/` under that path instead, and likewise the state folder under `XDG_STATE_HOME` and the data folder under `XDG_DATA_HOME`; this README spells the defaults. Set such a variable in the environment Claude Code starts in, since rule-hook reads it there. Back up these four folders:
+1 -1
View File
@@ -17,7 +17,7 @@ from text_files.file_writes import replace_file
LINKED = ("CLAUDE.md", "agents", "rules", "skills")
# Stands for the clone's folder in the clone's settings.json. Every value that holds it is a shell command, such as a hook's.
CLONE = "{clone}"
# Stands for the reports folder in the clone's settings.json: the folder under the state folder that holds each chunk's review reports, so a session may write there. Unlike CLONE, its value is a path, not part of a shell command.
# Stands for the reports folder, which holds every chunk's review folder, in the clone's settings.json. Every value that holds it is a path, so unlike CLONE it isn't shell-quoted.
REPORTS = "{reports}"
# The file in the home that names the clone, its commit and the reports folder the home was built from.
BUILT_FROM = "built-from"
+1 -1
View File
@@ -66,7 +66,7 @@ class Home(unittest.TestCase):
self.assertEqual(self.settings()["tui"], "fullscreen")
self.assertEqual(json.loads((self.clone / "settings.json").read_text(encoding="utf-8")), SETTINGS)
def test_the_generated_settings_let_a_session_write_the_review_folder_wherever_the_state_folder_is(self) -> None:
def test_the_generated_settings_let_a_session_write_the_reports_folder_wherever_the_state_folder_is(self) -> None:
self.unready()
self.assertEqual(self.settings()["permissions"], {"additionalDirectories": [str(self.reports), "~/code"], "defaultMode": "bypassPermissions"})
+1 -1
View File
@@ -154,7 +154,7 @@ class ClaudeHomeEffect(unittest.TestCase):
self.assertEqual(ran[-1], f"{built} auth status")
self.assertIn(f"{built} plugin install code-review@claude-plugins-official", ran)
def test_lets_a_session_write_the_review_folder_under_the_state_folder_it_is_given(self):
def test_lets_a_session_write_the_reports_folder_under_the_state_folder_it_is_given(self):
with tempfile.TemporaryDirectory() as folder:
claude = pathlib.Path(folder, "claude")
claude.write_text('#!/bin/sh\necho \'{"loggedIn": true}\'\n')