Answer: Add `Read` deny rules in `permissions.deny` to block Claude from opening checked-in generated and vendored files; the example blocks build artifacts and a vendored SDK with patterns like `Read(./**/*.generated.*)` and `Read(./**/vendor/**/*)`. Where you put the rules determines who they apply to: `.claude/settings.json` for everyone in the repository, `.claude/settings.local.json` for yourself only, or managed settings for every session. Status: Confirmed Entry: tool/claude-code/permissions-and-security/block-reads-generated-vendored-code Revision: 1 Digest: sha256:b5d0a7e5f40e75b7 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:04:29Z Last changed: 2026-11-13T03:04:29Z Last verified: 2026-11-20T12:21:37Z Next check: 2026-11-21T12:21:37Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of mechanism | Read | [1] | 2026-11-20 generated code pattern | Read(./**/*.generated.*) | [1] | 2026-11-20 vendored code pattern | Read(./**/vendor/**/*) | [1] | 2026-11-20 repository-wide settings file | .claude/settings.json | [1] | 2026-11-20 personal settings file | .claude/settings.local.json | [1] | 2026-11-20 enforced settings | managed settings | [1] | 2026-11-20 Sources: [1] Anthropic. "Set up Claude Code in a monorepo or large codebase". https://code.claude.com/docs/en/large-codebases.md Role: primary. Accessed: 2026-11-20T12:21:37Z Quote: "add `Read` deny rules in `permissions.deny` to block Claude from opening those files" (Supports: mechanism) Quote: ""Read(./**/*.generated.*)"" (Supports: generated code pattern) Quote: ""Read(./**/vendor/**/*)"" (Supports: vendored code pattern) Quote: "commit the rules to `.claude/settings.json`" (Supports: repository-wide settings file) Quote: "use `.claude/settings.local.json` at the repository root" (Supports: personal settings file) Quote: "set the rules in [managed settings](https://code.claude.com/docs/en/managed-settings.md), which user and project settings cannot override" (Supports: enforced settings) Published: 2026-11-20T02:54:02Z Snapshot SHA-256: f5d723ccd1962a060db8f6b5991b4e98d8d0623bfbd75ff9dab2d1d62870d8d9 (captured 2026-11-20T12:21:36Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:21:37Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:21:37Z Last attempt: 2026-11-20T12:21:37Z Notes and limitations: Extracted automatically from a single official source (section "Block reads of generated and vendored code"). Related: https://latestn.com/tool/claude-code/permissions-and-security/built-in-security-features What built-in security features does Claude Code have? https://latestn.com/tool/claude-code/permissions-and-security/change-permission-mode How do I change the permission mode for a Claude Code SDK agent? https://latestn.com/tool/claude-code/permissions-and-security/change-permission-mode-2 How do I change the permission mode in Claude Code? https://latestn.com/tool/claude-code/permissions-and-security/aws-credentials-sigv4-api-key How do I authenticate Claude Code with AWS credentials using SigV4 or a workspace API key? https://latestn.com/tool/claude-code/permissions-and-security/block-on-hook-failure How do I block a tool call in Claude Code when a hook callback fails? https://latestn.com/tool/claude-code/permissions-and-security/block-protected-file-edits How do I block Claude Code from editing protected files with a hook? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:04:29Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/permissions-and-security/block-reads-generated-vendored-code/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/permissions-and-security/block-reads-generated-vendored-code POST: https://latestn.com/dispute/tool/claude-code/permissions-and-security/block-reads-generated-vendored-code with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/permissions-and-security/block-reads-generated-vendored-code?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I block reads of generated and vendored code in Claude Code? Revision 1, last verified 2026-11-20T12:21:37Z. https://latestn.com/tool/claude-code/permissions-and-security/block-reads-generated-vendored-code (accessed 2026-11-21T09:57:03Z). @misc{LatestN_tool_claude_code_permissions_and_security_block_reads_generated_vendored_code_r1, title = {How do I block reads of generated and vendored code in Claude Code?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/permissions-and-security/block-reads-generated-vendored-code}}, note = {Revision 1; digest sha256:b5d0a7e5f40e75b7; last verified 2026-11-20T12:21:37Z; accessed 2026-11-21T09:57:03Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/permissions-and-security/block-reads-generated-vendored-code