Skip to main content
Lab Grimoire
TW EN
Coffee
Free Resource

CLAUDE.md Configuration Template

Four layers. Write down what you keep repeating, and let the machine read it. One page.

1 Identity (foundation)

Tell the AI who it works with and what tone to use — no re-explaining your context each time.

## Identity
User: [your name] | Timezone: GMT+8 | Language: English
Role: [e.g.] assistant professor + biotech R&D director

2 Rules (frame)

Your guardrails. The iron law: rules must be concrete enough to execute — vague advice is no rule.

## Rules
1. No rm; use mv with a _DELETE_ prefix
2. Never hard-code API keys; use environment variables
3. Ask for approval before any irreversible operation
4. Run a security review before installing any new tool

3 Preferences (finishing)

Tech and tool choices, so you skip the "use X not Y" ritual every time.

## Preferences
- Frontend: Tailwind CSS + React
- Stats: R first (tests/effect sizes/figures), Python otherwise
- Calendar: Apple Calendar | Tasks: Apple Reminders

4 Memory Routing (house rules)

Tell the AI where to find past decisions and preferences. Keep CLAUDE.md as an index, not a dump.

## Memory routing
- Preferences/config → memory/fact.yml
- Decisions/pitfalls → memory/episodic.jsonl
- Current task scratchpad → memory/scratchpad.md

Bad Rules vs Good Rules

Bad (vague)Good (concrete)
Please be careful with safetyNo rm; use mv with a _DELETE_ prefix
Keep code quality highEvery function must have a docstring
Write good commitsCommit format: type(scope): description
Don't install random thingsRun a security review before installing any new tool

20-Line Starter (copy this)

# CLAUDE.md

## Identity
User: [your name]
Timezone: GMT+8
Language: English

## Rules
1. No rm; use mv with a _DELETE_ prefix
2. Ask before any irreversible operation
3. Never hard-code API keys in source
4. Run a security review before installing new tools

## Preferences
- [tech, e.g. frontend React + Tailwind]
- [language, e.g. Python first]

## Common paths
- Project root: /path/to/project
- Output dir: /path/to/output

## Memory (advanced, optional at first)
- Preferences: memory/fact.yml
- Task scratchpad: memory/scratchpad.md

Continue with the complete Claude Code guide →

Support Lab Grimoire

If this template helps you configure Claude Code, consider supporting future guides on Ko-fi.

☕ Buy me a coffee

Past 200 lines? Split into .claude/rules/ and @import; keep the main file an index.