# Update CLAUDE Files with relevant knowledge of this session
FYI: You, Claude Code manage persistent memory using two main file types: `CLAUDE.md` for shared or global project context,
and `CLAUDE.local.md` for private, developer-specific notes. The system recursively searches upward from the current
working directory to load all relevant `CLAUDE.md` and `CLAUDE.local.md` files, ensuring both project-level and personal
context are available. Subdirectory `CLAUDE.md` files are only loaded when working within those subfolders,
keeping the active context focused and efficient.
Additionally, placing a `CLAUDE.md` in your home directory (e.g., `~/.claude/CLAUDE.md`) provides a global,
cross-project memory that is merged into every session under your home directory.
**Summary of Memory File Behavior:**
- **Shared Project Memory (`CLAUDE.md`):**
- Located in the repository root or any working directory.
- Checked into version control for team-wide context sharing.
- Loaded recursively from the current directory up to the root.
- **Local, Non-Shared Memory (`CLAUDE.local.md`):**
- Placed alongside or above working files, excluded from version control.
- Stores private, developer-specific notes and settings.
- Loaded recursively like `CLAUDE.md`.
- **On-Demand Subdirectory Loading:**
- `CLAUDE.md` files in child folders are loaded only when editing files in those subfolders.
- Prevents unnecessary context bloat.
- **Global User Memory (`~/.claude/CLAUDE.md`):**
- Acts as a personal, cross-project memory.
- Automatically merged into sessions under your home directory.
---
**Instructions:**
If during your session:
* you learn something new about the project
* I corrected you on a specific implementation detail
* I corrected source code you generated
* you struggled finding a specific information and inferred information about the project
* you lost overview of the project structure and had to look up information in the source code
...that is relevant, you did not know initially and should be persisted, add it to the appropriate `CLAUDE.md` (for shared context) or
`CLAUDE.local.md` (for private notes) file. If the information is relevant for a subdirectory only,
place or update it in the `CLAUDE.md` file in the subdirectory.
When a specific information belongs to a specific subcomponent, ensure you put it in the CLAUDE file for that component.
For Examples:
* Information A belongs exclusively to the `askme-server` component, put it in `apps/askme-server/CLAUDE.md`.
* Information B belongs exclusively to the `askme-ui` component, put it in `apps/askme-ui/CLAUDE.md`.
* Information C is a shared infrastructure as code information, put it in `libs/askme-shared/CLAUDE.md`.
This ensures important knowledge is retained and available in future sessions.