Why AI Centaurs need Git excludesFile aka why global .gitignore files are useful

Before we dive into the problem, let's set the stage for all the terms that might be new to someone.
AI Centaur
Cory Doctorow describes Centaurs as:
The idea of "centaurs" comes from automation theorists: it describes a system where a human and a machine collaborate to do more than either one could do on their own.
I have recently heard this also referred to as an "AI Native," no doubt a play on "Digital Native" — but Centaurs are a better term in isolation and paired with Reverse-Centaur (see the link above for this).
AGENTS files
So you may work with a centaur, or you may be one yourself — and if you are in that situation, you have seen the increasing AGENTS.md format slowly creeping up into a variety of your code bases. Some tools have different filenames, like Warp (which I highly recommend) uses a WARP.md, but I am going to call them AGENTS files for this post.
A key detail about AGENTS files is that while there is a standard name, there is no standard for the content — just recommendations that your favorite AI agent/tool should use.
Problem
In theory, teams could commit their AGENTS file to the repo, and everyone in the team would benefit from a single file. However, this seems to fail in two ways:
Most teams I have worked with do not have a standard AI tool plan, and each developer is using their own favorite (some maybe not even using a tool). This means each tool will want to tweak this differently or could hallucinate in odd ways by getting context it does not expect or understand. In theory, this should not be an issue, especially if you handcraft your AGENTS file — but theory and practice don't always align... especially with LLMs.
In some cases, different team members will want the AI agent they work with to operate in a way that is slightly different from the rest of the team. Warp handles this nicely with Rules, but many tools don't — and now you have each team member either compromising or having battles over whose file is correct. In these situations, the outcome is often not committing the AGENTS file, and when you have a lot of codebase to flip through, this can lead to situations where one forgets and accidentally commits it or where you need to update every
.gitignoreall the time.
Recently, though, I found core.excludesFile, which is a setting in Git that allows you to set a specific file to use in conjunction with the standard .gitignore in your project. Why this is useful is that you can set this to point to a file in your home directory and set the global config for Git... which means every Git project will use that. This will let you (or an AI Centaur you know) put the AGENTS file in say, ~/.config/.gitignore and then use the command:
git config --global core.excludesFile ~/.config/.gitignore
...and problem solved!
Maybe you don't need the config?
While writing this up, I learned that you don't even need to set this, as there is already a default value of $XDG_CONFIG_HOME/git/ignore set. If (like I think many people) you haven't set the XDG_CONFIG_HOME environment variable, it falls back to $HOME/.config/git/ignore.
Bonus trick
Also from the documentation, I learned another trick:
Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user’s workflow) should go into the
$GIT_DIR/info/excludefile.
($GIT_DIR`` is the .git` folder in the root of your project — normally. Git allows you to customize everything.)