cd /news/ai-agents/keeping-agents-md-claude-md-and-curs… · home › topics › ai-agents › article
[ARTICLE · art-177028] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Keeping AGENTS.md, CLAUDE.md, and Cursor Rules in Sync

A developer documented how coding agents load repository instruction files, showing that Codex applies a 32 KiB cumulative cap across the entire AGENTS.md directory chain, Claude Code expands @path imports in full at session start, and Cursor loads .mdc rules conditionally via globs. The writeup recommends treating AGENTS.md as the single source of truth, importing it from CLAUDE.md, and pushing situational workflows into glob-scoped rules or SKILL.md files to avoid silent truncation and token bloat.

recommendation

Consolidate repo instructions into one AGENTS.md under ~150 lines, import it from CLAUDE.md, and move path-specific rules into glob-scoped .mdc or SKILL.md files to stay under Codex's 32 KiB chain cap.

more in playbook: Working with AI coding agents
by read2 min views16 publishedNov 27, 2026

If you run Claude Code in the terminal while someone else opens the same repository in Cursor or Codex, instruction files drift apart fast.

Copy-pasting a 400-line style guide into every tool's config file doesn't just double your maintenance. Depending on the client, it can silently truncate nested package rules or add thousands of static tokens to every turn.

Here is how each instruction format actually loads, three traps worth avoiding, and a minimal layout that keeps one source of truth.

AGENTS.md`` CLAUDE.md``@AGENTS.md import plus Claude-only notes.cursor/rules/*.mdc`` globs rules that shouldn't load globallySKILL.md

File Read by behavior & budget
AGENTS.md Codex, Cursor, Windsurf, Cline Loaded along directory chain ( root ->cwd );32 KiB cumulative cap in Codex
CLAUDE.md Claude Code Loaded in full at session start ( @path imports expand immediately)
.cursor/rules/*.mdc Cursor ( v0.45+ ) Loaded conditionally when active files match YAML globs
SKILL.md Claude Code, Codex, Goose Progressive disclosure: only name +description (~50 tokens) load until triggered

OpenAI Codex walks from ~/.codex/AGENTS.md to your repo root AGENTS.md and down to your current working directory.

By default, project_doc_max_bytes is 32,768 bytes (32 KiB) across that entire chain, not per file. If your root AGENTS.md is a 28 KiB architecture essay, a package-specific packages/api/AGENTS.md deeper in the tree gets truncated or dropped without a loud warning.

Keeping root AGENTS.md under ~150 lines of concrete build, lint, and test commands leaves plenty of room for subdirectory overrides.

@path imports in A common assumption in Claude Code is that splitting a large CLAUDE.md into imports like this keeps the context window lean:

@docs/architecture.md
@docs/coding-standards.md

It helps human readability, but it does not defer . Claude Code expands @path imports into the session context at launch.

If a rule only applies to database migrations or API routes, put it in path-scoped rules (.claude/rules/*.md or .cursor/rules/*.mdc) or an on-demand SKILL.md instead of importing it into root CLAUDE.md.

Agent Skills validate YAML frontmatter strictly:

name: 1–64 characters, lowercase alphanumeric and single hyphens only (^[a-z0-9]+(-[a-z0-9]+)*$), and it db-check/SKILL.md -> name: db-check) description: 1–1,024 characters stating both If name has uppercase letters, underscores, or doesn't match the folder name, the agent skips it silently.

Instead of hand-editing the same rules in three places:


@AGENTS.md

## Claude Code Notes
- Run `/clear` between unrelated tasks to avoid re-caching long threads.

CLAUDE.local.md (gitignored).src/components/**/*.tsx). Most instruction drift comes from treating AGENTS.md and CLAUDE.md as separate documents. Pick AGENTS.md as the base, import it from CLAUDE.md, and push situational workflows out to skills or glob-scoped rules.

If you want to check byte budgets or generate the boilerplate files side by side, there's a small browser-based linter and converter and a set of MIT starter templates on GitHub.

Related: Why Your MCP Config Works in Cursor but Not in VS Code

How are you organizing repo instructions when teammates use different coding agents?

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/keeping-agents-md-cl…] indexed:0 read:2min 2026-11-27 · —