plugins/claude-code-expert/archive/v7.6.0/skills/memory-instructions/SKILL.md
# Claude Code Memory & Instructions System Complete guide to CLAUDE.md, project instructions, auto-memory, and rules. ## CLAUDE.md — Project Instructions ### Purpose CLAUDE.md files contain natural-language instructions that Claude Code loads as system context. They tell Claude about your project's conventions, build commands, architecture, and preferences. ### Hierarchy (All Additive) ``` Enterprise/Managed CLAUDE.md (highest priority, cannot be overridden) └── User ~/.claude/CLAUDE.
npx skillsauth add markus41/claude plugins/claude-code-expert/archive/v7.6.0/skills/memory-instructionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete guide to CLAUDE.md, project instructions, auto-memory, and rules.
CLAUDE.md files contain natural-language instructions that Claude Code loads as system context. They tell Claude about your project's conventions, build commands, architecture, and preferences.
Enterprise/Managed CLAUDE.md (highest priority, cannot be overridden)
└── User ~/.claude/CLAUDE.md (personal preferences, all projects)
└── Project ./CLAUDE.md (project conventions)
└── Project ./.claude/CLAUDE.md (additional project instructions)
└── Local ./CLAUDE.local.md (personal, gitignored)
└── Directory path/CLAUDE.md (scoped to that directory)
All levels are loaded and combined. Lower levels cannot override enterprise settings.
@path/file.md — Import additional files into CLAUDE.md context# Project Instructions
## Build & Test Commands
- Install: `pnpm install`
- Dev: `pnpm dev`
- Build: `pnpm build`
- Test: `pnpm test`
- Single test: `pnpm test -- path/to/test.ts`
- Lint: `pnpm lint`
- Type check: `pnpm typecheck`
## Code Conventions
- Language: TypeScript strict mode
- Style: Prettier + ESLint
- Imports: Use absolute paths from `@/`
- Components: Functional React with hooks
- State: Zustand for global, React Query for server
## Architecture
- Monorepo: Turborepo with packages in `packages/`
- API: Next.js API routes in `src/app/api/`
- Database: PostgreSQL with Prisma ORM
- Auth: NextAuth.js with Keycloak provider
- Deployment: Kubernetes on AWS EKS
## Key Files
- `prisma/schema.prisma` — Database schema
- `src/lib/auth.ts` — Auth configuration
- `src/lib/db.ts` — Database client
## Important Context
- We use pnpm, never npm or yarn
- Always run tests before committing
- Follow conventional commits format
- Never commit .env files
settings.local.json instead)Rules in .claude/rules/ are like scoped CLAUDE.md files.
# Git Rules
- Use conventional commits
- Never force push to main
---
paths:
- "**/*.ts"
- "**/*.tsx"
---
# TypeScript Rules
- Use strict mode
- Prefer interfaces over type aliases for objects
- Max function length: 50 lines
.claude/rules/
├── architecture.md # Global — project structure
├── code-style.md # Scoped — *.ts, *.tsx, *.js, *.jsx
├── docker-k8s.md # Scoped — Dockerfiles, *.yaml
├── git-workflow.md # Global — commit conventions
├── testing.md # Scoped — *.test.*, *.spec.*
├── research.md # Global — web research tools
├── self-healing.md # Global — error capture protocol
└── lessons-learned.md # Global — auto-growing error log
Claude Code automatically saves important discoveries and patterns to persistent memory files.
~/.claude/projects/<project-hash>/memory/
├── MEMORY.md # Auto-loaded into context (keep under 200 lines)
├── debugging.md # Topic-specific notes
├── patterns.md # Recurring patterns
└── architecture.md # Architecture decisions
# Project Memory
## Build System
- Uses pnpm workspaces with Turborepo
- `pnpm -w` for root-level operations
## Database
- PostgreSQL on port 5433 (non-standard)
- Run `pnpm db:migrate` after schema changes
## User Preferences
- Always use bun for running scripts
- Prefers functional style over OOP
# User says:
"Remember that we always use bun, not npm"
→ Claude saves to MEMORY.md
"Forget the instruction about yarn"
→ Claude removes from MEMORY.md
"Always run lint before committing"
→ Claude saves preference
# Slash commands:
/memory # View memories
/memory add <text> # Add entry
/memory clear # Clear all
export DISABLE_AUTOMEMORY=1
or in settings.json:
{ "autoMemory": false }
The lessons-learned system creates a continuously improving knowledge base:
Tool call fails
→ PostToolUse hook captures error
→ Appends to .claude/rules/lessons-learned.md
→ Claude fixes the issue
→ Claude updates entry: Status → RESOLVED, adds Fix + Prevention
→ Next session loads lessons-learned.md as a rule
→ Claude doesn't repeat the mistake
### Error: Git push rejected
- **Tool:** Bash
- **Status:** RESOLVED
- **Fix:** Use `git pull --rebase` before pushing
- **Prevention:** Always pull before push
Enterprise managed settings (cannot be overridden)
└── User settings (~/.claude/settings.json)
└── Project settings (.claude/settings.json)
└── Local overrides (.claude/settings.local.json)
development
Enhanced plan-authoring skill with Pre-Writing context gathering, task metadata, non-TDD templates, Red Flags, telemetry, and an automated plan linter. Use when you have a spec or requirements for a multi-step task, before touching code.
tools
Documentation intelligence engine with graph-based API docs, algorithm library, and drift detection
tools
Ultraplan cloud planning — kick off a plan in the cloud from your terminal, review and revise in the browser, then execute remotely or send back to CLI
tools
--- name: mcp description: Configure MCP servers for Claude Code — stdio vs HTTP, authentication, Tools/Resources/Prompts distinction, channels (CI webhook, mobile relay, Discord bridge, fakechat), and cost of always-loaded tools. Use this skill whenever adding an MCP server, debugging connection issues, choosing between MCP Tools vs Prompts vs Resources, installing channel servers, or managing .mcp.json. Triggers on: "MCP server", "mcp config", "add Obsidian MCP", "install context7", "channels"