Skip to content

Persist CLAUDE.md across nightly sync#6

Merged
lunarthegrey merged 1 commit into
mainfrom
fix-claude-md-persistence
Apr 24, 2026
Merged

Persist CLAUDE.md across nightly sync#6
lunarthegrey merged 1 commit into
mainfrom
fix-claude-md-persistence

Conversation

@lunarthegrey

@lunarthegrey lunarthegrey commented Apr 24, 2026

Copy link
Copy Markdown

Summary

  • New .github/CLAUDE.coolify.md holds the Coolify-aware CLAUDE.md content (same pattern as .github/README.coolify.md from Move README.coolify.md into .github/ so daily sync preserves it #2).
  • patch.py overwrites root-level CLAUDE.md from it on each run.
  • Small refactor: overwrite_readme() becomes _overwrite_from_github(src, dst) since we now have two files on the same pattern.
  • test-patch.sh asserts CLAUDE.md gets the Coolify content post-patch.

Why

Same root cause as #2. The nightly sync does git reset --hard upstream/main before restoring .github/ from backup. Anything at repo root that upstream also ships — like CLAUDE.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.sh passes (new CLAUDE.md assertion green, idempotency clean)
  • shellcheck .github/scripts/test-patch.sh clean
  • After merge + sync: confirm CLAUDE.md on main starts with # CLAUDE.md and contains "Coolify" (not upstream's "Caddy (reverse proxy)")

🤖 Generated with Claude Code

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>
@lunarthegrey lunarthegrey merged commit f2cddf2 into main Apr 24, 2026
2 checks passed
@lunarthegrey lunarthegrey deleted the fix-claude-md-persistence branch April 24, 2026 11:21
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