
Creating Claude Rules
This handles the annoying gotcha when setting up Claude rules: the frontmatter uses `paths`, not `globs` like Cursor does. If you've been copying Cursor rules or just guessing at the format, you've probably hit errors. It shows the correct YAML structure, explains when to omit frontmatter entirely for global rules, and covers glob patterns for scoping rules to specific files. The side-by-side comparison table is helpful since most people are coming from Cursor. Also clarifies that `alwaysApply` doesn't exist in Claude's format. Useful when you're organizing project conventions into `.claude/rules/` and want to avoid trial and error with the syntax.
- GitHub stars
- 719
- last updated
- Jun 11, 2026
Install
$ npx -y skills add agentworkforce/relay --skill creating-claude-rules --agent claude-codeInstalls into .claude/skills of the current project.
Files
Creating Claude Rules
Overview
Rules in .claude/rules/ are modular instructions scoped to specific files via glob patterns. They load automatically with same priority as CLAUDE.md.
When to Use
- Creating new rules in
.claude/rules/ - Fixing rules that use wrong frontmatter (
globsinstead ofpaths) - Migrating Cursor rules to Claude format
- Organizing project-specific conventions
Quick Reference
| Field | Claude | Cursor |
|---|---|---|
| Path patterns | paths | globs |
| Always apply | Omit paths | alwaysApply: true |
| Description | Not documented | description |
Frontmatter
Path-Scoped Rules
---
paths:
- 'src/api/**/*.ts'
- 'tests/**/*.test.ts'
---
Or single pattern:
---
paths: src/**/*.{ts,tsx}
---
Global Rules
Omit frontmatter entirely - applies to all files:
# TypeScript Conventions
Use .js extensions in imports.
Common Mistakes
# ❌ WRONG - globs is Cursor format
---
globs:
- '**/*.ts'
---
# ✅ CORRECT - Claude uses paths
---
paths:
- '**/*.ts'
---
Sponsors
Details
- Repository
- github.com/agentworkforce/relay
- License
- Apache-2.0
- First seen
- Jun 11, 2026
More from agentworkforce/relay
All 18- Creating Skills
- Debugging Websocket Issues
- Deploying To Staging Environment
- Frontend Design
- Github Oauth Nango Integration
- Implementing Command Palettes
- Prpm Json Best Practices
- Relay 80 100 Workflow
- Review Fix Signoff Loop
- Setting Up Relayfile
- Using Agent Relay
- Writing Agent Relay Workflows
- Browser Testing With Screenshots
- Choosing Swarm Patterns
- Creating Agent Skills Skill
- Creating Claude Agents
- Creating Claude Hooks