Persist CLAUDE.md across nightly sync#6
Merged
Conversation
Same root cause as README.coolify.md (#2): root-level CLAUDE.md gets wiped every night when the sync does `git reset --hard upstream/main`. Upstream has its own (pre-Coolify, Caddy-centric) CLAUDE.md that then replaces ours. Ship our Coolify-aware CLAUDE.md as `.github/CLAUDE.coolify.md` so it survives the backup/restore, and have patch.py overwrite the root-level CLAUDE.md from it on each run. Factored the overwrite logic into a small helper (`_overwrite_from_github`) now that we have two files on the same pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/CLAUDE.coolify.mdholds the Coolify-aware CLAUDE.md content (same pattern as.github/README.coolify.mdfrom Move README.coolify.md into .github/ so daily sync preserves it #2).patch.pyoverwrites root-levelCLAUDE.mdfrom it on each run.overwrite_readme()becomes_overwrite_from_github(src, dst)since we now have two files on the same pattern.test-patch.shassertsCLAUDE.mdgets the Coolify content post-patch.Why
Same root cause as #2. The nightly sync does
git reset --hard upstream/mainbefore restoring.github/from backup. Anything at repo root that upstream also ships — likeCLAUDE.md— gets reverted to upstream's version (the pre-Coolify Caddy-centric one). Spotted when reviewing a working tree after a sync had run.Test plan
bash .github/scripts/test-patch.shpasses (new CLAUDE.md assertion green, idempotency clean)shellcheck .github/scripts/test-patch.shcleanCLAUDE.mdon main starts with# CLAUDE.mdand contains "Coolify" (not upstream's "Caddy (reverse proxy)")🤖 Generated with Claude Code