tools: move pr-review-state.json out of .claude/ to /tmp/#31
Conversation
Anything under .claude/ is treated as a sensitive file by Claude Code even with --dangerously-skip-permissions, because that directory controls permissions and skill behavior. The review-cycle state file is just a per-cycle progress tracker (addressed comment IDs + rerun counts) — not sensitive in content, only sensitive by location. Every write to it inside the sandbox forced a permission prompt, defeating the autonomous review-cycle flow. Move it to /tmp/pr-review-state.json: outside the repo, outside .claude/, and per-container ephemeral by design. Each new review cycle resets the file at the start, so loss on container restart is harmless. Drops the mkdir + .git/info/exclude setup; the new path needs neither. Fix applies to every skill that delegates to /jetpack-pr-review-cycle — including /premium-analytics-implement-task Step 9 and the /jetpack-address-issue Step 8 handoff. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
There was a problem hiding this comment.
Pull request overview
Docs-only change to the /jetpack-pr-review-cycle slash command: relocates its state file from .claude/pr-review-state.json to /tmp/pr-review-state.json to avoid Claude Code's sensitive-file permission prompt that fires for any path under .claude/, even with --dangerously-skip-permissions. This unblocks autonomous review-cycle runs invoked directly or via delegating skills (/premium-analytics-implement-task, /jetpack-address-issue).
Changes:
- Update state-file path in declaration, setup snippet, prior-round comparison, flaky-CI rerun tracker, and end-of-round write-back (5 references).
- Drop now-unneeded
mkdir -p .claudeand.git/info/excludesetup steps. - Add rationale paragraph explaining why
/tmp/is used and why per-container ephemerality is harmless.
Fixes RSM-3254
Proposed changes
Move
jetpack-pr-review-cycle's state file from.claude/pr-review-state.jsonto/tmp/pr-review-state.json..claude/is treated as a sensitive file by Claude Code, even with--dangerously-skip-permissions, because that directory controls permissions and skill behavior. The review-cycle state file is harmless tracking data (addressed comment IDs + rerun counts + round number), but its location forced an interactive permission prompt on every write, breaking the autonomous review-cycle flow inside the sandbox./tmp/pr-review-state.json. Outside the repo, outside.claude/, and per-container ephemeral by design. Each new review cycle resets the file at the start, so loss on container restart is harmless (worst case: idempotent re-processing of already-addressed comments).mkdir -p .claudeandecho ... >> .git/info/excludelines./tmp/always exists, and we're outside the repo so no gitignore needed.Five references in
.claude/commands/jetpack-pr-review-cycle.mdupdated:.claude/)Why this matters beyond one skill
/jetpack-pr-review-cycleis delegated to by other skills — fixing once here unblocks all callers:/premium-analytics-implement-taskStep 9 — RSM-3217 / merged in tools: improve premium-analytics-implement-task skill (continue-on-branch, DoD-driven, slash-command registration) #29/jetpack-address-issueStep 8Both inherit the same sensitive-file blocker until the review-cycle skill itself is fixed.
How was this discovered
Sandbox run of
/premium-analytics-implement-taskfor the pie-chart task (PR #30) progressed cleanly through Steps 1–8 and into Step 9, then blocked on:Even with
IS_SANDBOX=1 claude --dangerously-skip-permissions. The prompt repeats on every state write, so a full review cycle would generate many prompts in a row.Does this pull request change what data or activity we track or use?
No.
Testing instructions
This is a docs-only change to a Claude Code slash command's instructions — no code execution path is altered until the next time someone invokes
/jetpack-pr-review-cycle. To validate:jetpack-ai-sandbox, launchIS_SANDBOX=1 claude --dangerously-skip-permissions./jetpack-pr-review-cycle <PR>)./tmp/pr-review-state.jsonwithout prompting, and that subsequent rounds read/write the same path without prompting.git statusstays clean (no.claude/pr-review-state.jsonto gitignore anymore).Related
/premium-analytics-implement-taskStep 9 delegates here