Skip to content

fix(repo): restore CLAUDE.md, emptied by a truncating version-bump edit - #7517

Merged
proggeramlug merged 2 commits into
mainfrom
fix/restore-claude-md
Aug 6, 2026
Merged

fix(repo): restore CLAUDE.md, emptied by a truncating version-bump edit#7517
proggeramlug merged 2 commits into
mainfrom
fix/restore-claude-md

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

CLAUDE.md — the project-instruction file loaded into every agent session — has been 0 bytes on main since v0.5.1288, across four merges (#7499, #7501, #7514, #7509).

Cause

A version-bump edit written as a single expression:

open("CLAUDE.md", "w").write(open("CLAUDE.md").read().replace(old, new))

Python evaluates the outer open(..., "w") before the argument, so the file is truncated to zero length first; the inner .read() then returns "", .replace() is a no-op on it, and the write stores an empty string. Nothing errors: the bump looks like it worked, and git commit faithfully records a 254-line deletion.

It went unnoticed because a version bump is the one edit nobody re-reads, and the four merges that carried it were each reviewed for their own diff.

Fix

Restored verbatim from 40214c50f (last intact copy, 32,056 bytes) with only the **Current Version:** line advanced 0.5.1287 → 0.5.1291 to match Cargo.toml. Byte-identical to its last good state otherwise — verified by diffing against that blob.

The safe form, used earlier in the same session, binds the read to a variable first:

c = open(p).read()
open(p, "w").write(c.replace(old, new))

No code change; Cargo.toml was never affected (its bumps used the read-then-write form throughout, which is why the workspace version is correct at 0.5.1291).

Ralph Küpper added 2 commits August 6, 2026 11:43
open(f,"w") truncates before the inner open(f).read() runs, so four
merges (v0.5.1288-1291) shipped a 0-byte CLAUDE.md. Restored from
40214c5 with the version line advanced to 0.5.1291.
@proggeramlug
proggeramlug merged commit 241261e into main Aug 6, 2026
8 of 12 checks passed
@proggeramlug
proggeramlug deleted the fix/restore-claude-md branch August 6, 2026 09:44
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@proggeramlug, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a513ad6-d094-48c5-a9b4-6e330e16993d

📥 Commits

Reviewing files that changed from the base of the PR and between e4ab722 and 30bed4c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • CLAUDE.md
  • Cargo.toml
  • changelog.d/7517-restore-claude-md.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/restore-claude-md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant