Skip to content

feat(install): manage global Claude Code instructions#30

Merged
sha1n merged 1 commit into
masterfrom
claude-global-instructions
Jun 23, 2026
Merged

feat(install): manage global Claude Code instructions#30
sha1n merged 1 commit into
masterfrom
claude-global-instructions

Conversation

@sha1n

@sha1n sha1n commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

Version-controls the global Claude Code instructions and wires them into the install flow.

  • claude/CLAUDE.md (new) — the global Claude Code instructions, now tracked in the repo.
  • install.sh — new install_claude_global() symlinks ~/.claude/CLAUDE.mdclaude/CLAUDE.md, called from the main install flow.
    • If ~/.claude/CLAUDE.md already exists, it prompts [n/Y] before replacing it (default Yes: deletes the existing file and links; No keeps the user's file untouched).
    • An existing correct symlink is left untouched (idempotent, no prompt).
  • CLAUDE.md — documents the new claude/ directory and install behavior.

Behavior notes

  • update_profile (git pull + submodule update) does not touch ~/.claude/CLAUDE.md; wiring happens only when ./install.sh is run.

Tests

Added sanity tests covering every branch (TDD, RED first):

  • test_claude_global_linked — fresh install creates the symlink
  • test_claude_global_idempotent — re-run against a correct link is a silent no-op
  • test_claude_global_keep_existing — existing file + n keeps it untouched
  • test_claude_global_replace_existing — existing file + Y replaces with the link
  • test_claude_global_default_replaces — existing file + Enter defaults to replace

All 22 tests pass locally (make test).

Add claude/CLAUDE.md to version-control the global Claude Code
instructions, and wire install.sh to symlink ~/.claude/CLAUDE.md to it.

If ~/.claude/CLAUDE.md already exists, install prompts [n/Y] before
replacing it (default Yes); an existing correct link is left untouched.

Covered by sanity tests: fresh link, idempotent re-run, keep-on-decline,
replace-on-accept, and replace-on-default.
@sha1n
sha1n merged commit f823a89 into master Jun 23, 2026
2 checks passed
@sha1n
sha1n deleted the claude-global-instructions branch June 23, 2026 12:22
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