AI CodeOps

CODEOWNERS

CODEOWNERS is a file naming who is responsible for each part of a repository. Where it lives, how its patterns match, and how it applies to AI changes.

CODEOWNERS is a file in a repository that names the people or teams responsible for its files and folders. When a pull request changes files someone owns, the hosting provider asks them to review it. The details below are from GitHub's documentation; GitLab supports a similar file.

What it is

On GitHub, the file can sit in .github/, the repository root or docs/. Each line is a path pattern followed by one or more owners:

*.js            @org/frontend
/infra/         @org/platform
/docs/          [email protected]

Patterns follow most .gitignore rules. The last matching line wins, so put the broad patterns first. Owners need write access to the repository, and the file must be under 3 MB or it isn't loaded. GitHub reads the CODEOWNERS file on the pull request's base branch.

Owners are requested as reviewers automatically. To make their approval required, turn on code owner approval in branch protection or a ruleset.

Why it matters

When agents write a growing share of changes, knowing who must look at a change to /infra/ or the payment code matters more. CODEOWNERS puts that knowledge in the repository, where every pull request picks it up.

In AI CodeOps

AI CodeOps doesn't parse CODEOWNERS. A session's change opens as an ordinary pull request on your provider, so the provider requests reviews from the owners of the files it touches.

Frequently asked questions

Which CODEOWNERS file wins if there are several?

On GitHub, the first one found is used, looking in .github/ first, then the repository root, then docs/.

Does AI CodeOps read my CODEOWNERS file?

No. Your provider reads it when the session's pull request opens and requests reviews from the owners, as for any pull request.