Back to Resources
Agent Instruction Architecture & Sync GuideLast Updated: Published August 2, 2026 • Updated September 19, 2026

Claude Skills vs Cursor Rules, CLAUDE.md, and AGENTS.md

Cursor Rules, CLAUDE.md, and AGENTS.md provide persistent in-repo context to specific editors and agents, whereas Claude Skills package modular, on-demand workflows into portable SKILL.md folders. Using persistent files for reusable processes burns 1,800 to 2,500 tokens on every message turn, while lazy-loaded skills keep context clean and follow you across Cursor, Claude Code, Codex, and Google Antigravity.

Claude Skill
Cursor Rule
AGENTS.md & CLAUDE.md

A comprehensive comparison of Cursor Rules, AGENTS.md, CLAUDE.md, and Claude Skills, with token economics, execution flows, and migration rules.

The Short Answer: Rules Are Local Context, Skills Are Portable Workflows

Cursor Rules, CLAUDE.md, and AGENTS.md provide persistent, repository-scoped context to specific coding assistants, while Claude Skills package reusable agent workflows into portable directories governed by a standardized SKILL.md entrypoint. Search intent for cursor rules vs claude skills and claude.md vs agents.md reflects a fundamental architectural problem: modern developers work across multiple AI tools, and burying procedural workflows inside static repository files leads to context bloat, duplicate rules, and painful synchronization drift.

Cursor Rules guide Cursor's Agent and Composer inside a specific codebase or file pattern. CLAUDE.md provides Claude-specific context inside project checkouts. AGENTS.md acts as a shared, tool-neutral instruction contract across automated coding agents. Claude Skills, by contrast, are self-contained workflow packages that travel across Claude Code, OpenAI Codex, Google Antigravity, and web chat runtimes without remaining trapped in a single repository.

Use in-repo instruction files to teach models where they are working; use Claude Skills to define how recurring engineering workflows should be executed.

The 4-Way Agent Instruction Hierarchy: Format and Scope at a Glance

Both repository-level instructions and modular skills exist because large language models do not retain cross-session memory. However, attempting to solve all agent steerability through one monolithic file inevitably breaks down. The table below maps the four primary instruction layers across modern AI coding stacks:

LayerFile Format & PathPrimary EcosystemLoading TriggerBest ContentAvoid Putting Here
Claude SkillSKILL.md in skill folderClaude Code, Codex, Antigravity, ChatGPTOn-demand (semantic match or slash command)Portable checklists, PR review rubrics, release guidesTemporary repo trivia, secrets, machine-local ports
Cursor Rule.cursor/rules/*.mdcCursor IDEGlob match, always-on, or agent-requestedFile patterns, Tailwind rules, framework constraintsCross-tool workflows needed outside Cursor
CLAUDE.mdCLAUDE.md in repo rootClaude Code CLI, Claude Web ProjectsEagerly loaded on session startupClaude-specific preferences, test runners, safety rulesLengthy multi-step processes needed by Codex or Cursor
AGENTS.mdAGENTS.md in repo rootCodex, Antigravity, Cursor, Neutral AgentsTask dispatch or environment launchShared build commands, architecture limits, handoff criteriaSingle-vendor instructions or duplicate skill bodies

How Do AI Coding Agents Parse and Execute Instruction Files?

Different AI coding assistants treat instruction files with distinct precedence orders, directory lookups, and token budget allocations. Understanding how Claude Code, OpenAI Codex, Cursor, Google Antigravity, and Windsurf parse these files is essential for maintaining an operational multi-agent workflow.

According to the official Cursor Rules documentation: "Project rules live in the .cursor/rules directory, are version-controlled, and can be scoped to a codebase or specific file patterns." Cursor reads these .mdc files along with optional root AGENTS.md and legacy .cursorrules. Meanwhile, the Anthropic Claude Code documentation specifies that Claude Code inspects CLAUDE.md in the repository root upon session startup and looks up modular skills within ~/.claude/skills/<skill>/SKILL.md.

Coding Assistant / RuntimeDefault Repo FileLoading MechanismSkill Packaging LocationActive Context Impact
Claude Code (CLI)CLAUDE.mdEagerly prepended to session context~/.claude/skills/<skill>/SKILL.mdHigh for full repo file; low (35-50 tokens) for skills
OpenAI CodexAGENTS.mdLoaded on task execution or dispatch~/.codex/skills/<skill>/SKILL.mdInjected into system instructions
Cursor IDE.cursor/rules/*.mdc / AGENTS.mdGlob match or semantic file activation.cursor/rules/Scoped to matching filetypes
Google AntigravityAGENTS.md / antigravity.yamlSubagent role dispatch and planning mode.gemini/skills/<name>/SKILL.mdLazy-loaded on explicit agent invocation
Windsurf Cascade.windsurfrulesSession initializationGlobal user preferencesConstant per-session prompt injection

What Cursor Rules and In-Repo Files Do Well

Cursor Rules excel at providing persistent, localized constraints within Cursor IDE. By placing modular .mdc files in .cursor/rules, you give Cursor's agent exact guardrails that attach automatically when specific files are edited.

Cursor supports four rule trigger types:

  • Always Apply: Injected into every Composer and Agent prompt. Best kept under 200 words for universal safety constraints.
  • File Globs: Attached only when active files match a pattern (e.g., website/src/components/**/*.tsx). Ideal for UI styling or framework-specific rules.
  • Agent Requested: Includes a descriptive summary so the model can pull the rule into context only when semantically relevant.
  • Manual: Invoked explicitly by the user using the @rule-name syntax during conversation.

Similarly, root files like CLAUDE.md and AGENTS.md serve as repository passports. They tell any coding assistant which test commands to run, where environment variables live, and which directories are strictly off-limits. If an instruction is true only for this specific codebase, it belongs inside the repository.

What Claude Skills Do Well and Why They Outperform Static Rules

A Claude Skill packages a repeatable workflow into a portable folder containing a standardized SKILL.md manifest alongside optional scripts, reference schemas, and gold-standard examples.

Unlike static rules, Claude Skills are designed for runtime portability across different coding tools. A code review rubric, database migration checklist, security vulnerability audit, or customer research synthesis method should not be locked inside Cursor's settings. If you switch to Claude Code CLI in the terminal or run a headless task in Codex, your engineering standards must remain identical.

Prompttly is a skill manager for AI agents — one library for your skills and prompts that syncs into Claude Code, Codex, ChatGPT, and Claude and is one hotkey away on your Mac, so your setup follows you across every machine, repo, and tool.

By maintaining your reusable engineering workflows in a centralized skill library, you eliminate the fragile practice of manually copying markdown files across repositories. To prevent workflows from getting stranded when you switch hardware, review our guide to sync prompts across laptops. For a broader architectural overview of multi-tool synchronization, explore our analysis of the best AI skill managers.

Context Budget Economics: How Persistent Rules Drain Token Memory

Every instruction permanently prepended to model context imposes a continuous token tax across every turn of a conversation. When developers dump comprehensive pull request rubrics, architectural guidelines, and styling standards directly into CLAUDE.md, AGENTS.md, or always-on Cursor Rules, they incur a severe context penalty.

A standard multi-topic instruction file consumes approximately 1,800 to 2,500 tokens per turn. In a realistic 10-turn interactive debugging or feature-building session, that single file dumps 18,000 to 25,000 tokens of redundant text into active working memory. This persistent bloat degrades model reasoning, pushes earlier conversation context out of memory, increases API token costs, and introduces instruction distraction.

In contrast, modern agent skill architectures (such as Claude Code and Google Antigravity) use lazy loading. At agent startup, the runtime parses only the skill's YAML frontmatter name and description—consuming a negligible 35 to 50 tokens (a 96% reduction in context overhead). The complete procedural instructions and supporting scripts inside SKILL.md are loaded into active context only when the agent explicitly determines that the current task requires that skill.

As recommended in the OpenAI Prompt Engineering Guide, keeping prompt instructions focused, modular, and context-efficient directly improves LLM output accuracy and adherence.

Where Should Different Instructions Live? The Repository Routing Matrix

Most prompt sprawl and agent confusion stems from conflating repo-specific facts with reusable procedural workflows. Use this practical decision matrix before adding any new instruction to your codebase:

Instruction ExampleCanonical DestinationArchitectural Rationale
"Review code changes for behavior risk before commenting on style."SKILL.mdA universal code review methodology that applies across all projects and agents.
"This repo uses pnpm and Vitest. Run 'pnpm test:unit' before pushing."AGENTS.md / CLAUDE.mdLocal repository fact required by any agent executing terminal commands here.
"In website/src/components, use Tailwind CSS and mobile-first container queries.".cursor/rules/ui.mdcPath-scoped glob rule that should attach only when frontend code is touched.
"When drafting release announcements, follow our customer benefit rubric."SKILL.mdPortable writing procedure that works equally well in Claude Web, Cursor, or ChatGPT.
"Never modify generated Prisma clients or files in website/dist/."AGENTS.mdUniversal safety guardrail that protects build output across all tools.

The Sprawl Moment: When Branch Drift and Multi-Tool Setups Corrupt Context

You spend two days dialing in an automated PR review routine inside CLAUDE.md on a local feature branch. It catches edge-case race conditions and validates database migrations flawlessly. Later that afternoon, an urgent hotfix pulls you onto another branch, where you open Cursor to inspect a failing endpoint. Cursor has no record of your review instructions because the edits were trapped inside an unmerged branch commit. Worse, when you launch Codex inside an adjacent microservice worktree, it reads an outdated AGENTS.md from three months ago.

The agent generates deprecated mock payloads, violates your security boundaries, and reintroduces the exact hallucinations you resolved yesterday. You realize your team's best engineering knowledge is fragmented across unmerged git branches, local editor preferences, and personal scratchpads.

Centralizing your reusable workflows into an external, version-controlled skill library prevents this fragmentation. When your instructions live in portable skill directories synced to your system, they remain active whether you change branches, open a new git worktree, or switch between Cursor and the CLI. For a detailed breakdown of solving instruction fragmentation across projects, read our guide on managing agent instructions across repos and worktrees.

Before and After: Cleaning Up Copied Rules and Confused Repositories

Consider a team that establishes a rigorous code review process. Over several months, pieces of that process end up copied into Cursor project rules, CLAUDE.md, AGENTS.md, and personal prompt snippets. Inevitably, the copies drift out of sync.

Operational LayerWeak Setup (Fragmented Copies)Stronger Setup (Decoupled & Synced)
Reusable Review MethodCopied as a 2,000-token block into every Cursor rule and repo file.Authored once in a portable SKILL.md package.
Repo Verification CommandsMixed directly into general review instructions.Kept cleanly in AGENTS.md or .cursor/rules.
Multi-Agent ParityCursor has one standard; Claude Code and Codex have stale versions.All tools execute the identical skill via shared filesystem sync.
Workflow UpdatesUpdating a rubric requires finding and editing 10+ git repositories.Update the skill once; changes propagate instantly to all tools.

How to Convert a Static Cursor Rule or AGENTS.md Entry into a Portable Skill

Suppose you have a Cursor Project Rule in .cursor/rules/pr-review.mdc that mixes generic code review principles with local repository test scripts:

---
description: Pull request review guidelines for this repository
globs: "**/*"
alwaysApply: false
---

- Review behavior risk before addressing formatting or styling issues.
- Run "pnpm test:unit" before approving any changes in website/src.
- Check authentication boundaries and Stripe webhook signatures carefully.
- Return all findings ordered by severity with exact line references.
- Do not suggest refactors that are outside the explicit scope of the PR.

To convert this into a durable architecture, extract the general review methodology into a reusable Claude Skill in ~/.claude/skills/behavior-first-code-review/SKILL.md:

---
name: behavior-first-code-review
description: Use when conducting pull request or diff reviews to prioritize behavior risk, edge cases, auth boundaries, and test validation over stylistic preferences.
---

# Behavior-First Code Review

Review behavior before style.
1. Inspect changed logic, error handling, and potential race conditions.
2. Verify that unit and integration tests cover new branches.
3. Check authentication, authorization, and financial state transitions.
4. Output findings ordered strictly by severity (Critical, Major, Minor, Note).
5. For each finding, include the file path, failure condition, and suggested remediation.
6. Do not propose stylistic refactoring unless it directly resolves a bug.

Then, replace the monolithic Cursor Rule with a concise, repo-specific pointer that references the skill and retains local commands:

---
description: Verification commands for repository changes
globs: "website/**/*"
alwaysApply: false
---

- Follow the behavior-first-code-review skill for review methodology.
- Run "pnpm test:unit" in the website directory before approving frontend edits.
- Flag changes to billing and auth modules for manual engineering review.

The review procedure is now completely portable and decoupled from Cursor, while Cursor retains the local commands and directory paths specific to this repository.

When Should You NOT Use Skills or Rules?

Maintaining an efficient AI development environment requires avoiding over-engineering:

  • Do not use a Claude Skill for temporary repo facts: Ephemeral details like "this service runs on port 8080 in dev" or "use node v20.10" belong in AGENTS.md or README.md, not in a portable skill.
  • Do not use Cursor Rules for cross-agent workflows: If a workflow must be executed by Claude Code in terminal scripts or by teammates using Codex, defining it solely in .cursor/rules traps it in one editor.
  • Do not convert unproven prompts into skills: Avoid turning an experimental, single-use prompt into a permanent rule or skill. Experiment in interactive chat first; promote an instruction only after it has demonstrated repeatable value across three or more tasks.

A Practical Setup and Migration Checklist for Multi-Agent Repositories

  1. Audit your current instruction sprawl: Catalog all prompt text currently spread across .cursor/rules, CLAUDE.md, AGENTS.md, and personal snippet managers.
  2. Separate local repo facts from workflows: Keep package managers, test runners, and directory trees in AGENTS.md. Move procedural checklists into skills.
  3. Standardize on AGENTS.md for cross-tool repos: If your team uses Cursor, Claude Code, and Codex, make AGENTS.md the neutral repository context file and keep CLAUDE.md strictly for Claude-specific CLI flags.
  4. Draft SKILL.md entrypoints with YAML triggers: Ensure every reusable skill includes a concise name and high-signal description under 1,024 characters.
  5. Link instead of duplicating: Update repo files to reference skills by name (e.g. "Use the behavior-first-code-review skill") rather than pasting multi-paragraph procedures.
  6. Establish an automated sync mechanism: Use a dedicated skill manager to mirror your canonical skill library into local agent folders across all development machines.

Frequently Asked Questions About Claude Skills, Cursor Rules, and AGENTS.md

What is the difference between Claude Skills and Cursor Rules?

Claude Skills package reusable agent workflows into portable skill directories governed by a SKILL.md entrypoint. Cursor Rules provide persistent in-editor instructions inside Cursor, scoped to a project, file pattern (glob), or personal user preference.

How do CLAUDE.md and AGENTS.md compare to Cursor Rules?

CLAUDE.md provides project-level instructions tailored for Claude and Claude Code, while AGENTS.md provides tool-agnostic repository instructions for agents like OpenAI Codex, Google Antigravity, and Cursor. Both operate as persistent repository context files, whereas Cursor Rules (.cursor/rules/*.mdc) are native to the Cursor IDE.

Should I put coding standards in a Claude Skill, a Cursor Rule, or AGENTS.md?

Put repository-specific facts (build commands, package managers, file paths, architecture boundaries) in AGENTS.md, CLAUDE.md, or Cursor Rules. Put repeatable, cross-repository workflows (code review checklists, migration rubrics, security audits) in Claude Skills so they travel with you across projects and tools.

Can Cursor Rules or AGENTS.md replace Claude Skills?

No. Cursor Rules and AGENTS.md anchor instructions to a specific repository or editor. They do not travel to Claude Code CLI, Codex, ChatGPT, or other environments without manual copying. Claude Skills are designed for cross-agent runtime portability.

How does context window token overhead compare between persistent rules and skills?

Persistent files like CLAUDE.md, AGENTS.md, and always-on Cursor Rules inject 1,800 to 2,500 tokens of static text on every message turn, totaling 18,000 to 25,000 tokens over a 10-turn session. Modern agent skills index only YAML frontmatter descriptions (~35 to 50 tokens) at startup, saving over 96% of active context memory until the skill is actually invoked.

Where do Cursor Rules, CLAUDE.md, AGENTS.md, and skills live on disk?

Cursor Project Rules live in .cursor/rules/*.mdc (with legacy support for .cursorrules), CLAUDE.md lives in the repository root, AGENTS.md lives in the repository root, and Claude Skills live in ~/.claude/skills/<skill-name>/SKILL.md (or ~/.codex/skills/ for Codex).

Can I convert an existing Cursor Rule or repo instruction into a portable Claude Skill?

Yes. Extract the reusable process from the rule, strip out repo-specific file paths and commands, add a standardized YAML frontmatter block with name and description triggers, and save it as a SKILL.md file. Then leave a one-line pointer in your repository instruction file referencing the skill.

How do you keep instructions in sync across Cursor, Claude Code, and Codex?

Rather than copying markdown snippets between repositories and git branches, maintain your canonical workflows in a unified skill library. Prompttly syncs skills directly to ~/.claude/skills, ~/.codex/skills, and .cursor/rules from a single source of truth, accessible via a global Mac hotkey.

Where to Go Next

Browse the complete guide collection on our resources hub. For technical specifications on structuring multi-file skill directories, read our guide to agent skills and SKILL.md. To organize your skills across local and global directory scopes, see our walkthrough on Claude Skills across projects. If you are comparing adjacent instruction formats, explore Google Antigravity skills, Claude Skills vs custom GPTs, and Claude Skills vs MCP. If your team is struggling with prompt fragmentation across 3+ coding tools, read managing prompt sprawl when using multiple AI coding assistants. When you are ready to convert existing rules into modular packages, use the free Claude Skill Creator or download the Prompttly Mac app to sync your library everywhere.

Turn reusable rules into portable skills

Use the free Claude Skill Creator to separate repo-specific Cursor guidance from workflows that should follow you across agents and machines.