CLAUDE.md Templates
Ready-made CLAUDE.md snippets for common MemNexus workflows — copy, paste, and adapt to your setup.
If you use Claude Code, a CLAUDE.md file in your project root defines how Claude behaves in every session. Adding MemNexus instructions to it means Claude automatically searches and loads your memory without you having to ask.
These templates are ready to copy. Paste the relevant sections into your CLAUDE.md and adapt as needed.
Minimal setup
The smallest useful addition — just load context at the start of each session:
## Memory
At the start of every session, before anything else:
1. Run `mx memories recap --recent 24h` and share the output
2. If I mention a specific topic or component, run
`mx memories digest --query "[topic]" --digest-format structured`
After significant milestones (feature complete, bug fixed, decision made), save a memory:
`mx memories create --conversation-id "NEW" --content "[description]"`
Developer session template
For individual developers using MemNexus day-to-day:
## MemNexus Memory
### Session start
Before starting any work, run these and share the output:
1. `mx memories recap --recent 24h` — see what was worked on recently
2. `mx memories digest --query "[the thing we're working on today]" --digest-format structured` — get context on the current focus area
### Saving memories
Save a memory after:
- Completing a significant task or feature
- Finding the root cause of a bug
- Making an architectural decision
- Discovering a gotcha or non-obvious pattern
Use this format:
`mx memories create --conversation-id "conv_[session]" --content "[details]" --topics "[status]"`
For the first memory of a new topic: `--conversation-id "NEW"`
For follow-up memories: reuse the conversation ID from the first memory
### Before debugging
Run these before investigating any bug:
1. `mx memories search --query "[describe symptoms]" --timeline`
2. `mx memories search --query "[component name]" --topics "gotcha" --brief`
Share results before proposing investigation steps.
Team lead template
For team leads who want Claude to surface work from the whole team:
## MemNexus Team Memory
### Session start
1. `mx memories recap --recent 24h` — see all recent team activity
2. `mx memories search --query "[current project/component]" --timeline --recent 7d` — load relevant context
### Standup prep
When asked to prepare a standup update:
`mx memories digest --query "today's work" --recent 8h --digest-format status-report`
### Handoffs
When finishing work to hand off to a teammate, save a handoff memory:
`mx memories create --conversation-id "conv_handoff" --content "Handing off [feature].
Current state: [state].
Next step: [next step].
Known issues: [issues].
Gotchas: [anything non-obvious]." --topics "handoff,in-progress"`
### Onboarding
When a new team member asks about a component or feature:
`mx memories digest --query "[component]" --digest-format structured`
`mx memories search --query "[component]" --topics "gotcha" --brief`
Debugging-first template
For teams where debugging is the primary Claude Code use case:
## MemNexus Debugging
### Before every investigation
Before proposing any hypotheses, run:
1. `mx memories search --query "[symptoms]" --timeline`
2. `mx memories search --query "[component]" --topics "gotcha" --brief`
If results are found, lead with what previous investigations revealed before generating new hypotheses.
### Saving root causes
After finding a root cause, always save a memory:
`mx memories create --conversation-id "[incident id]" --content "Root cause: [cause].
Symptoms: [symptoms].
Ruled out: [ruled-out causes].
Fix: [fix] (commit [hash], PR [number]).
Warning: [what to look for if this appears again]." --topics "gotcha,completed"`
### Incident response
For incidents involving multiple people, use a shared conversation ID:
`mx memories create --conversation-id "conv_incident_[date]" --content "[findings so far]"`
This creates a real-time shared timeline all team members can search.
Feature development template
For structured feature work with regular checkpoints:
## MemNexus Feature Development
### Starting a feature
1. Search for prior work on this feature area:
`mx memories search --query "[feature name]" --timeline`
2. Load relevant architectural context:
`mx memories digest --query "[feature name] architecture" --digest-format structured`
3. Start a new conversation for this feature:
`mx memories create --conversation-id "NEW" --content "Starting [feature name]. [Goals and approach]." --topics "in-progress"`
### During development
After each significant milestone:
`mx memories create --conversation-id "[feature conv ID]" --content "[what was built, decisions made, open questions]"`
### Completing a feature
`mx memories create --conversation-id "[feature conv ID]" --content "[final state, PR numbers, deployment notes, any known issues or future considerations]" --topics "completed"`
### Architecture decisions
When making a non-obvious technical decision, save it immediately:
`mx memories create --conversation-id "[feature conv ID]" --content "Decision: [what was decided].
Alternatives considered: [alternatives].
Reason: [why this approach].
Trade-offs: [what was given up]." --topics "decision"`
Named memories for project state
Use named memories for values you'll look up repeatedly:
## Named Project Memories
Retrieve current project state at session start:
`mx memories get --name "project-status"`
To update project status:
`mx memories create --name "project-status" --content "[current state]" --conversation-id "NEW"`
Current named memories for this project:
- `project-status` — current sprint state and priorities
- `api-conventions` — API design decisions and naming conventions
- `deploy-checklist` — steps required for production deployment
Named memories use --name "kebab-case-key" for deterministic lookup. They're different from --topics — --name creates a unique retrieval key, not a category tag. Run mx memories list --named to see all named memories in your workspace.
Tips for CLAUDE.md memory instructions
Be specific about when to search. "Before starting work" is clearer than "sometimes." Specific triggers mean Claude actually runs the search instead of skipping it.
Keep save instructions brief. Claude doesn't need detailed save instructions — it knows the CLI. A reminder to save after milestones + the conversation ID pattern is enough.
Use conversation IDs consistently. If your team works on a long-running feature, a shared convention like conv_feature-[name] keeps all the related memories grouped.
Don't over-engineer it. The minimal template is often enough. Add sections as you find yourself wanting something specific that isn't happening automatically.
Next steps
- Session start ritual — The underlying pattern these templates automate
- Capturing memories that actually help — What to save and how to write it
- Claude Code integration — Full MCP setup for Claude Code