Skip to content

Commit f29ae82

Browse files
wmitsudaclaude
andcommitted
Use PR-specific temp file paths to avoid parallel collisions
When multiple summarize-changes analyses run concurrently, they all wrote to /tmp/pr_diff.txt and /tmp/pr_toml.txt, causing data races. Use /tmp/pr_<number>_diff.txt and /tmp/pr_<number>_toml.txt instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d06ceda commit f29ae82

File tree

1 file changed

+6
-6
lines changed
  • .claude/skills/summarize-changes

1 file changed

+6
-6
lines changed

.claude/skills/summarize-changes/SKILL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ Do NOT proceed with any further steps.
3131

3232
## Step 2: Fetch PR Data and Run Analysis
3333

34-
Run these commands using the Bash tool:
34+
Run these commands using the Bash tool. **IMPORTANT:** Use the PR number in temp file paths to avoid collisions when multiple analyses run in parallel.
3535

3636
1. `gh pr view <number> --repo erigontech/erigon-snapshot` to get PR title, description, and metadata
3737
2. Save the diff to a temp file:
3838
```
39-
gh pr diff <number> --repo erigontech/erigon-snapshot > /tmp/pr_diff.txt
39+
gh pr diff <number> --repo erigontech/erigon-snapshot > /tmp/pr_<number>_diff.txt
4040
```
4141
3. Fetch the full toml file from the PR's head branch (with fallback for merged PRs where the branch may be deleted):
4242
```
@@ -45,15 +45,15 @@ Run these commands using the Bash tool:
4545
TOML_FILE=$(gh pr diff <number> --repo erigontech/erigon-snapshot --name-only | head -1)
4646
# Try head branch first; if deleted (merged PR), fall back to merge commit, then main
4747
gh api "repos/erigontech/erigon-snapshot/contents/$TOML_FILE" \
48-
-H "Accept: application/vnd.github.raw" -F ref="$HEAD_REF" > /tmp/pr_toml.txt 2>/dev/null \
48+
-H "Accept: application/vnd.github.raw" -F ref="$HEAD_REF" > /tmp/pr_<number>_toml.txt 2>/dev/null \
4949
|| gh api "repos/erigontech/erigon-snapshot/contents/$TOML_FILE" \
50-
-H "Accept: application/vnd.github.raw" -F ref="$MERGE_COMMIT" > /tmp/pr_toml.txt 2>/dev/null \
50+
-H "Accept: application/vnd.github.raw" -F ref="$MERGE_COMMIT" > /tmp/pr_<number>_toml.txt 2>/dev/null \
5151
|| gh api "repos/erigontech/erigon-snapshot/contents/$TOML_FILE" \
52-
-H "Accept: application/vnd.github.raw" -F ref="main" > /tmp/pr_toml.txt
52+
-H "Accept: application/vnd.github.raw" -F ref="main" > /tmp/pr_<number>_toml.txt
5353
```
5454
4. Run the analysis script with both files:
5555
```
56-
python3 "$(git rev-parse --show-toplevel)/.claude/skills/summarize-changes/analyze_diff.py" /tmp/pr_diff.txt /tmp/pr_toml.txt
56+
python3 "$(git rev-parse --show-toplevel)/.claude/skills/summarize-changes/analyze_diff.py" /tmp/pr_<number>_diff.txt /tmp/pr_<number>_toml.txt
5757
```
5858

5959
The script (`analyze_diff.py` in the skill directory) parses the diff, classifies all changes, and outputs structured sections. Use its output to build the final report.

0 commit comments

Comments
 (0)