Configuration
Settings File
Settings are managed in~/.claude-mem/settings.json. The file is auto-created with defaults on first run.
Core Settings
Gemini Provider Settings
See Gemini Provider for detailed configuration and free tier information.
OpenRouter Provider Settings
See OpenRouter Provider for detailed configuration, free model list, and usage guide.
Claude Gateway Settings
Gateway credentials live in~/.claude-mem/.env, not settings.json.
Use LiteLLM Gateway when you want
CLAUDE_MEM_PROVIDER=claude to route through LiteLLM while preserving the Claude Agent SDK worker path.
System Configuration
Model Configuration
Configure which Claude model compresses your observations (only applies whenCLAUDE_MEM_PROVIDER=claude).
Available Models
Picking via the Installer
npx claude-mem install prompts for the Claude model (when the Claude provider is selected) and persists the choice to ~/.claude-mem/settings.json.
Manual Configuration
Edit~/.claude-mem/settings.json:
Mode Configuration
Configure the active workflow mode and language.Settings
Examples
Spanish Code Mode:Files and Directories
Data Directory Structure
The data directory location depends on the environment:- Production (installed plugin):
~/.claude-mem/(always, regardless of CLAUDE_PLUGIN_ROOT) - Development: Can be overridden with
CLAUDE_MEM_DATA_DIR
Plugin Directory Structure
Plugin Configuration
Hooks Configuration
Hooks are registered inplugin/hooks/hooks.json. The current shape uses a single dispatcher (worker-service.cjs hook claude-code <event>) launched through bun-runner.js, plus a fast Setup-phase version-check.js. The events wired up are:
Setup→version-check.js(sub-100ms.install-versioncheck)SessionStart→ start the worker, thenhook claude-code context(context injection)UserPromptSubmit→hook claude-code session-initPreToolUse(matcherRead) →hook claude-code file-contextPostToolUse(matcher*) →hook claude-code observationStop→hook claude-code summarize
hooks.json entries are written by the installer; do not hand-edit them in the marketplace copy unless you know what you’re doing.
Search Configuration
Claude-Mem provides MCP search tools for querying your project history. No configuration required - MCP tools are automatically available in Claude Code sessions. Search operations are provided via:- MCP Server: 3 tools (search, timeline, get_observations) with progressive disclosure
- HTTP API: 10 endpoints on the worker service port (per-user, default
37700 + (uid % 100); see~/.claude-mem/settings.json) - Auto-Invocation: Claude recognizes natural language queries about past work
Worker Service Management
Worker service is managed by Bun as a background process. The worker auto-starts on first session and runs continuously in the background.Folder Context Files
Claude-mem can automatically generateCLAUDE.md files in your project folders with activity timelines. This feature is disabled by default.
See Folder Context Files for full documentation on how this feature works, configuration options, and git integration recommendations.
Context Injection Configuration
Claude-Mem injects past observations into each new session, giving Claude awareness of recent work. You can configure exactly what gets injected using the Context Settings Modal.Context Settings Modal
Access the settings modal from the web viewer. The worker prints its URL on startup; the port comes fromCLAUDE_MEM_WORKER_PORT.
- Click the gear icon in the header
- Adjust settings in the right panel
- See changes reflected live in the Terminal Preview on the left
- Settings auto-save as you change them
Loading Settings
Control how many observations are injected:
Considerations:
- Higher values = More context but slower SessionStart and more tokens used
- Lower values = Faster SessionStart but less historical awareness
- 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):bugfix- Bug fixes and error resolutionsfeature- New functionality additionsrefactor- Code restructuringdiscovery- Learnings about how code worksdecision- Architectural or design decisionschange- General code changes
how-it-works- System behavior explanationswhy-it-exists- Rationale for code/designwhat-changed- Change summariesproblem-solution- Problem/solution pairsgotcha- Edge cases and pitfallspattern- Recurring patternstrade-off- Design trade-offs
Display Settings
Control how observations appear in the context: Full Observations:
The most recent N observations (set by Count) show their full narrative or facts. Remaining observations show only title, type, and token counts in a compact table format.
Token Economics (toggles):
Token economics help you understand the value of cached observations vs. re-reading files.
Advanced Settings
Manual Configuration
Settings are stored in~/.claude-mem/settings.json:
Customization
Settings can be customized in~/.claude-mem/settings.json.
Custom Data Directory
Edit~/.claude-mem/settings.json:
Custom Worker Port
Edit~/.claude-mem/settings.json:
Custom Model
Edit~/.claude-mem/settings.json:
Custom Skip Tools
Control which tools are excluded from observations. Edit~/.claude-mem/settings.json:
ListMcpResourcesToolSlashCommandSkillTodoWriteAskUserQuestion
- Include TodoWrite: Remove from skip list to track task planning
- Include AskUserQuestion: Remove to capture decision-making conversations
- Skip additional tools: Add tool names to reduce observation noise
Advanced Configuration
Hook Timeouts
Hook timeouts are written intoplugin/hooks/hooks.json by the installer. The current defaults match the shape of the workload at each lifecycle stage:
- Setup (
version-check.js): 300s ceiling but normally < 100ms — only reads.install-version - SessionStart (worker-start + context): 60s
- UserPromptSubmit: 60s
- PreToolUse (file-context, Read matcher): 60s
- PostToolUse (observation): 120s
- Stop (summary): 120s
bun install) happens in npx claude-mem install / npx claude-mem repair outside the session lifecycle.
Worker Memory Limit
The worker service is managed by Bun and will automatically restart if it encounters issues. Memory usage is typically low (~100-200MB).Logging Verbosity
Enable debug logging:Configuration Best Practices
- Use defaults: Default configuration works for most use cases
- Override selectively: Only change what you need
- Document changes: Keep track of custom configurations
- Test after changes: Verify worker restarts successfully
- Monitor logs: Check worker logs after configuration changes
Troubleshooting Configuration
Configuration Not Applied
-
Restart worker after changes:
-
Verify environment variables:
-
Check worker logs:
Invalid Model Name
If you specify an invalid Claude model name, the worker logs a warning and uses the default. Valid Claude models forCLAUDE_MEM_MODEL:
claude-haiku-4-5-20251001(default)claude-sonnet-4-6claude-opus-4-7
Port Already in Use
The default worker port is37700 + (uid % 100), so different OS users on the same machine get different ports automatically. If you still hit a collision (e.g. running multiple profiles as the same UID), set a fixed port:
-
Set custom port:
-
Restart worker:
-
Verify new port:
Next Steps
- Architecture Overview - Understand the system
- Troubleshooting - Common issues
- Development - Building from source

