Skip to content

Update .gitignore to include Claude AI config files#5395

Closed
miqui wants to merge 1 commit into
mainfrom
ignore-claude-config
Closed

Update .gitignore to include Claude AI config files#5395
miqui wants to merge 1 commit into
mainfrom
ignore-claude-config

Conversation

@miqui

@miqui miqui commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Add rules to ignore Claude AI agent configuration files.

The config can define hooks that could be malicious.

  • no schema changes are needed for this pull request

Add rules to ignore Claude AI agent configuration files.

The config can define hooks that could be malicious.
@miqui miqui requested review from a team as code owners June 17, 2026 18:02
@miqui miqui requested review from ralfhandl and removed request for a team June 17, 2026 18:04
@lornajane

Copy link
Copy Markdown
Contributor

I suggest that we don't try to go adding exclusions for every file pattern used by every tool out there. Please use a global gitignore config on your own system for files generated by your IDE or other tools that should be ignored.

@lornajane lornajane closed this Jun 17, 2026
@lornajane

Copy link
Copy Markdown
Contributor

(was closing it a bit harsh? Re-open if you want to keep the discussion going!)

@miqui miqui reopened this Jun 18, 2026
@miqui

miqui commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@lornajane

I suggest that we don't try to go adding exclusions for every file pattern used by every tool out there. Please use a global gitignore config on your own system for files generated by your IDE or other tools that should be ignored.

This assumes a user who clones the repo will follow the practice of managing their own .gitignore. As you know, not always the case. This change is particularly important because I am trying to avoid someone enabling potentially dangerous hooks. This goes beyond IDE settings, etc...etc.

(AI Search) below:
Why AI hooks are risky
Security research (e.g., “IDEsaster” and “TrustFall”) has shown that AI coding tools and CLIs can be driven to execute arbitrary commands or exfiltrate data via prompt injection plus auto-approved tool/hook execution.

Malicious repos and config files (CLAUDE.md, .claude/settings.json, .github/hooks/*.json, Gemini/Copilot hook configs, etc.) can plant or mutate hooks so they run with no or minimal user interaction.

Once an AI tool has write access to your repo and can trigger hooks, it becomes part of your supply chain and CI/CD attack surface, not just “autocomplete in the terminal.”

@lornajane

Copy link
Copy Markdown
Contributor

I think we're talking about two different things here. The .gitignore file is useful for avoiding mistakes with adding files such as built assets, log files that should not be committed to the repo, whatever tools people use they can configure their own ignores. Gitignore doesn't prevent matching files from being added, it just stops it from happening without clear intent. I don't think this change is going to protect us against malicious files in our repository that will cause an agent to run riot - our limited number of careful committers and diligent reviewers are the guard against that.

@miqui miqui closed this Jun 18, 2026
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.

2 participants