~/.claude-mem/settings.json. The file is created automatically with defaults on first run. You can edit it directly or use the Context Settings Modal at http://localhost:37777 for live preview of changes.
Core settings
| Setting | Default | Description |
|---|---|---|
CLAUDE_MEM_MODEL | sonnet | AI model for processing observations when using the Claude provider |
CLAUDE_MEM_PROVIDER | claude | AI provider: claude, gemini, or openrouter |
CLAUDE_MEM_MODE | code | Active mode profile (e.g. code--es, email-investigation) |
CLAUDE_MEM_WORKER_PORT | 37777 | Port for the background worker service |
CLAUDE_MEM_WORKER_HOST | 127.0.0.1 | Host address for the worker service |
CLAUDE_MEM_SKIP_TOOLS | ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion | Comma-separated list of tools excluded from observation capture |
Available Claude models
Shorthand model names automatically resolve to the latest version:| Shorthand | Description |
|---|---|
haiku | Fast and cost-efficient |
sonnet | Balanced performance (default) |
opus | Most capable |
Skipping tools
You can control which tool executions are captured as observations. Edit~/.claude-mem/settings.json:
- Include
TodoWrite: Remove it from the skip list to track task planning in your memory - Include
AskUserQuestion: Remove it to capture decision-making conversations - Skip additional tools: Add tool names to reduce noise in your observations
Context injection settings
Claude Mem injects past observations into each new session. The Context Settings Modal athttp://localhost:37777 is the recommended way to configure these settings — it provides a live terminal preview showing exactly what will be injected at the start of your next session.
Accessing the Context Settings Modal
Loading settings
Control how many observations are injected per session:| Setting | Default | Range | Description |
|---|---|---|---|
CLAUDE_MEM_CONTEXT_OBSERVATIONS | 50 | 1–200 | Total number of recent observations to include |
CLAUDE_MEM_CONTEXT_SESSION_COUNT | 10 | 1–50 | Number of recent sessions to pull observations from |
Higher values give Claude more historical context but increase session startup time and token usage. The default of 50 observations from 10 sessions balances context richness with performance.
Filter settings
Control which observation types and concepts are included. Types — select any combination:| Value | Description |
|---|---|
bugfix | Bug fixes and error resolutions |
feature | New functionality additions |
refactor | Code restructuring |
discovery | Learnings about how code works |
decision | Architectural or design decisions |
change | General code changes |
| Value | Description |
|---|---|
how-it-works | System behavior explanations |
why-it-exists | Rationale for code or design |
what-changed | Change summaries |
problem-solution | Problem and solution pairs |
gotcha | Edge cases and pitfalls |
pattern | Recurring patterns |
trade-off | Design trade-offs |
~/.claude-mem/settings.json:
Display settings
Control how observations appear in the injected context:| Setting | Default | Options | Description |
|---|---|---|---|
CLAUDE_MEM_CONTEXT_FULL_COUNT | 5 | 0–20 | How many observations show their full expanded details |
CLAUDE_MEM_CONTEXT_FULL_FIELD | narrative | narrative, facts | Which field is expanded in full observations |
| Setting | Default | Description |
|---|---|---|
CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS | true | Show tokens required to read each observation |
CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS | true | Show tokens invested in creating the observation |
CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT | true | Show total tokens saved by reusing cached context |
CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT | false | Show savings as a percentage instead of absolute token count |
CLAUDE_MEM_CONTEXT_SHOW_TERMINAL_OUTPUT | false | Include terminal/command output snippets in context display |
Advanced context settings
| Setting | Default | Description |
|---|---|---|
CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY | false | Include the previous session’s summary in injected context |
CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE | false | Include the previous session’s final message in injected context |
Full manual configuration example
Gemini provider settings
Use Google Gemini as the AI provider for observation processing. A free tier is available via Google AI Studio.| Setting | Default | Description |
|---|---|---|
CLAUDE_MEM_GEMINI_API_KEY | — | Your Gemini API key (get a free key at aistudio.google.com) |
CLAUDE_MEM_GEMINI_MODEL | gemini-2.5-flash-lite | Model to use: gemini-2.5-flash-lite, gemini-2.5-flash, gemini-3-flash-preview |
OpenRouter provider settings
Use OpenRouter to access 100+ models for observation processing.| Setting | Default | Description |
|---|---|---|
CLAUDE_MEM_OPENROUTER_API_KEY | — | Your OpenRouter API key (get one at openrouter.ai/keys) |
CLAUDE_MEM_OPENROUTER_MODEL | xiaomi/mimo-v2-flash:free | Model identifier — supports 100+ models |
CLAUDE_MEM_OPENROUTER_MAX_CONTEXT_MESSAGES | 20 | Maximum messages in conversation history |
CLAUDE_MEM_OPENROUTER_MAX_TOKENS | 100000 | Token budget safety limit |
CLAUDE_MEM_OPENROUTER_SITE_URL | — | Optional URL for OpenRouter analytics |
CLAUDE_MEM_OPENROUTER_APP_NAME | claude-mem | Optional app name for OpenRouter analytics |
System configuration
| Setting | Default | Description |
|---|---|---|
CLAUDE_MEM_DATA_DIR | ~/.claude-mem | Data directory location |
CLAUDE_MEM_LOG_LEVEL | INFO | Log verbosity: DEBUG, INFO, WARN, ERROR, or SILENT |
CLAUDE_MEM_PYTHON_VERSION | 3.13 | Python version for chroma-mcp |
CLAUDE_MEM_EXCLUDED_PROJECTS | — | Comma-separated project names to exclude from memory capture |
CLAUDE_MEM_MAX_CONCURRENT_AGENTS | — | Maximum number of concurrent AI processing agents in the worker |
CLAUDE_CODE_PATH | (auto-detect) | Path to the Claude Code CLI (primarily needed on Windows) |
Data directory structure
Worker service management
The worker service is a background process managed by Bun. It starts automatically the first time you open a Claude Code session and continues running in the background.Custom worker port
If port37777 is already in use, configure a different port:
Debug logging
Enable verbose logging for the worker:Folder context files
Claude Mem can automatically generateCLAUDE.md files in your project folders containing activity timelines. This feature is disabled by default.
| Setting | Default | Description |
|---|---|---|
CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED | false | Enable auto-generation of folder CLAUDE.md files |
~/.claude-mem/settings.json:
Hooks configuration
Hooks are defined inplugin/hooks/hooks.json. They fire at each stage of the Claude Code session lifecycle.
Hook timeout recommendations
| Hook | Timeout | Reason |
|---|---|---|
Setup | 300s | First-time dependency installation |
SessionStart (smart-install) | 300s | Dependency check (fast ~10ms when cached) |
SessionStart (worker start) | 60s | Start background worker service |
SessionStart (context inject) | 60s | Retrieve and inject session context |
UserPromptSubmit | 60s | Lightweight session initialization |
PostToolUse | 120s | Observation capture and queuing |
Stop | 120s | Summary generation |
SessionEnd | 5s | Mark session complete (fire-and-forget) |
The
SessionStart smart-install step is fast (~10ms) when dependencies are already installed. It only runs the full install on version changes.Mode configuration
Modes configure the active workflow profile and language for observation processing.Version channel
Switch between stable and beta versions from the web viewer athttp://localhost:37777.
Your memory data is preserved when switching versions — only the plugin code changes.
Configuration best practices
Use defaults where possible
Use defaults where possible
The default configuration works well for most use cases. Start with defaults and only change settings when you have a specific reason.
Override selectively
Override selectively
Set only what you need in
~/.claude-mem/settings.json. Unset values automatically fall back to defaults.Restart worker after changes
Restart worker after changes
Most settings require a worker restart to take effect:Exception:
CLAUDE_MEM_SKIP_TOOLS changes take effect immediately on the next tool execution.Monitor logs after changes
Monitor logs after changes
After restarting the worker, check logs to confirm the configuration was applied correctly: