.cursorrules patterns from real engineers — what actually moves the needle
r/cursor's "gold standard files" thread (235 ups) + "Claude Code prompt to auto-generate" (181 ups) + IndyDevDan's Claude Code curriculum frame what actually works for project rules.
After collecting .cursorrules files (and increasingly, CLAUDE.md and .claude/ directories) from a dozen working engineers in mid-2025, the patterns that earn their keep aren”t the ones the docs emphasize. The community converged on a specific approach through mid-2025, captured most directly in the r/cursor “gold standard files” thread (235 upvotes, June 11) — “cursor users: stop letting it learn from random code. use ”gold standard files” instead.”
The same pattern appeared earlier in the r/cursor “Claude Code Prompt to Auto-Generate Full Cursor Ruleset” thread (181 upvotes, June 1) and crystallized in the r/ClaudeAI “After 8 months of daily AI coding, I built a system” thread (1,821 upvotes, June 28). The cross-tool consensus by mid-2025: project conventions belong in version-controlled files the AI is forced to read, not in chat prompts you re-paste every session.
This guide is the working pattern from maintaining .cursorrules (and equivalents) across multiple projects since early 2024.
What the docs say vs what works
The Cursor docs say: put .cursorrules in your project root with conventions like “always use TypeScript strict mode” and “prefer functional components.”
What actually works: the docs guidance is necessary but not sufficient. The real productivity gain comes from a more structured file that includes:
- Concrete examples of the patterns you want, not just abstract rules
- Anti-patterns — what NOT to do, with specific examples
- References to “gold standard files” in the codebase that represent the patterns you want
- Project-specific terminology the AI needs to learn
- Test patterns and quality gates the AI should respect
The structured .cursorrules template
The template that”s emerged across the engineers I”ve collected from:
# Project: [Project Name]
## Code style
- TypeScript strict mode; no `any` types ever
- Functions over classes when possible
- Use `const` for all declarations unless mutation is required
- Async functions over .then() chains
## Examples of gold standard files
The following files are the patterns the AI should emulate:
- `src/lib/auth/session.ts` — auth flow pattern
- `src/components/data-table.tsx` — UI component composition
- `src/api/billing/handler.ts` — API route handler with error handling
- `src/test/integration/auth.test.ts` — integration test pattern
When asked to add new code, follow the patterns shown in these files.
## Anti-patterns (do NOT do these)
- Don''t use `useEffect` for data fetching — use React Query
- Don''t add new state management libraries — we use Zustand
- Don''t create new test files outside `src/test/` — co-located tests confuse our CI
- Don''t use Tailwind utility classes for component-level styling — we use cn() with class-variance-authority
## Terminology
- "Workspace" = a tenant in our multi-tenancy model
- "Org" = the billing entity above workspaces
- "Project" = a deliverable inside a workspace
- (Note: these terms have specific schema meanings; don''t use them loosely)
## Quality gates
- All new code must pass `pnpm typecheck`
- All new code must pass `pnpm lint`
- New features need at least one integration test
- Components need a test file even if it''s just a smoke test
This is verbose by Cursor”s defaults. The verbosity is the point — explicit context wins over implicit assumption.
The “gold standard files” pattern
The r/cursor 235-upvote thread detailed the pattern. The originator picked up the technique from a Series B startup engineer in SF. Instead of letting Cursor learn from “random code” across your codebase, explicitly designate which files represent the patterns you want and point the AI at them.
The Reddit reaction (47 upvotes top response): “I mean, isn”t this how most of us have been doing it? Chat-driven programming, especially when guided correctly, is all about expressing your code, the structure of your code, and the conventions that govern it.”
The substance: most engineers already do this implicitly when they say “look at file X for the pattern.” The “gold standard files” framing makes it explicit and project-portable. New team members get the pattern from .cursorrules instead of needing tribal knowledge.
The auto-generated ruleset pattern
The r/cursor “Claude Code Prompt to Auto-Generate Full Cursor Ruleset” thread (181 upvotes, June 1) introduced the inverse pattern: use Claude Code to read your codebase and generate a .cursorrules file describing what it found.
The flow:
- Run Claude Code on your existing codebase
- Ask it to identify patterns, conventions, anti-patterns
- Have it generate a
.cursorrules(orCLAUDE.md) file documenting what it found - Review and refine
- Commit
This is the canonical “your codebase already teaches the AI; codify what it learned” pattern. Works in either direction — generate rules from codebase, or write rules and verify the codebase matches.
The Claude Code parallel: CLAUDE.md + .claude/
By mid-2025, Cursor users were increasingly running Claude Code alongside Cursor (or fully migrating). The same patterns apply with a different filename:
Claude Code uses:
CLAUDE.mdin repo root — top-level project context.claude/commands/— slash command definitions.claude/agents/— sub-agent definitions
Cursor uses:
.cursorrules(legacy).cursor/rules/(newer modular approach)- Per-directory
.cursorrulesfor sub-project conventions
The patterns transfer. The “gold standard files” pattern, the “anti-patterns” section, the “terminology” section — all work the same regardless of which file the tool reads.
What IDD”s Claude Code curriculum reinforces
IDD”s “How Claude Code CHANGED Engineering Forever” (July 21) puts the project-rules pattern in the broader productivity context. The agent loop”s effectiveness is largely a function of the context engineering you do. Bad context → bad output regardless of model.
IDD”s “Hooked on Claude Code Hooks” (July 7) and his “Sub Agents BUILD THEMSELVES” video (July 28) extend the pattern into observability and multi-agent orchestration. The .cursorrules / CLAUDE.md file is the foundation; hooks, sub-agents, and slash commands build on it.
The “Cursor Pro like a Pro” workflow
The r/cursor “Advice Time: Using Cursor Pro like a Pro” thread (338 upvotes, August 23) — published a month after this article — captures the broader Cursor power-user workflow. Key takeaways:
- Use
.cursorrulesaggressively. Set up the structured template above. - Use
@filereferences in chat. Don”t make Cursor guess which file you mean. - Use Composer for multi-file edits. Not chat. Composer respects context budget better.
- Restart sessions when context drifts. Don”t fight a confused session; start fresh.
- Use BYOK if you”re heavy. API pricing direct is cheaper than Pro tier overage for some patterns.
The r/cursor “Built & sold micro-SaaS — 4 tips” thread (258 upvotes, June 3) is the operational version. Discipline > raw model quality.
Creator POV vs Reddit dissent
The creator landscape through mid-2025 increasingly emphasizes the project-rules / context-engineering pattern. IDD, AI Jason, Theo, Fireship — all variations on “structured context wins.”
The Reddit dissent splits productively:
The pro-rules camp — vocal in r/cursor and r/ClaudeAI. The patterns work; new users should adopt them early.
The “this is over-engineering” camp — present but smaller. For solo / hobby projects, ad-hoc chat-iteration works fine. Counter: for production work shared with teammates, rules ARE the team coordination mechanism.
The “rules drift from codebase reality” camp — accurate concern. Rules written 6 months ago don”t reflect current codebase patterns. Mitigation: regenerate periodically with Claude Code (per the auto-generate pattern); treat rules as living documentation.
The “use Claude Code instead” camp — growing. By mid-2025, the gravity is moving toward Claude Code + CLAUDE.md over Cursor + .cursorrules. The patterns transfer; the specific tool may not be your daily-driver in 6 months.
What this means for working engineers in late July 2025
Three concrete starting positions:
1. If you don”t have a .cursorrules or CLAUDE.md, write one this week. Even a minimal version (code style + gold standard files) beats nothing.
2. Use the auto-generate pattern to bootstrap. Run Claude Code on your codebase; ask it to generate a rules file; refine; commit.
3. Treat rules as living documentation. Update when patterns change. Review quarterly. Don”t let them drift.
The honest critique
What this guide doesn”t solve:
- Rules don”t enforce themselves. Even well-written
.cursorrules, AI tools sometimes ignore them. Code review still matters. - Cursor”s specific implementation has rough edges. The newer
.cursor/rules/directory pattern fixes some of these; older Cursor users on.cursorrulesmay not have migrated. - The patterns are tool-specific in details. Cursor”s
.cursorrulesvs Claude Code”sCLAUDE.mdvs Continue”s config — different parsers, different conventions. The principles transfer; the syntax doesn”t. - Rules can become noise. Too many rules = the AI ignores them. Keep the file focused on what actually matters.
For most working engineers reading this in late July 2025: .cursorrules (and equivalents) are the highest-leverage 30-minute investment you can make in AI-coding productivity. The pattern is teachable; the payoff is consistent. Don”t skip it.
For broader Claude Code workflow context, see our Personal Claude Code workflow guide and Vim/Helix/JetBrains + Claude Code piece.
Sources
Every reference behind this piece. If we make a claim, it's because at least one of these said so — or we lived it ourselves.
- YouTube IndyDevDan — "How Claude Code CHANGED Engineering Forever (and what's next)" — IndyDevDan
- YouTube IndyDevDan — "I'm HOOKED on Claude Code Hooks: Advanced Agentic Coding" — IndyDevDan
- YouTube IndyDevDan — "My Claude Code Sub Agents BUILD THEMSELVES" — IndyDevDan
- Docs Cursor — official documentation — Cursor / Anysphere
- Blog r/cursor — "cursor users: stop letting it learn from random code. use gold standard files" (235 upvotes) — r/cursor
- Blog r/cursor — "🔥 Claude Code Prompt to Auto-Generate Full Cursor Ruleset" (181 upvotes) — r/cursor
- Blog r/cursor — "Advice Time: Using Cursor Pro like a Pro" (338 upvotes) — r/cursor
- Blog r/cursor — "Built & sold a micro-SaaS with Cursor — 4 tips" (258 upvotes) — r/cursor
- Blog r/ClaudeAI — "After 8 months of daily AI coding, I built a system that makes claude code actually understand" (1821 upvotes) — r/ClaudeAI
- Firsthand Maintained .cursorrules across multiple projects since early 2024