Skip to main content
Settings are stored in ~/.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

SettingDefaultDescription
CLAUDE_MEM_MODELsonnetAI model for processing observations when using the Claude provider
CLAUDE_MEM_PROVIDERclaudeAI provider: claude, gemini, or openrouter
CLAUDE_MEM_MODEcodeActive mode profile (e.g. code--es, email-investigation)
CLAUDE_MEM_WORKER_PORT37777Port for the background worker service
CLAUDE_MEM_WORKER_HOST127.0.0.1Host address for the worker service
CLAUDE_MEM_SKIP_TOOLSListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestionComma-separated list of tools excluded from observation capture

Available Claude models

Shorthand model names automatically resolve to the latest version:
ShorthandDescription
haikuFast and cost-efficient
sonnetBalanced performance (default)
opusMost capable

Skipping tools

You can control which tool executions are captured as observations. Edit ~/.claude-mem/settings.json:
{
  "CLAUDE_MEM_SKIP_TOOLS": "ListMcpResourcesTool,SlashCommand,Skill"
}
Common customizations:
  • 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
Changes take effect on the next tool execution — no worker restart needed.

Context injection settings

Claude Mem injects past observations into each new session. The Context Settings Modal at http://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

1

Open the web viewer

Navigate to http://localhost:37777 in your browser.
2

Open settings

Click the gear icon in the header. The settings panel opens on the right.
3

Adjust and preview

Change any setting and see the Terminal Preview on the left update in real time.
4

Auto-save

Settings are saved automatically as you make changes — no submit button needed.

Loading settings

Control how many observations are injected per session:
SettingDefaultRangeDescription
CLAUDE_MEM_CONTEXT_OBSERVATIONS501–200Total number of recent observations to include
CLAUDE_MEM_CONTEXT_SESSION_COUNT101–50Number 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:
ValueDescription
bugfixBug fixes and error resolutions
featureNew functionality additions
refactorCode restructuring
discoveryLearnings about how code works
decisionArchitectural or design decisions
changeGeneral code changes
Concepts — select any combination:
ValueDescription
how-it-worksSystem behavior explanations
why-it-existsRationale for code or design
what-changedChange summaries
problem-solutionProblem and solution pairs
gotchaEdge cases and pitfalls
patternRecurring patterns
trade-offDesign trade-offs
Use the All or None buttons in the modal to quickly select or deselect all options. Setting these manually in ~/.claude-mem/settings.json:
{
  "CLAUDE_MEM_CONTEXT_OBSERVATION_TYPES": "bugfix,decision,discovery",
  "CLAUDE_MEM_CONTEXT_OBSERVATION_CONCEPTS": "how-it-works,gotcha,problem-solution"
}

Display settings

Control how observations appear in the injected context:
SettingDefaultOptionsDescription
CLAUDE_MEM_CONTEXT_FULL_COUNT50–20How many observations show their full expanded details
CLAUDE_MEM_CONTEXT_FULL_FIELDnarrativenarrative, factsWhich field is expanded in full observations
The most recent N observations (set by Count) show their full narrative or facts. The remaining observations appear in a compact table format showing only title, type, and token counts. Token economics toggles:
SettingDefaultDescription
CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENStrueShow tokens required to read each observation
CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENStrueShow tokens invested in creating the observation
CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNTtrueShow total tokens saved by reusing cached context
CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENTfalseShow savings as a percentage instead of absolute token count
CLAUDE_MEM_CONTEXT_SHOW_TERMINAL_OUTPUTfalseInclude terminal/command output snippets in context display

Advanced context settings

SettingDefaultDescription
CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARYfalseInclude the previous session’s summary in injected context
CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGEfalseInclude the previous session’s final message in injected context

Full manual configuration example

{
  "CLAUDE_MEM_CONTEXT_OBSERVATIONS": "100",
  "CLAUDE_MEM_CONTEXT_SESSION_COUNT": "20",
  "CLAUDE_MEM_CONTEXT_OBSERVATION_TYPES": "bugfix,decision,discovery",
  "CLAUDE_MEM_CONTEXT_OBSERVATION_CONCEPTS": "how-it-works,gotcha",
  "CLAUDE_MEM_CONTEXT_FULL_COUNT": "10",
  "CLAUDE_MEM_CONTEXT_FULL_FIELD": "narrative",
  "CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS": "true",
  "CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS": "true",
  "CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT": "true",
  "CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY": "false",
  "CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE": "false"
}

Gemini provider settings

Use Google Gemini as the AI provider for observation processing. A free tier is available via Google AI Studio.
SettingDefaultDescription
CLAUDE_MEM_GEMINI_API_KEYYour Gemini API key (get a free key at aistudio.google.com)
CLAUDE_MEM_GEMINI_MODELgemini-2.5-flash-liteModel to use: gemini-2.5-flash-lite, gemini-2.5-flash, gemini-3-flash-preview
To activate Gemini:
{
  "CLAUDE_MEM_PROVIDER": "gemini",
  "CLAUDE_MEM_GEMINI_API_KEY": "your-api-key-here",
  "CLAUDE_MEM_GEMINI_MODEL": "gemini-2.5-flash-lite"
}

OpenRouter provider settings

Use OpenRouter to access 100+ models for observation processing.
SettingDefaultDescription
CLAUDE_MEM_OPENROUTER_API_KEYYour OpenRouter API key (get one at openrouter.ai/keys)
CLAUDE_MEM_OPENROUTER_MODELxiaomi/mimo-v2-flash:freeModel identifier — supports 100+ models
CLAUDE_MEM_OPENROUTER_MAX_CONTEXT_MESSAGES20Maximum messages in conversation history
CLAUDE_MEM_OPENROUTER_MAX_TOKENS100000Token budget safety limit
CLAUDE_MEM_OPENROUTER_SITE_URLOptional URL for OpenRouter analytics
CLAUDE_MEM_OPENROUTER_APP_NAMEclaude-memOptional app name for OpenRouter analytics
To activate OpenRouter:
{
  "CLAUDE_MEM_PROVIDER": "openrouter",
  "CLAUDE_MEM_OPENROUTER_API_KEY": "your-api-key-here",
  "CLAUDE_MEM_OPENROUTER_MODEL": "xiaomi/mimo-v2-flash:free"
}

System configuration

SettingDefaultDescription
CLAUDE_MEM_DATA_DIR~/.claude-memData directory location
CLAUDE_MEM_LOG_LEVELINFOLog verbosity: DEBUG, INFO, WARN, ERROR, or SILENT
CLAUDE_MEM_PYTHON_VERSION3.13Python version for chroma-mcp
CLAUDE_MEM_EXCLUDED_PROJECTSComma-separated project names to exclude from memory capture
CLAUDE_MEM_MAX_CONCURRENT_AGENTSMaximum 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

~/.claude-mem/
├── claude-mem.db           # SQLite database
├── settings.json           # User settings
├── .install-version        # Cached version for smart installer
├── worker.port             # Current worker port file
└── logs/
    ├── worker-out.log      # Worker stdout logs
    └── worker-error.log    # Worker stderr logs
In production (installed plugin), the data directory is always ~/.claude-mem/ regardless of CLAUDE_PLUGIN_ROOT. Use CLAUDE_MEM_DATA_DIR to override during development only.

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.
npm run worker:start

Custom worker port

If port 37777 is already in use, configure a different port:
{
  "CLAUDE_MEM_WORKER_PORT": "38000"
}
Then restart the worker:
npm run worker:restart
Verify the new port is active:
cat ~/.claude-mem/worker.port

Debug logging

Enable verbose logging for the worker:
export DEBUG=claude-mem:*
npm run worker:restart
npm run worker:logs

Folder context files

Claude Mem can automatically generate CLAUDE.md files in your project folders containing activity timelines. This feature is disabled by default.
SettingDefaultDescription
CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLEDfalseEnable auto-generation of folder CLAUDE.md files
Enable it in ~/.claude-mem/settings.json:
{
  "CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED": "true"
}

Hooks configuration

Hooks are defined in plugin/hooks/hooks.json. They fire at each stage of the Claude Code session lifecycle.
{
  "description": "Claude-mem memory system hooks",
  "hooks": {
    "Setup": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; \"$_R/scripts/setup.sh\"",
        "timeout": 300
      }]
    }],
    "SessionStart": [{
      "matcher": "startup|clear|compact",
      "hooks": [
        {
          "type": "command",
          "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/smart-install.js\"",
          "timeout": 300
        },
        {
          "type": "command",
          "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" start",
          "timeout": 60
        },
        {
          "type": "command",
          "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code context",
          "timeout": 60
        }
      ]
    }],
    "UserPromptSubmit": [{
      "hooks": [{
        "type": "command",
        "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code session-init",
        "timeout": 60
      }]
    }],
    "PostToolUse": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code observation",
        "timeout": 120
      }]
    }],
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code summarize",
        "timeout": 120
      }]
    }],
    "SessionEnd": [{
      "hooks": [{
        "type": "command",
        "command": "node -e \"...\" ",
        "timeout": 5
      }]
    }]
  }
}

Hook timeout recommendations

HookTimeoutReason
Setup300sFirst-time dependency installation
SessionStart (smart-install)300sDependency check (fast ~10ms when cached)
SessionStart (worker start)60sStart background worker service
SessionStart (context inject)60sRetrieve and inject session context
UserPromptSubmit60sLightweight session initialization
PostToolUse120sObservation capture and queuing
Stop120sSummary generation
SessionEnd5sMark 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.
{
  "CLAUDE_MEM_MODE": "code"
}
Examples:
{
  "CLAUDE_MEM_MODE": "code--es"
}

Version channel

Switch between stable and beta versions from the web viewer at http://localhost:37777.
1

Open settings

Click the gear icon in the viewer header.
2

Find version channel

Locate the Version Channel section in the settings panel.
3

Switch versions

Click Try Beta (Endless Mode) for experimental features, or Switch to Stable to return to the production release.
Your memory data is preserved when switching versions — only the plugin code changes.
Endless Mode is experimental and slower than standard mode.

Configuration best practices

The default configuration works well for most use cases. Start with defaults and only change settings when you have a specific reason.
Set only what you need in ~/.claude-mem/settings.json. Unset values automatically fall back to defaults.
Most settings require a worker restart to take effect:
npm run worker:restart
Exception: CLAUDE_MEM_SKIP_TOOLS changes take effect immediately on the next tool execution.
After restarting the worker, check logs to confirm the configuration was applied correctly:
npm run worker:logs

Build docs developers (and LLMs) love