Skip to main content
CLAUDE.md is a Markdown file you place at the root of your project. Claurst discovers it automatically and injects its contents into the system prompt as project context before every session.

How it works

When Claurst starts, the ContextBuilder in cc-core walks upward from the current working directory to the filesystem root, collecting every CLAUDE.md file it encounters. It also reads ~/.claude/CLAUDE.md for user-level preferences. All discovered files are concatenated and injected into the system prompt.
The constant governing the filename is:

What to put in CLAUDE.md

A useful CLAUDE.md gives Claude the context a new contributor would need to work effectively on your project.

Project overview

A short description of what the project does, its goals, and its architecture.

Coding conventions

Style rules, naming conventions, formatting standards, and linting requirements.

Key files

A map of important files and directories and what each one does.

Commands

How to build, test, lint, and run the project.

Example: Rust project

CLAUDE.md

Coding conventions

  • No unwrap() in production paths — use ? and anyhow::Result
  • All public functions must have doc comments
  • SQL queries live in src/db/ only; no inline SQL in handlers
  • Use tracing::instrument on async functions that make DB calls
  • New endpoints need integration tests in tests/

Environment variables

Keep ~/.claude/CLAUDE.md short. It is loaded for every project and contributes to your token budget even when the instructions are not relevant to the current task.

Token budget considerations

CLAUDE.md content is injected on every turn. Long files reduce the context window available for your actual conversation and tool results.
Claurst’s auto-compact threshold is 0.9 of the context window (200,000 tokens for current Claude 4 models). A large CLAUDE.md moves you closer to this threshold from the start of every session.
Practical guidelines:
  • Keep your project CLAUDE.md under 500 lines
  • Move rarely-needed reference material to separate files and mention where they live
  • Avoid embedding large code samples directly in CLAUDE.md

Disabling CLAUDE.md

Pass --no-claude-md at the command line, or set no_claude_md: true in your Config, to skip CLAUDE.md discovery entirely:
This is reflected in the Config struct in cc-core:

Initializing CLAUDE.md

The /init slash command generates a starter CLAUDE.md for your current project by inspecting the directory structure, build files, and recent git history:
This creates a .claude/CLAUDE.md (or CLAUDE.md at the project root) pre-populated with inferred project context.

Discovery behavior

The full discovery algorithm in cc-core::context::build_user_context:
1

Start at the working directory

Claurst begins in the current working directory passed to the session.
2

Walk upward

At each directory, checks for a CLAUDE.md file. If found, reads and collects it.
3

Stop at the filesystem root

Traversal stops when it reaches / (or the drive root on Windows).
4

Append global CLAUDE.md

Reads ~/.claude/CLAUDE.md and appends it to the collected content.
5

Inject into system prompt

All collected content is placed in the memory section of the system prompt, which is cached per-section for prompt efficiency.