Give Claude Code a memory that lasts between sessions
How CLAUDE.md files, imports, scoped rules and auto memory work in Claude Code, what to write in them, and how to stop repeating yourself every session.
Learn
Guides you can follow, a cheat sheet you'll keep open, and a playground to see which skills a job needs. Written from running it every day.
Learning path
How CLAUDE.md files, imports, scoped rules and auto memory work in Claude Code, what to write in them, and how to stop repeating yourself every session.
A skill is a folder with a SKILL.md that teaches Claude Code a repeatable job. Where skills live, how Claude picks them, and a first skill you can copy.
Hooks are commands Claude Code runs at fixed moments, like before a tool call. How to configure them, block dangerous commands, and auto-format edited files.
Cheat sheet
Hooks, memory files, skill fields and commands on one page, checked against the Claude Code docs.
Commands Claude Code runs at fixed moments. Configured under "hooks" in settings.json. Read the guide →
| Event | Runs when |
|---|---|
SessionStart | A session starts or resumes |
UserPromptSubmit | You send a prompt, before Claude reads it |
PreToolUse | Before a tool runs. Can block it or change its input |
PostToolUse | After a tool succeeds |
PostToolUseFailure | After a tool fails |
PermissionRequest | A tool needs a permission decision |
Notification | Claude Code sends a notification |
Stop | Claude finishes responding |
SubagentStop | A subagent finishes |
PreCompact | Before the conversation is compacted |
InstructionsLoaded | A CLAUDE.md or rules file is loaded |
SessionEnd | The session ends |
| Code | Effect |
|---|---|
0 | Carry on. Valid JSON on stdout is read as instructions |
2 | Block the action. stderr is sent back as the reason |
Any other | Non-blocking error. The action continues with a notice |
| File | Scope |
|---|---|
~/.claude/settings.json | You, every project |
.claude/settings.json | The project, shared in git |
.claude/settings.local.json | You, this project only |
Source: Claude Code docs
Files Claude Code loads at the start of every session, broadest first. Read the guide →
| File | Use it for |
|---|---|
~/.claude/CLAUDE.md | Your preferences in every project |
./CLAUDE.md or ./.claude/CLAUDE.md | The project, shared with the team |
./CLAUDE.local.md | Private notes for this project |
<subfolder>/CLAUDE.md | Loads when Claude works in that folder |
.claude/rules/*.md | Split rules; add paths: to scope them to files |
~/.claude/projects/<project>/memory/MEMORY.md | Auto memory index: first 200 lines load each session |
| Write | Does |
|---|---|
@path/to/file.md | Imports another file, up to 4 levels deep |
`@path` in backticks | Mentions a path without importing it |
paths: src/**/*.ts | In a rule's frontmatter: only load for matching files |
Source: Claude Code docs
A folder with a SKILL.md. Descriptions load every turn; the body loads when used. Read the guide →
| Path | Scope |
|---|---|
~/.claude/skills/<name>/SKILL.md | You, every project |
.claude/skills/<name>/SKILL.md | Everyone in this repository |
<plugin>/skills/<name>/SKILL.md | Run as /plugin-name:skill-name |
| Field | What it does |
|---|---|
description | What it does and when to use it. Claude matches on this |
name | Optional. Defaults to the folder name |
when_to_use | Optional extra trigger guidance |
disable-model-invocation | true: only you can start it, with /name |
allowed-tools | Tools it may use without asking, while it runs |
arguments | Named arguments for use in the body |
paths | Globs that limit when it can activate |
| Write | Gives you |
|---|---|
$ARGUMENTS | Everything typed after /name |
$0, $1 … | Positional arguments |
${CLAUDE_SKILL_DIR} | The skill's own folder, for bundled files |
!`command` | Runs a shell command first and inserts its output |
Source: Claude Code docs
Built-in slash commands worth knowing by heart. Read the guide →
| Command | Does |
|---|---|
/init | Writes a starting CLAUDE.md from your code |
/memory | Opens memory files; turns auto memory on or off |
/context | Shows what's loaded into context, including memory files |
/compact | Summarises the conversation to free up context |
/clear | Starts a fresh conversation |
/<skill-name> | Runs a skill by hand, with optional arguments |
Source: Claude Code docs
Playground
Describe a job and see which skills would pick it up.
A small sample of the 2,106 skills in the harness. Some of these are jokes. Most aren't.
Field notes
Practical notes on getting more out of Claude Code: skills, hooks, MCP and agent workflows, plus what changes in each Overclaud release. Free, by email.