Improve .gitignore and CLAUDE.md context files#139
Open
MatiasFernandez wants to merge 4 commits into
Open
Conversation
…oject-shared rules and settings
…to context pollution by applying progressive disclosure
…ts to circumvent a current issue with un-awaited promises. I added this because while testing the CLAUDE.md changes with a real bug fix the agent stumbled upon this unpredictable behavior
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
Two independent changes bundled together, both aimed at making Claude Code sessions in this repo more effective:
1.
.gitignore: allow committing shared Claude Code configPreviously the entire
.claude/directory was gitignored, which meant any Claude Code config could only ever be a personal, local artifact — there was no way to share rules, settings, or skills with the team via source control.Per the official Claude Code docs (settings, memory, worktrees, and
.claude/directory reference), only three things are meant to stay personal/machine-local:CLAUDE.local.md.claude/settings.local.json.claude/worktrees/Everything else under
.claude/(settings.json,rules/,skills/,commands/,agents/,output-styles/) is intended to be committed and shared with the team, the same wayCLAUDE.mditself is. This PR removes the blanket.claude/ignore and replaces it with ignore rules for just those three personal/local paths, unblocking the CLAUDE.md restructuring below..claude/should be committed by default. Only commit content there once it's an established, team-agreed setting, tool, or practice — experimental rules, skills, or commands you're still trying out should stay uncommitted (or go in one of the personal/local paths above) until the team has actually agreed to adopt them.2. CLAUDE.md: apply progressive disclosure to avoid context pollution
The root
CLAUDE.mdhad grown into a full architecture reference — a per-subsystem breakdown of the client, server, and mcp-server workspaces, GCI/native library notes, and detailed test-authoring conventions — all loaded into every agent's context on every session, whether or not the task touched those areas.The restructuring keeps
CLAUDE.mdas a lean top-level map (commands, high-level workspace layout, a short pointer to where deeper detail lives) and moves subsystem-specific detail out into scoped docs that only load when relevant:.claude/rules/class-sync.md,gci.md,mcp.md— each scoped viapaths:frontmatter to the files it's actually about, so it only enters context when those files are in play.client/src/__tests__/CLAUDE.md— test-authoring conventions, auto-loaded by Claude Code when working under that directory.The mindset: an agent's context window is a scarce, shared resource, and instructions that aren't relevant to the current task are pure noise that crowds out the things that are. Rather than trying to write one document that anticipates every task, structure context so the right slice loads on demand for the task at hand, and let the top-level file stay a map rather than the territory. This is guided by:
A follow-up commit (
809754e) adds a note to the newclient/src/__tests__/CLAUDE.mdabout an unawaited-promise gotcha insystemBrowser.ts, discovered while dogfooding these changes against a real bug fix — it documents current (buggy) behavior tests need to account for, not a pattern to imitate.Test plan
CLAUDE.mdloads lean (no GCI/class-sync/MCP detail) unless the relevant files are touchedclient/src/gciLibrary.ts/client/src/sync/**/mcp-server/**and confirm the matching.claude/rules/*.mdauto-loadsclient/src/__tests__/**and confirm itsCLAUDE.mdauto-loadsgit statusshows.claude/settings.local.json(if present) as ignored, and.claude/rules/*.mdas tracked