Back to Learn
Concepts
7 min read

Claude Rules vs System Prompts: What's the Difference?

clauderules.net

Three Layers of Claude Instructions

Claude receives instructions from multiple sources, each with different scope and precedence:

API System PromptApplication-wide

Set by application developers via the Anthropic API. Shapes Claude's persona and capabilities for that application.

User Rules (~/CLAUDE.md)User-wide

Your personal global rules. Apply to every Claude Code session across all projects.

Project CLAUDE.mdProject-wide

Project-specific rules committed to the repository. Apply to all team members working on that project.

Subdirectory CLAUDE.mdDirectory-scoped

Module or feature-specific rules. Apply when Claude navigates into that directory.

System Prompts: Application-Level Control

System prompts are set by developers building products on top of Claude via the API. If you're using Claude.ai, claude.ai sets the system prompt. If you're using a third-party Claude app, that app controls it.

As a Claude Code user, you don't write system prompts — you write CLAUDE.md files. The distinction matters because:

  • System prompts take precedence over user rules
  • You cannot override a system prompt via CLAUDE.md
  • System prompts are typically not visible to end users

User Rules: Your Personal Defaults

The file at ~/.claude/CLAUDE.md (or the platform equivalent) applies to all your Claude Code sessions regardless of project.

Good candidates for user-level rules:

  • Your preferred response format (concise vs. verbose)
  • Languages and tools you always use
  • Personal quirks ("I prefer tabs over spaces")
  • Communication style preferences
~/.claude/CLAUDE.md
# My Global Rules

## Communication Style
- Be direct. Skip preambles like "Certainly!" or "Of course!"
- When showing code changes, show only the changed lines, not the full file
- Ask one clarifying question at a time, not a list

## My Preferred Tools
- Shell: zsh with Oh My Zsh
- Editor: VS Code with vim keybindings
- Package manager: npm (not yarn or bun)

## Code Style Defaults
- TypeScript strict mode always
- Prefer functional programming patterns
- Use early returns to reduce nesting

Project CLAUDE.md: Team Shared Context

Project CLAUDE.md files are the most important type for professional development. They encode team conventions that every developer on the project should follow, making Claude a consistent team member rather than a personal assistant.

A useful mental model: your user CLAUDE.md is like your personal dotfiles. Your project CLAUDE.md is like the team's engineering handbook — it applies to everyone, and everyone can contribute to it.

Precedence and Conflicts

When rules conflict, Claude generally follows this precedence (high to low):

  1. API system prompt
  2. Explicit instructions in the conversation
  3. Subdirectory CLAUDE.md (most specific)
  4. Project root CLAUDE.md
  5. User global CLAUDE.md

When writing rules, be explicit about intent: "This overrides the global preference for X in this project."