Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…

Listen to today's AI briefing

Daily podcast — 5 min, AI-narrated summary of top stories

Developer frustrated at terminal showing ignored rules file, next to open editor with CLAUDE.md file replacing…
Open SourceScore: 100

Claude Code Users: Why Your Rules Get Ignored (And How to Fix It with CLAUDE.md)

Claude Code's CLAUDE.md enforces project rules, unlike Cursor's legacy .cursorrules. Structure with alwaysApply: true and split by domain.

·9h ago·3 min read··14 views·AI-Generated·Report error
Share:
Source: dev.tovia devto_claudecode, gn_claude_code_tips, gn_claude_code, medium_agentic, hn_claude_code, reddit_claude, medium_claudeWidely Reported
How do I migrate from .cursorrules to CLAUDE.md for Claude Code?

Claude Code uses CLAUDE.md for project rules, not .cursorrules. Migrate to a single CLAUDE.md or split with .claude/ directory for context-specific rules, using YAML frontmatter and alwaysApply: true.

TL;DR

Claude Code's CLAUDE.md is the only way to enforce project rules—learn how to structure it right.

What Changed — The Legacy of .cursorrules and Claude Code's Approach

Cursor's .cursorrules file is silently ignored in Agent Mode. This isn't a Claude Code issue—Claude Code uses CLAUDE.md for project rules. But if you're migrating from Cursor, you need to know: CLAUDE.md is the only way to enforce rules in Claude Code's agentic workflows.

Cursor's .cursorrules works in standard chat but not in Agent Mode. The newer system uses .cursor/rules/*.mdc files with YAML frontmatter. Claude Code users have a simpler, more powerful alternative: CLAUDE.md.

What It Means For You — Concrete Impact on Daily Claude Code Usage

If you've been relying on .cursorrules to guide Claude Code's behavior, you've been getting zero rule enforcement. Claude Code ignores .cursorrules entirely. It uses CLAUDE.md at the project root.

This explains:

  • Why Claude Code keeps using the wrong framework
  • Why naming conventions get ignored mid-run
  • Why the same instruction works in chat but not in agent tasks

The fix? Create a CLAUDE.md file in your project root.

Try It Now — How to Structure CLAUDE.md for Claude Code

Minimal working structure:

your-project/
└── CLAUDE.md          ← global rules, always loaded
└── .claude/
    └── rules/
        ├── backend.md ← loaded for backend files
        └── frontend.md ← loaded for frontend files

Global Rules (CLAUDE.md)

---
description: Core project rules for all agent tasks
alwaysApply: true
---

# Project Rules
- Stack: Next.js 14, TypeScript strict, Tailwind CSS
- Never use `any` type — use explicit types or `unknown`
- All components in `/components`, never inline in pages
- Write tests for every exported function
- Commit messages: conventional commits format

The key field is alwaysApply: true. Without it, Claude Code may skip the rule file entirely.

Context-Specific Rules (.claude/rules/backend.md)

---
description: Rules for API routes and server-side code
globs: ["app/api/**", "lib/server/**"]
alwaysApply: false
---

# Backend Rules
- All API routes must validate with Zod
- Never expose raw database errors to the client
- Use the shared `apiResponse()` helper for all responses

The globs field tells Claude Code when to load this file. If the agent touches app/api/users/route.ts, it picks up backend rules automatically.

Common Migration Mistakes

  1. alwaysApply: false on your global rules — Without alwaysApply: true, Claude Code only loads the rule when a file glob matches. Global rules need explicit opt-in.

  2. Keeping both .cursorrules and CLAUDE.md files — Mixed state causes inconsistent behavior. Delete .cursorrules once migrated.

  3. One giant CLAUDE.md file — Rule files are evaluated per-context. Split by domain: always-apply globals, language-specific, framework-specific, no-go lists.

  4. Missing the YAML frontmatter — The --- block at the top is required. A CLAUDE.md without frontmatter may silently fail to load.

Quick Migration Checklist

  • Create CLAUDE.md in your project root
  • Set alwaysApply: true for global rules
  • Copy critical .cursorrules content into CLAUDE.md
  • Split domain rules into separate .claude/rules/*.md files with globs
  • Delete .cursorrules or rename to .cursorrules.bak
  • Run a Claude Code agent task and verify rule enforcement

Why This Matters for Claude Code Users

Cursor's .cursorrules deprecation is quiet and undocumented in most tutorials. If your Claude Code agent keeps ignoring your rules, this is almost certainly why. Claude Code's CLAUDE.md system is more transparent and powerful—use it right.


Source: dev.to

Source: gentic.news · · author= · citation.json

AI-assisted reporting. Generated by gentic.news from multiple verified sources, fact-checked against the Living Graph of 4,300+ entities. Edited by Ala SMITH.

Following this story?

Get a weekly digest with AI predictions, trends, and analysis — free.

AI Analysis

Claude Code users should immediately audit their project for any lingering `.cursorrules` files and migrate to `CLAUDE.md`. The silent failure means many developers have been getting inconsistent results without knowing why. Start by creating a single `CLAUDE.md` with `alwaysApply: true` and your most critical rules. Then, as your project grows, split into `.claude/rules/*.md` files with `globs` for context-specific rules. For Claude Code specifically, you can also use the `/rules` slash command to view active rules. Run `claude /rules` to confirm your `CLAUDE.md` is being loaded. If it's not, check the YAML frontmatter and `alwaysApply` field. This simple diagnostic can save hours of debugging agent behavior.
Compare side-by-side
Claude Code vs Cursor
Enjoyed this article?
Share:

AI Toolslive

Five one-click lenses on this article. Cached for 24h.

Pick a tool above to generate an instant lens on this article.

Related Articles

From the lab

The framework underneath this story

Every article on this site sits on top of one engine and one framework — both built by the lab.

More in Open Source

View all