/toolkit:claude-code-memory-and-rulesfrom toolkit
Guides users on configuring Claude Code's persistent memory system—CLAUDE.md files, modular rules with path scoping, and auto memory for session learnings.
Ships in toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Configure Claude Code's memory system — CLAUDE.md files, modular rules, and auto memory — so instructions persist across sessions.
You MUST read these references for detailed guidance:
.claude/rules/ with path scopingClaude Code has two kinds of persistent memory:
Both load at session start. More specific instructions take precedence over broader ones.
| Scope | Location | Shared With | Priority |
|---|---|---|---|
| Organization | /Library/Application Support/ClaudeCode/CLAUDE.md | All org users | Lowest |
| User | ~/.claude/CLAUDE.md | All your projects | |
| User rules | ~/.claude/rules/*.md | All your projects | |
| Project (shared) | ./CLAUDE.md or ./.claude/CLAUDE.md | Team via git | |
| Project rules | ./.claude/rules/*.md | Team via git | |
| Project (local) | ./CLAUDE.local.md | Just you | Highest |
| Auto memory | ~/.claude/projects/<project>/memory/ | Just you | Per-project |
CLAUDE.md files in parent directories are loaded in full at launch. Files in child directories load on demand when Claude reads files there.
What do you need?
├── Instruction for ALL your projects?
│ ├── Shared with team? → Not possible at user level
│ └── Just you? → ~/.claude/CLAUDE.md or ~/.claude/rules/
├── Instruction for ONE project?
│ ├── Shared with team? → ./CLAUDE.md or .claude/rules/
│ └── Just you? → ./CLAUDE.local.md
├── Scoped to specific file types?
│ └── .claude/rules/<topic>.md with paths frontmatter
├── Session learnings that persist?
│ └── Auto memory (~/.claude/projects/<project>/memory/)
├── Automated enforcement (not guidance)?
│ └── Hook — use the claude-code-hook-development skill
└── Organization-wide policy?
└── Managed CLAUDE.md (deployed by IT)
Rules (CLAUDE.md / .claude/rules/) are instructions — natural language that Claude interprets with judgment.
Hooks (.claude/settings.json) are enforcement — shell commands that execute deterministically on events. Use the claude-code-hook-development skill for hooks.
| Need | Use |
|---|---|
| "Use 2-space tabs in this project" | Rule — .claude/rules/code-style.md or ./CLAUDE.md |
| "I prefer TypeScript over JavaScript" | Rule — ~/.claude/CLAUDE.md (user-level) |
| "API routes must validate input" | Rule — .claude/rules/api.md with paths: src/api/** |
| "Remember the DB uses port 5433" | Auto memory or ./CLAUDE.local.md |
| "All engineers must follow X policy" | Rule — Managed CLAUDE.md (org-level) |
| "Always run prettier after editing" | Hook — use claude-code-hook-development skill |
| "Never push to main" | Hook — use claude-code-hook-development skill |
| "Block rm -rf /" | Hook — use claude-code-hook-development skill |
Use rules for the 90% (guidance). Use hooks for the 10% (guardrails and automation).
Keep instructions specific and actionable:
# Project Instructions
## Build & Test
- Run tests: `npm test`
- Lint: `npm run lint`
- Build: `npm run build`
## Code Style
- Use 2-space indentation
- Prefer named exports over default exports
- All API endpoints must validate input
## Architecture
- API routes in src/api/, business logic in src/services/
- Database queries only in src/db/ — never in route handlers
Tips:
For larger projects, split instructions into focused files instead of one large CLAUDE.md:
.claude/rules/
├── code-style.md # Formatting and naming
├── testing.md # Test conventions
├── security.md # Security requirements
└── frontend/
├── react.md # React patterns
└── styles.md # CSS conventions
All .md files are discovered recursively and loaded as project memory.
Scope rules to specific files using paths frontmatter:
---
paths:
- "src/api/**/*.ts"
---
# API Rules
- All endpoints must include input validation
- Use the standard error response format
- Include OpenAPI documentation comments
Rules without paths apply to all files.
| Pattern | Matches |
|---|---|
**/*.ts | All TypeScript files |
src/**/* | All files under src/ |
*.md | Markdown in project root |
src/**/*.{ts,tsx} | TypeScript and TSX files |
{src,lib}/**/*.ts | TypeScript in src/ or lib/ |
Import files with @path/to/file syntax:
See @README for project overview and @package.json for available npm commands.
# Git Workflow
- @docs/git-instructions.md
Relative paths resolve relative to the importing file. Max depth: 5 hops.
For personal instructions shared across worktrees:
# My Preferences
- @~/.claude/my-project-instructions.md
Run /init to generate an initial CLAUDE.md for your project. Then refine it.
Run /memory to open any memory file in your editor, toggle auto memory, or see what's loaded.
Based on Claude Code Memory Documentation.
What SKILL.md sets; muted values are Claude Code's defaults
16 skills in this plugin
/agent-developmentThis skill should be used when the user asks to "create an agent", "write an agent", "build an agent", or wants to add new agent capabilities to Claude Code./anthropic-evaluationsThis skill should be used when the user asks to "create evals", "evaluate an agent", "build evaluation suite", or mentions agent testing, graders, or benchmarks. Also suggest when building coding agents, conversational agents, or research agents that need quality assurance./claude-code-agent-teamsThis skill should be used when the user asks to "create an agent team", "run a multi-agent team", "coordinate multiple Claude sessions", "use agent teams", or wants to parallelize work across multiple Claude Code instances./claude-code-hook-developmentThis skill should be used when the user asks to "create a hook", "add a hook", "write a hook", or mentions Claude Code hooks. Also suggest this skill when the user asks to "automatically do X" or "run X before/after Y" as these are good candidates for hooks./claude-code-plugin-developmentThis skill should be used when the user asks to "create a plugin", "build a plugin", "write a plugin", or wants to bundle agents, hooks, commands, skills, or MCP servers into a distributable Claude Code plugin./claude-code-slash-commandsThis skill should be used when the user asks to "create a command", "write a slash command", "build a plugin command", or wants to add custom commands to Claude Code.npx claudepluginhub dwmkerr/claude-toolkit --plugin toolkitOther plugins' skills for the same job