chore: exclude platform-bible-react dist from Claude Code searches#2167
Open
chore: exclude platform-bible-react dist from Claude Code searches#2167
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds .claude/settings.json with a permissions.deny rule so Claude Code agents cannot read or search lib/platform-bible-react/dist/. Also updates .gitignore to track settings.json while keeping the rest of .claude/ local-only. Co-Authored-By: Claude Sonnet 4.6 <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.
What this does
Adds
.claude/settings.jsonwith apermissions.denyrule that blocks Claude Code agents from reading or searchinglib/platform-bible-react/dist/.Also updates
.gitignoreto track.claude/settings.jsonwhile keeping the rest of.claude/(personal settings, skills, etc.) local-only as before.Why
lib/platform-bible-react/dist/has to stay committed — I understand it can't go in.gitignorebecause downstream consumers depend on it being in the repo. That's fine and correct.The problem is that when Claude Code agents do any kind of broad search — looking for a component, tracing an export, exploring the API surface — they naturally find and read the compiled dist files. Since dist is a bundle of the source, the agent ends up consuming a large amount of tokens re-reading content it already found in the actual source files, and it can get confused trying to reconcile compiled output with the original TypeScript. It's a noise problem, not a correctness problem.
Claude Code's
permissions.denysolves this at the tool level: it prevents theRead,Grep, andGlobtools from ever surfacing files under that path.I defer to you
I don't expect anyone to have asked for this or to be immediately sold on it. Adding an AI tooling config file to the repo is a real decision that deserves scrutiny. Please push back if this doesn't fit how the team wants to manage the project. I'll happily close it.
A few things I want to be transparent about:
.claude/settings.jsonis the shared Claude Code settings file (per Anthropic's documentation). Personal Claude Code settings live in.claude/settings.local.json, which was already gitignored. This PR only commits the shared part.Testing
Testing involved trying to reproduce the problem this is meant to solve: confirming that without the deny rule, Claude agents do find and read the dist files, and that after adding it, they can't.
Without the deny rule (initial state):
Glob("lib/platform-bible-react/dist/**/*")returned all 5 dist files.Glob("**/*.d.ts")includedlib/platform-bible-react/dist/index.d.tsalongside legitimate source.d.tsfiles.After adding
.claude/settings.json:Glob("lib/platform-bible-react/dist/**/*")→No files foundGreptargeting the dist directory →Permission to read .../lib/platform-bible-react/dist has been denied.The deny rule took effect immediately within the same session (no restart needed). Both the path-specific search and a broad
*.d.tssearch confirmed the dist files are fully excluded.🤖 Co-authored with Claude Code
This change is