Repository navigation
fix(review-runs): edit .claude/skills/ in a writable worktree - #219
Conversation
The review-runs skill's Step 6 tells the bot to edit `.claude/skills/` files in place, but the checkout's `.claude/` directory is bind-mounted read-only under the Claude Code 2.1.97+ sandbox (the same RCE-vector protection that PR #216 handled for `.github/` in the nightly skill). In-place edits fail with `OSError: [Errno 30] Read-only file system`. Add the worktree pattern to Step 6 so the bot opens the fix PR from a writable worktree under `$TMPDIR` from the start, instead of hitting the error and diagnosing the mount mid-run. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
test whether using a worktree actually helps |
|
Tested locally in this session and via an already-merged end-to-end case. Local (this sandbox):
End-to-end (real CI): The review-runs session cited in the PR body ( One nit I noticed while testing: |
Summary
The review-runs skill's Step 6 tells the bot to edit
.claude/skills/files and open a PR, but the checkout's.claude/directory is bind-mounted read-only under the Claude Code 2.1.97+ sandbox — the same RCE-vector protection that PR #216 handled for.github/in the nightly skill. In-place edits fail withOSError: [Errno 30] Read-only file system, and the bot has to diagnose the mount and set up a worktree mid-run.Add the worktree pattern to Step 6 so the bot opens the fix PR from a writable worktree under
$TMPDIRfrom the start.Evidence
Run 24233412050 (tend-review-runs on max-sixty/worktrunk, 2026-04-10 07:47Z, session
8adb40c1-4b13-4d11-97dc-bcbbe461b468.jsonl) decided to add transient-failure guidance to.claude/skills/running-tend/SKILL.md(creating PR max-sixty/worktrunk#2050). The bot:git checkout -b daily/review-runs-24233412050on the workspace checkout.Editon.claude/skills/running-tend/SKILL.md→ permission error from the harness.python3write on the same path →OSError: [Errno 30] Read-only file system: '.claude/skills/running-tend/SKILL.md'.mount | grep claudeto diagnose.git worktree add /tmp/claude-1001/wt-review daily/review-runs-24233412050— failed because the branch was already checked out in the workspace.git worktree remove --force,git checkout main, then recreate the worktree.Confirmed in this review-reviewers session's sandbox:
Same root cause as PR #216: claude-code-action restores
.claude/,.mcp.json,.claude.json,.gitmodules, and.ripgreprcfrom the base branch as RCE-vector protection, and Claude Code 2.1.97+ bind-mounts them read-only.Gate assessment
.claude/skills/in place. One observed occurrence this run plus an independent confirmation viamountin this review-reviewers session. Same class of failure as PR fix(nightly): regenerate workflows in a writable worktree #216 (.github/in nightly), which has already been accepted upstream as a structural fix.Passes both gates. Paired with the simplification that most review-runs fix PRs already want a branch anyway, the worktree pattern adds no overhead.
Test plan
plugins/tend-ci-runner/skills/review-runs/SKILL.md.plugins/tend-ci-runner/skills/review-runs/SKILL.mdis not under the read-only.claude/mount (writable in this session)..claude/skills/via the new worktree pattern on the first try.