Free rules / Check a repo
Which agent files does this repo load? Free check
Copy one script, paste it in a terminal inside any repo, and it prints every rules, instructions and MCP file there that Cursor, Claude Code, Codex, GitHub Copilot, Windsurf or Gemini CLI can load. It also flags three silent failures. It only reads: it writes nothing, installs nothing and makes no network calls.
Mac, Linux or Git Bash
Open a terminal in the repo folder (cd into it), paste, and press Enter. It uses find, sort, head and wc, and works in bash and zsh.
list=$(find . \( -name .git -o -name node_modules \) -prune -o -type f \( \
-path './.cursor/rules/*' -o -path './.cursorrules' -o -path './.cursor/mcp.json' \
-o -name CLAUDE.md -o -name CLAUDE.local.md -o -path './.claude/settings.json' -o -path './.claude/settings.local.json' -o -path './.claude/rules/*' -o -path './.claude/commands/*' \
-o -name AGENTS.md -o -name AGENTS.override.md \
-o -path './.github/copilot-instructions.md' -o -path './.github/instructions/*.instructions.md' \
-o -path './.windsurf/rules/*' -o -path './.windsurfrules' -o -path './.devin/rules/*' -o -path './.devin/mcp_config.json' \
-o -name GEMINI.md -o -path './.mcp.json' -o -path './.vscode/mcp.json' \) -print | sort)
if [ -z "$list" ]; then echo "No agent files found in $(pwd)"; else
echo "Files an agent tool may auto-load here:"
printf '%s\n' "$list" | while IFS= read -r p; do
case "$p" in
./.cursor/mcp.json|./.mcp.json|./.vscode/mcp.json|./.devin/mcp_config.json) t="mcp";;
./.cursor/*|./.cursorrules) t="cursor";; ./.claude/*|*/CLAUDE*.md) t="claude";;
*/AGENTS*.md) t="agents";; ./.github/*) t="copilot";; ./.windsurf*|./.devin/*) t="windsurf";; *) t="gemini";;
esac
printf '%-9s %s\n' "$t" "$p"
done
warn=$(printf '%s\n' "$list" | while IFS= read -r p; do
case "$p" in ./.cursor/rules/*.md) echo "FLAG $p: Cursor ignores .md files in .cursor/rules (rules must be .mdc)";; esac
case "$p" in ./.cursor/rules/*.mdc) [ "$(head -c 3 "$p")" = "---" ] || echo "FLAG $p: .mdc has no frontmatter (no leading ---)";; esac
case "$p" in */AGENTS.md|*/AGENTS.override.md) n=$(wc -c < "$p"); [ "$n" -gt 32768 ] && echo "FLAG $p: $n bytes, over Codex's 32 KiB default (project_doc_max_bytes)";; esac
done)
echo; if [ -n "$warn" ]; then printf '%s\n' "$warn"; else echo "No silent-failure flags."; fi
echo; echo "If you already opened this repo with an agent, see what to rotate: tryshipcheck.com/guides/opened-malicious-repo-what-to-rotate"
fi
Windows PowerShell
- Open the repo folder in File Explorer.
- Click the address bar at the top, type
powershell, and press Enter. A PowerShell window opens in that folder. - Click COPY below, paste into the PowerShell window (right-click pastes), and press Enter.
$root = (Get-Location).Path
function Walk($d) { Get-ChildItem -LiteralPath $d -Force | ForEach-Object {
if ($_.PSIsContainer) { if ($_.Name -notin '.git','node_modules' -and -not ($_.Attributes -band [IO.FileAttributes]::ReparsePoint)) { Walk $_.FullName } } else { $_ } } }
$pat = @(
@('cursor','^\.cursor/rules/'),@('cursor','^\.cursorrules$'),@('mcp','^\.cursor/mcp\.json$'),
@('claude','(^|/)CLAUDE(\.local)?\.md$'),@('claude','^\.claude/(settings(\.local)?\.json|rules/|commands/)'),
@('agents','(^|/)AGENTS(\.override)?\.md$'),
@('copilot','^\.github/copilot-instructions\.md$'),@('copilot','^\.github/instructions/.*\.instructions\.md$'),
@('windsurf','^\.windsurf/rules/'),@('windsurf','^\.windsurfrules$'),@('windsurf','^\.devin/rules/'),@('mcp','^\.devin/mcp_config\.json$'),
@('gemini','(^|/)GEMINI\.md$'),@('mcp','^\.mcp\.json$'),@('mcp','^\.vscode/mcp\.json$'))
$hits = foreach ($f in Walk $root) {
$rel = $f.FullName.Substring($root.Length).TrimStart('\','/') -replace '\\','/'
foreach ($p in $pat) { if ($rel -match $p[1]) { [pscustomobject]@{ Tool = $p[0]; Path = $rel; File = $f }; break } } }
if (-not $hits) { "No agent files found in $root" } else {
"Files an agent tool may auto-load here:"
$hits | Sort-Object Path | ForEach-Object { '{0,-9} ./{1}' -f $_.Tool, $_.Path }
$flags = foreach ($h in $hits) {
if ($h.Path -match '^\.cursor/rules/.*\.md$') { "FLAG ./$($h.Path): Cursor ignores .md files in .cursor/rules (rules must be .mdc)" }
if ($h.Path -match '^\.cursor/rules/.*\.mdc$' -and -not [IO.File]::ReadAllText($h.File.FullName).StartsWith('---')) { "FLAG ./$($h.Path): .mdc has no frontmatter (no leading ---)" }
if ($h.Path -match '(^|/)AGENTS(\.override)?\.md$' -and $h.File.Length -gt 32768) { "FLAG ./$($h.Path): $($h.File.Length) bytes, over Codex's 32 KiB default (project_doc_max_bytes)" } }
""; if ($flags) { $flags } else { "No silent-failure flags." }
""; "If you already opened this repo with an agent, see what to rotate: tryshipcheck.com/guides/opened-malicious-repo-what-to-rotate"
}
Both scripts skip .git and node_modules, and print No agent files found if the repo has none. Sample output:
Files an agent tool may auto-load here:
cursor ./.cursor/rules/api.mdc
cursor ./.cursor/rules/style.md
mcp ./.mcp.json
agents ./AGENTS.md
FLAG ./.cursor/rules/style.md: Cursor ignores .md files in .cursor/rules (rules must be .mdc)
If you already opened this repo with an agent, see what to rotate: tryshipcheck.com/guides/opened-malicious-repo-what-to-rotateWhich files it lists, by tool
Every path below comes from that tool's own docs, checked on Nov 28, 2026. The left column of the output (cursor, claude, agents, copilot, windsurf, gemini, mcp) is a label for the file's home tool. Several tools read AGENTS.md and CLAUDE.md, so a file can matter to more than the tool in its label.
| Tool | Instruction and rules files | MCP config |
|---|---|---|
| Cursor | .cursor/rules/**/*.mdc (must be .mdc), legacy .cursorrules in the root, AGENTS.md in the root and subfolders, and a root CLAUDE.md. | .cursor/mcp.json |
| Claude Code | CLAUDE.md or .claude/CLAUDE.md, CLAUDE.local.md, CLAUDE.md files in subfolders (loaded when Claude touches a file there), and .claude/rules/*.md. Also .claude/settings.json and .claude/settings.local.json (the docs list hooks and permissions there) and .claude/commands. | .mcp.json in the project root |
| OpenAI Codex | AGENTS.override.md or AGENTS.md in each folder from the repo root down to where you run it, one file per folder. | Not covered by this script. |
| GitHub Copilot | .github/copilot-instructions.md, .github/instructions/*.instructions.md, AGENTS.md anywhere in the repo, or one root CLAUDE.md or GEMINI.md. | Workspace-root .mcp.json. .vscode/mcp.json is the format of VS Code's older Local harness, which the docs say is deprecated and will be removed in February 2027. |
| Windsurf (now Devin Desktop) | .devin/rules/*.md, plus the legacy .windsurf/rules/*.md and .windsurfrules, which are still imported by default. It also reads AGENTS.md. | .devin/mcp_config.json |
| Gemini CLI | GEMINI.md in the workspace and, when a tool touches a folder, in that folder. | Not covered by this script. |
Want the side-by-side comparison, including which tools read AGENTS.md and the size limits the docs state? See Which rules file does each AI tool read?
The three silent failures it flags
Each of these fails without an error message, so the rule looks present and isn't doing what you expect.
A plain .md file in .cursor/rules
Cursor's docs say project rules must use the .mdc extension, and a plain .md file in .cursor/rules is ignored by the rules system. The fix is to rename it to .mdc and add frontmatter, or move the text into AGENTS.md.
An .mdc file with no frontmatter
Cursor's rules table says a rule with alwaysApply false and no description or globs is included only when you @-mention it. A file with no --- block at the top sets none of those fields, so don't expect it to apply on its own. The docs don't spell out the default for a file with no frontmatter, so treat this flag as “check it”. To always apply a rule, start the file with alwaysApply: true between two --- lines.
AGENTS.md over 32 KiB
Codex stops adding AGENTS.md files once the combined size reaches project_doc_max_bytes, which is 32 KiB (32,768 bytes) by default. The script flags any single AGENTS.md or AGENTS.override.md over 32,768 bytes. The limit is combined across the folder path from the repo root to where you run Codex, so several smaller files can hit it too. Raise the limit in ~/.codex/config.toml or split the file across nested folders.
If it lists files you didn't write
Instruction files, hook settings and MCP configs in a cloned repo can tell your agent to run commands or start servers. Read them before you open the folder with an agent. The script prints one line at the end for the case where you already did:
If you already opened this repo with an agent, see what to rotate: tryshipcheck.com/guides/opened-malicious-repo-what-to-rotateWhat it doesn't do
- It doesn't say whether a file is safe. It only tells you the file exists and which tool may load it. Read the files yourself.
- It checks the repo folder only. Your own files in your home folder (such as
~/.claude/CLAUDE.mdor~/.codex/AGENTS.md) and settings stored in an app are not listed. - It doesn't cover every tool's MCP setup. Codex and Gemini CLI MCP settings are not listed.
- The only file content it reads is the first three characters of each
.mdcfile and the size of eachAGENTS.md. - Tools change often. If a tool adds a new file location, this list will lag until the page is re-checked.
Checked against the docs on Nov 28, 2026
Paths, the .mdc requirement and the 32 KiB default were confirmed on Nov 28, 2026 on these official pages:
- Cursor: Rules
- Cursor: Rules help (.cursorrules, CLAUDE.md)
- Cursor: MCP
- Claude Code: How Claude remembers your project
- Claude Code: Settings files
- Claude Code: MCP
- OpenAI Codex: Custom instructions with AGENTS.md
- GitHub Copilot: Adding repository custom instructions
- VS Code: MCP configuration reference
- Windsurf (Devin Desktop): Customizations
- Gemini CLI: GEMINI.md files
Building your own MCP server instead of just configuring one? The MCP Server Cartridge ($29) is a TypeScript starter on the official SDK with tests and agent rules for adding tools safely.
No rules file yet? Generate one for your tool and stack (free, in your browser, no AI). More free pages: all free rules files · which file each tool reads.