CLAUDE.md

May 4, 2026 · View on GitHub

Project Overview

  • Name: my-claude-code-setup
  • Description: Template repository providing CLAUDE.md templates, memory bank system, hooks, skills, subagents, and MCP server configurations for Claude Code projects
  • This is a template repo — no application code. Users fork/copy files to their own projects.

CLAUDE.md Templates

This repo provides 3 CLAUDE.md templates following official Anthropic best practices:

TemplateLinesPhilosophy
CLAUDE-template-1.md~101Compact self-contained + memory resilience
CLAUDE-template-2.md~153Memory bank headline + dual memory
CLAUDE-template-3.md~105Progressive disclosure native (this file's format)

For migrating an existing CLAUDE.md to a new template, see CLAUDE-migrate-to-new-template.md.

Tools

Use rg not grep, fd not find. tree is not installed.

  • Ignore GEMINI.md and GEMINI-*.md files

Rules Dependency

This template requires .claude/rules/core-rules.md for behavioral rules. If .claude/rules/ is missing or empty, alert the user and direct them to https://github.com/centminmod/my-claude-code-setup to obtain the companion rules files.


Memory System

This project uses a dual-memory architecture:

Primary (git-shared): CLAUDE-*.md files in repo root — read on demand:

FileRead When
CLAUDE-activeContext.mdSession start (state and goals)
CLAUDE-patterns.mdBefore implementing (code patterns)
CLAUDE-decisions.mdBefore design choices (ADRs)
CLAUDE-troubleshooting.mdWhen debugging (known fixes)
CLAUDE-config-variables.mdWhen touching config

Shadow (machine-local): Native auto memory mirrors key content for resilience:

Auto Memory FileMirrorsPurpose
memory/MEMORY.mdIndex of all memory bank filesAlways loaded (200 lines)
memory/patterns.mdCLAUDE-patterns.mdSurvives CLAUDE.md reset
memory/architecture.mdCLAUDE-decisions.mdSurvives CLAUDE.md reset
memory/build.mdBuild, Test & Verify sectionSurvives CLAUDE.md reset

All optional — check existence first. Exclude CLAUDE.md and CLAUDE-*.md from commits.

Sync Workflow

After significant work: update CLAUDE-*.md files, then sync key content to auto memory topic files.

If CLAUDE.md is ever reset or wiped, auto memory retains project knowledge — check /memory to recover context.

Backups

When asked to backup, copy CLAUDE.md, CLAUDE-*.md files, and .claude/ settings to the specified backup directory.


Context Layers

LayerLocationLoadsSharedResilient
Project contextThis fileAlwaysGitNo
Core rules.claude/rules/core-rules.mdAlwaysGitYes
Auto memorymemory/MEMORY.mdAlways (200 lines)NoYes
Auto memory topicsmemory/*.mdOn demandNoYes
Path-scoped rules.claude/rules/*.mdMatching filesGitYes
User rules~/.claude/rules/*.mdAlwaysNoYes
Skills.claude/skills/On demandGitYes
Personal overridesCLAUDE.local.mdAlwaysNoLocal
Memory bankCLAUDE-*.mdOn demandGitNo

Use /memory to inspect loaded files. Root CLAUDE.md survives /compact.

Claude Code Official Documentation

When working on Claude Code features (hooks, skills, subagents, MCP servers), use the claude-code-guide subagent (natively built into Claude Code) for questions about Claude Code CLI features, hooks, slash commands, MCP servers, settings, IDE integrations, Claude Agent SDK, and Claude API usage.