From 9240b34e0c759d78a66c27e443716df9fbbcc4b2 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 3 Dec 2026 13:11:11 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20security=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20keep=20the?= =?UTF-8?q?=20hooks=20in=20settings.json=20on=20their=20full=20path,=20so?= =?UTF-8?q?=20a=20session=20started=20outside=20the=20loop=20still=20runs?= =?UTF-8?q?=20them?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- bin/repo_checks/test_tools_named_bare.py | 4 +++- bin/review_rules/test_reviewer_context.py | 2 +- settings.json | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 59613154..f09ca7d7 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ It applies only those commits on the newest tag, tests them with `ci.sh`, tags a ## Tools -loop-claude puts the release's tools first on the `PATH` of every claude it starts, so this README and the rules name each tool bare, as in `metric-bench`. Install puts only `loop-claude` on your shell's `PATH`: there, call another by its path, `~/.claude/bin/`, from the project's checkout. A claude you start yourself, outside loop-claude, doesn't find the tools, so it runs without this setup's hooks and status line. The tools under `~/.claude` are the release's; test a change to one from `~/code/claude-config/bin`. The tools are listed in alphabetical order, and the packages under `bin/` follow under their own heading. +loop-claude puts the release's tools first on the `PATH` of every claude it starts, so this README and the rules name each tool bare, as in `metric-bench`. Install puts only `loop-claude` on your shell's `PATH`: there, call another by its path, `~/.claude/bin/`, from the project's checkout. The tools under `~/.claude` are the release's; test a change to one from `~/code/claude-config/bin`. The tools are listed in alphabetical order, and the packages under `bin/` follow under their own heading. - `chunk-pr open|sync|ready|push|merge|clean|open-epic` opens a chunk's pull request as a draft, brings its branch level with origin's default branch, marks it ready and merges it once its checks pass, with `gh` on a GitHub origin and `tea` elsewhere. Where the project's config sets `epic-branch`, the pull request goes into the epic's working branch instead, `push` pushes later commits and asks the auto-reviewer for a review, and `open-epic` opens the pull request from that branch into the default branch. The chunks of one project merge one at a time: in its turn, `merge` brings the branch level again, finishes the plan items its `--finish` flags name, and waits for the checks. Under `merge = "human"` it then marks the pull request ready and leaves the merge to a person. Once the pull request is merged, `clean` removes the chunk's worktree and branch and fast-forwards the main checkout. `chunk-pr --help` states the steps. - `chunk-preflight` finds the mechanical facts a chunk starts from, and with `--worktree` makes its worktree; `loop-claude` runs it with `--worktree` before it routes each chunk, and `chunk-preflight --help` lists the facts. diff --git a/bin/repo_checks/test_tools_named_bare.py b/bin/repo_checks/test_tools_named_bare.py index 154144f4..ccc91af2 100644 --- a/bin/repo_checks/test_tools_named_bare.py +++ b/bin/repo_checks/test_tools_named_bare.py @@ -10,6 +10,8 @@ BY_ITS_FOLDER = re.compile(r"(?:~|\$HOME)/\.claude/bin/[\w.<>-]+(?![\w.<>/-])") HISTORY = ("CHANGELOG.md", "todo.md", "docs/") # README.md → Install links loop-claude and compress-archives from a shell and a crontab, which lack the tools, and says how to run any other tool there. INSTALL = {"~/.claude/bin/loop-claude", "$HOME/.claude/bin/compress-archives", "~/.claude/bin/"} +# settings.json names its hooks and its status line by their folder, and the test of the reviewer hook quotes it. Claude Code reads the file in every session, also one the human starts without the tools on PATH. A hook it cannot find doesn't refuse anything, so a bare name there would switch rule-hook off in that session. +SETTINGS = ("settings.json", "bin/review_rules/test_reviewer_context.py") class ToolsNamedBare(unittest.TestCase): @@ -19,7 +21,7 @@ class ToolsNamedBare(unittest.TestCase): found = [] for name in str(tracked).splitlines(): path = ROOT / name - if name.startswith(HISTORY) or name == "bin/repo_checks/test_tools_named_bare.py" or not path.is_file(): + if name.startswith(HISTORY) or name in SETTINGS or name == "bin/repo_checks/test_tools_named_bare.py" or not path.is_file(): continue for number, line in enumerate(path.read_text(encoding="utf-8", errors="replace").splitlines(), 1): found += [f"{name}:{number}: {spelled}" for spelled in BY_ITS_FOLDER.findall(line) if not (name == "README.md" and spelled in INSTALL)] diff --git a/bin/review_rules/test_reviewer_context.py b/bin/review_rules/test_reviewer_context.py index d45c3f8b..368db494 100644 --- a/bin/review_rules/test_reviewer_context.py +++ b/bin/review_rules/test_reviewer_context.py @@ -97,7 +97,7 @@ class Reviewers(unittest.TestCase): def test_settings_run_the_hook_as_each_subagent_starts(self): hooks = json.loads((REPO / "settings.json").read_text())["hooks"]["SubagentStart"] - self.assertEqual(hooks, [{"hooks": [{"command": "larv-review reviewer-context", "timeout": 30, "type": "command"}]}]) + self.assertEqual(hooks, [{"hooks": [{"command": "~/.claude/bin/larv-review reviewer-context", "timeout": 30, "type": "command"}]}]) if __name__ == "__main__": diff --git a/settings.json b/settings.json index 2140d4fd..2159d926 100644 --- a/settings.json +++ b/settings.json @@ -27,7 +27,7 @@ { "hooks": [ { - "command": "rule-hook", + "command": "~/.claude/bin/rule-hook", "timeout": 30, "type": "command" } @@ -39,7 +39,7 @@ { "hooks": [ { - "command": "larv-review reviewer-context", + "command": "~/.claude/bin/larv-review reviewer-context", "timeout": 30, "type": "command" } @@ -64,7 +64,7 @@ "skipDangerousModePermissionPrompt": true, "skipWorkflowUsageWarning": true, "statusLine": { - "command": "statusline.py", + "command": "~/.claude/bin/statusline.py", "refreshInterval": 30, "type": "command" },