Repository files navigation

MemForge Client

License: AGPL-3.0

Persistent semantic memory for Claude Code — search, recall, and connect knowledge across sessions and projects.

What You Can Do

  • Search memory across all your past sessions — by keyword, concept, or semantic similarity
  • Cross-project knowledge — find related work from other projects automatically
  • Team knowledge sharing — access shared knowledge pool from team members
  • Knowledge graph — query entity relationships and triplet connections
  • Automatic sync — observations sync to the server in the background, no manual steps

Installation

Codex

Codex uses the native package in .codex-plugin/ and the repo marketplace in .agents/plugins/marketplace.json:

codex plugin marketplace add https://github.com/pitimon/c-memforge.git
codex plugin add memforge-client@pitimon-c-memforge

To pin a release:

codex plugin marketplace add pitimon/c-memforge --ref v2.14.1
codex plugin add memforge-client@pitimon-c-memforge

Configure credentials in ~/.memforge/config.json as shown below, then start a new Codex thread so the MCP server is loaded. The Codex package exposes the MemForge MCP tools; Claude Code hook behavior remains Claude Code-specific.

Claude Code

Prerequisites

  1. Bun runtime (the MCP server runs on bun — node cannot substitute):

    • macOS / Linux: curl -fsSL https://bun.sh/install | bash
    • Windows (PowerShell): powershell -c "irm bun.sh/install.ps1 | iex"

    Ensure both bun and node are on your PATH — verify with bun --version and node --version. (Windows note: the MCP launcher no longer needs a Unix shell as of v2.10.1; earlier versions launched via sh, which Windows lacks, so the MCP server failed to start.)

  2. claude-mem plugin: /plugin marketplace add thedotmack/claude-mem

Step 1: Add Marketplace + Install Plugin

Run these commands in your terminal (not inside Claude Code):

# Add the marketplace source
claude plugin marketplace add pitimon/c-memforge
# Install the plugin
claude plugin install memforge-client@pitimon-c-memforge

Step 2: Configure API Key

Get your API key at https://memclaude.thaicloud.ai/settings, then create the config:

mkdir -p ~/.memforge
cat >~/.memforge/config.json << 'EOF'{ "apiKey": "your-api-key-here", "serverUrl": "https://memclaude.thaicloud.ai", "syncEnabled": true, "pollInterval": 2000, "role": "client"}EOF

Step 3: Restart Claude Code

Restart to load the plugin. Verify with mem_status tool — should show connectivity OK.


Try It — Example Prompts

You don't call tools directly — just talk to Claude in natural language, and it picks the right MemForge tool for you. Copy any prompt below into Claude Code. The Tool column shows what runs under the hood (handy for verifying which feature you're exercising).

1. Verify your setup (run these first)

PromptToolExpect
Check my MemForge status, tier, and quota.mem_statusConnectivity OK + your tier and observation count
Search my MemForge memory for anything about this repo.mem_semantic_searchA list of past observations (empty if brand new)

If mem_status returns connectivity OK, the plugin is working. New accounts start empty — your observations appear automatically after a few sessions (sync is background, no manual steps).

2. Search & recall

PromptTool
How did I fix the last deployment bug?mem_semantic_search (hybrid)
What did I work on yesterday? · …last week?mem_temporal_query
Find observations similar to "rate limiting strategy".mem_vector_search
Search my memory for the keyword "postgres".mem_search (full-text)
Show my 10 most recent observations.mem_semantic_recent
Show the context around observation 102945.mem_timeline

3. Cross-project & team

PromptTool
Find related work from my other projects about authentication.mem_cross_project
Search the team knowledge pool for our incident runbook.mem_team_knowledge (Team tier)

4. Knowledge graph

PromptTool
What is connected to the entity "Redis" in my memory?mem_entity_lookup
Show relationships where the predicate is "depends on".mem_triplets_query

5. Skills (SkillNet)

PromptTool
Search my skills for a database migration workflow.mem_skill_search
Browse the public skill catalog.mem_skill_discover
Turn my recent work into a reusable skill.mem_skill_create

6. Curate memory

PromptTool
Pin observation 102945 so it never gets archived.mem_pin
Mark observation 100200 as deprecated.mem_set_status
Observation 99000 is wrong — record the correction.mem_contradict
Which of my observations are oldest and unverified?mem_drift_check

Every tool response includes a suggested_next hint pointing you to the natural follow-up tool — so you can keep going without memorizing the catalog.


MCP Tools (30)

Search (start here)

ToolWhen to Use
mem_semantic_searchPrimary — use FIRST. Supports hybrid/fts/vector modes
mem_temporal_queryTime-based search ("yesterday", "last week", dates)
mem_hybrid_searchDedicated hybrid (backward compat — use semantic_search)
mem_vector_searchPure semantic similarity
mem_searchKeyword-only (FTS) with project/type filter

Retrieve

ToolPurpose
mem_semantic_getGet single observation by ID
mem_semantic_recentGet recent observations
mem_timelineGet context around an observation (before/after)
mem_get_observationsBatch fetch multiple observations by IDs

Memory Curation

ToolPurpose
mem_pinPin observation — protect from decay/archival
mem_set_importanceOverride importance score (0-1)
mem_set_event_dateSet temporal event date for time-based queries
mem_set_statusSet lifecycle status (active/deprecated/superseded/applied/archived)
mem_contradictMark stale + create correction observation
mem_drift_checkFind oldest unverified observations

Knowledge Graph

ToolPurpose
mem_entity_lookupFind all triplets mentioning an entity
mem_triplets_queryQuery subject-predicate-object relationships

Cross-Project & Team

ToolPurpose
mem_cross_projectFind related observations from other projects
mem_team_knowledgeSearch shared team knowledge pool
mem_stable_contextGet stable observation log (for prompt caching)

SkillNet

ToolPurpose
mem_skill_searchSearch skills by query, category, or tags
mem_skill_getGet a specific skill with full details
mem_skill_relatedFind related skills via graph traversal
mem_skill_createExtract a reusable skill from observations
mem_skill_discoverBrowse the public skill catalog

Data & Workflow

ToolPurpose
mem_ingestPush observations to the server
mem_workflow_suggestGet workflow suggestions based on context
mem_statusCheck config, connectivity, auth, tier, and quota

Session Continuity

ToolPurpose
mem_handoffWrite a session handoff (what's done, what's next, open loops)
mem_resumeResume work: latest handoff + open loops + prior handoffs + latest retrospective

All tool responses include workflow hints (suggested_next) guiding you to the right follow-up tool.

Commands

CommandPurpose
/forwardWrite a structured session handoff before ending/clearing (calls mem_handoff)
/resumeResume work: fetch latest handoff, open loops, recent context (calls mem_resume)
/retrospectiveWrite a first-person session retrospective — AI Diary + Honest Feedback (calls mem_ingest)

Tiers & Quotas

Your API key is associated with a tier that determines available features:

TierObservationsSearch ModesSynthesis/dayRate Limit
Free5,000FTS only1060/min
Pro100,000FTS + Vector + Hybrid200300/min
TeamUnlimitedAll + cross-userUnlimited600/min
EnterpriseUnlimitedAll + SSO + auditUnlimitedCustom

Run mem_status to see your current tier and quota usage. The server endpoints /api/auth/me, /api/account, and /api/user/me all return tier and quota details.


Configuration

Stored at ~/.memforge/config.json:

OptionDescriptionDefault
apiKeyYour MemForge API key(required)
serverUrlServer URLhttps://memclaude.thaicloud.ai
syncEnabledEnable background synctrue
pollIntervalSync interval in ms2000
roleclient or adminclient

For self-hosted servers, change serverUrl to your server URL.


How It Works

claude-mem (local) memforge-client (this plugin) MemForge Server
━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━
LLM creates structured → SyncPoller reads SQLite → POST /api/sync/push
observations in SQLite every 2-10s (adaptive) stores + embeds + extracts entities
30 MCP tools ←───────────── Search, curation, graph, skills
+ workflow hints + 15 background workers
  • claude-mem creates structured observations via LLM (haiku) — this is the data source
  • memforge-client syncs observations to the server AND provides search tools
  • MemForge Server stores data in PostgreSQL + pgvector, provides search APIs

Sync runs in-process with the MCP server. No separate daemon or background process.


Troubleshooting

ProblemSolution
"Remote search not configured"Check ~/.memforge/config.json has valid apiKey
"Required: claude-mem plugin"Install: /plugin marketplace add thedotmack/claude-mem
"bun: command not found"Install: curl -fsSL https://bun.sh/install | bash
SSH error on plugin installUse HTTPS: claude plugin marketplace add pitimon/c-memforge
Sync not workingRun mem_status tool. Check syncEnabled: true in config
Slow searchUse mem_search (FTS) instead of vector. Add date filters. Lower limit
MCP server won't startMissing dependencies — see First-run dependency install below
MCP fails on Windows (≤ 2.10.0)The launcher used sh (absent on Windows). Update to v2.10.1+ (claude plugin install memforge-client@pitimon-c-memforge) and ensure bun is on PATH
Old observations not syncingRemove watermark file — see Backfill existing observations below
Claude Code hangs on startupclaude-mem smart-install.js runs bun install — wait 30-60s or check network
Old db-watcher zombie processSee Upgrading from v1.x below

First-run dependency install

After claude plugin install, the MCP server may fail to connect because dependencies aren't installed in the cache directory. Fix:

# macOS / Linux — find the cache directory and install dependenciescd~/.claude/plugins/cache/pitimon-c-memforge/memforge-client/*/
bun install
# Windows (PowerShell) — newest installed version
cd (Get-ChildItem"$env:USERPROFILE\.claude\plugins\cache\pitimon-c-memforge\memforge-client"|Sort-Object Name -Descending |Select-Object-First 1).FullName
bun install

Then reconnect: run /mcp in Claude Code and reconnect memforge, or restart Claude Code.

Backfill existing observations

If you installed c-memforge after using claude-mem for a while, your existing observations may not have synced. To backfill:

# Remove watermark — next startup will sync all observations from the beginning
rm -f ~/.memforge/.sync-watermark.json

Restart Claude Code. The SyncPoller will log:

[SyncPoller] Fresh install — backfilling N existing observations

Server-side deduplication prevents duplicates, so this is safe to run anytime.

Verify sync is actually working

If you suspect the observation count on the MemForge UI is lower than it should be, run mem_status — it includes a Pipeline Health section that pinpoints which layer is failing. The numbers you see will reflect your own activity:

### Pipeline Health
**Activity (last 24h):** N transcript file(s) modified
**Captured (last 24h):** M obs in claude-mem.db (latest id=…)
**Sync cursor:** obs #… (K unsynced)
**Server (lifetime):** … obs accepted
**Sync workers:** synced ok, 0 failed, 0 pending, circuit=closed
✓ Healthy — all 4 layers aligned.

The 4 layers form a pipeline. A gap between adjacent layers points at a specific failure mode:

GapSymptomLikely causeWhere to look
Atranscripts > 0 but Captured is 0 (or << transcripts)claude-mem hooks not running — observations are never produced locally~/.claude/settings.json PostToolUse hook + ~/.claude-mem/logs/
Bunsynced is large or circuit=opensync poller is behind or server unreachablesync-poller stderr; check connectivity in the same mem_status output
Cfailed > 0server rejected uploads (quota, auth, malformed payload)tier quota above; API key validity; server logs

This is the most common silent-failure mode: claude-mem hook misconfiguration produces no observations at all, yet mem_status connectivity/auth/sync all show GREEN. The Pipeline Health section is what makes Gap A visible.

If Captured keeps reporting 0 after Gap A is shown, re-check that claude-mem is installed and that ~/.claude-mem/claude-mem.db exists and is being written to (mtime should advance during use).

Upgrading from v1.x

v2.0+ moved sync into the MCP server process. If upgrading from v1.x, clean up legacy processes and files:

# Kill old daemon if still running
pkill -f db-watcher 2>/dev/null
# Remove old plugin cache (may spawn zombie db-watcher)
rm -rf ~/.claude/plugins/cache/pitimon-c-memforge/
# Remove legacy state files
rm -f ~/.memforge/.sync-queue.json
rm -f ~/.claude-mem/memforge-sync.pid ~/.claude-mem/memforge-sync.log

Then reinstall fresh:

claude plugin uninstall memforge-client@pitimon-c-memforge
claude plugin marketplace add pitimon/c-memforge
claude plugin install memforge-client@pitimon-c-memforge

Updating

claude plugin update pitimon-c-memforge

Config at ~/.memforge/config.json is preserved. Restart Claude Code after updating.


License

AGPL-3.0 — See LICENSE for details.

Credits

Development

See MAINTENANCE.md for architecture details, release runbook, and development setup.

About

MemForge Client - Persistent semantic memory for Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

MemForge Client

License: AGPL-3.0

Persistent semantic memory for Claude Code — search, recall, and connect knowledge across sessions and projects.

What You Can Do

  • Search memory across all your past sessions — by keyword, concept, or semantic similarity
  • Cross-project knowledge — find related work from other projects automatically
  • Team knowledge sharing — access shared knowledge pool from team members
  • Knowledge graph — query entity relationships and triplet connections
  • Automatic sync — observations sync to the server in the background, no manual steps

Installation

Codex

Codex uses the native package in .codex-plugin/ and the repo marketplace in .agents/plugins/marketplace.json:

codex plugin marketplace add https://github.com/pitimon/c-memforge.git
codex plugin add memforge-client@pitimon-c-memforge

To pin a release:

codex plugin marketplace add pitimon/c-memforge --ref v2.14.1
codex plugin add memforge-client@pitimon-c-memforge

Configure credentials in ~/.memforge/config.json as shown below, then start a new Codex thread so the MCP server is loaded. The Codex package exposes the MemForge MCP tools; Claude Code hook behavior remains Claude Code-specific.

Claude Code

Prerequisites

  1. Bun runtime (the MCP server runs on bun — node cannot substitute):

    • macOS / Linux: curl -fsSL https://bun.sh/install | bash
    • Windows (PowerShell): powershell -c "irm bun.sh/install.ps1 | iex"

    Ensure both bun and node are on your PATH — verify with bun --version and node --version. (Windows note: the MCP launcher no longer needs a Unix shell as of v2.10.1; earlier versions launched via sh, which Windows lacks, so the MCP server failed to start.)

  2. claude-mem plugin: /plugin marketplace add thedotmack/claude-mem

Step 1: Add Marketplace + Install Plugin

Run these commands in your terminal (not inside Claude Code):

# Add the marketplace source
claude plugin marketplace add pitimon/c-memforge
# Install the plugin
claude plugin install memforge-client@pitimon-c-memforge

Step 2: Configure API Key

Get your API key at https://memclaude.thaicloud.ai/settings, then create the config:

mkdir -p ~/.memforge
cat >~/.memforge/config.json << 'EOF'{ "apiKey": "your-api-key-here", "serverUrl": "https://memclaude.thaicloud.ai", "syncEnabled": true, "pollInterval": 2000, "role": "client"}EOF

Step 3: Restart Claude Code

Restart to load the plugin. Verify with mem_status tool — should show connectivity OK.


Try It — Example Prompts

You don't call tools directly — just talk to Claude in natural language, and it picks the right MemForge tool for you. Copy any prompt below into Claude Code. The Tool column shows what runs under the hood (handy for verifying which feature you're exercising).

1. Verify your setup (run these first)

PromptToolExpect
Check my MemForge status, tier, and quota.mem_statusConnectivity OK + your tier and observation count
Search my MemForge memory for anything about this repo.mem_semantic_searchA list of past observations (empty if brand new)

If mem_status returns connectivity OK, the plugin is working. New accounts start empty — your observations appear automatically after a few sessions (sync is background, no manual steps).

2. Search & recall

PromptTool
How did I fix the last deployment bug?mem_semantic_search (hybrid)
What did I work on yesterday? · …last week?mem_temporal_query
Find observations similar to "rate limiting strategy".mem_vector_search
Search my memory for the keyword "postgres".mem_search (full-text)
Show my 10 most recent observations.mem_semantic_recent
Show the context around observation 102945.mem_timeline

3. Cross-project & team

PromptTool
Find related work from my other projects about authentication.mem_cross_project
Search the team knowledge pool for our incident runbook.mem_team_knowledge (Team tier)

4. Knowledge graph

PromptTool
What is connected to the entity "Redis" in my memory?mem_entity_lookup
Show relationships where the predicate is "depends on".mem_triplets_query

5. Skills (SkillNet)

PromptTool
Search my skills for a database migration workflow.mem_skill_search
Browse the public skill catalog.mem_skill_discover
Turn my recent work into a reusable skill.mem_skill_create

6. Curate memory

PromptTool
Pin observation 102945 so it never gets archived.mem_pin
Mark observation 100200 as deprecated.mem_set_status
Observation 99000 is wrong — record the correction.mem_contradict
Which of my observations are oldest and unverified?mem_drift_check

Every tool response includes a suggested_next hint pointing you to the natural follow-up tool — so you can keep going without memorizing the catalog.


MCP Tools (30)

Search (start here)

ToolWhen to Use
mem_semantic_searchPrimary — use FIRST. Supports hybrid/fts/vector modes
mem_temporal_queryTime-based search ("yesterday", "last week", dates)
mem_hybrid_searchDedicated hybrid (backward compat — use semantic_search)
mem_vector_searchPure semantic similarity
mem_searchKeyword-only (FTS) with project/type filter

Retrieve

ToolPurpose
mem_semantic_getGet single observation by ID
mem_semantic_recentGet recent observations
mem_timelineGet context around an observation (before/after)
mem_get_observationsBatch fetch multiple observations by IDs

Memory Curation

ToolPurpose
mem_pinPin observation — protect from decay/archival
mem_set_importanceOverride importance score (0-1)
mem_set_event_dateSet temporal event date for time-based queries
mem_set_statusSet lifecycle status (active/deprecated/superseded/applied/archived)
mem_contradictMark stale + create correction observation
mem_drift_checkFind oldest unverified observations

Knowledge Graph

ToolPurpose
mem_entity_lookupFind all triplets mentioning an entity
mem_triplets_queryQuery subject-predicate-object relationships

Cross-Project & Team

ToolPurpose
mem_cross_projectFind related observations from other projects
mem_team_knowledgeSearch shared team knowledge pool
mem_stable_contextGet stable observation log (for prompt caching)

SkillNet

ToolPurpose
mem_skill_searchSearch skills by query, category, or tags
mem_skill_getGet a specific skill with full details
mem_skill_relatedFind related skills via graph traversal
mem_skill_createExtract a reusable skill from observations
mem_skill_discoverBrowse the public skill catalog

Data & Workflow

ToolPurpose
mem_ingestPush observations to the server
mem_workflow_suggestGet workflow suggestions based on context
mem_statusCheck config, connectivity, auth, tier, and quota

Session Continuity

ToolPurpose
mem_handoffWrite a session handoff (what's done, what's next, open loops)
mem_resumeResume work: latest handoff + open loops + prior handoffs + latest retrospective

All tool responses include workflow hints (suggested_next) guiding you to the right follow-up tool.

Commands

CommandPurpose
/forwardWrite a structured session handoff before ending/clearing (calls mem_handoff)
/resumeResume work: fetch latest handoff, open loops, recent context (calls mem_resume)
/retrospectiveWrite a first-person session retrospective — AI Diary + Honest Feedback (calls mem_ingest)

Tiers & Quotas

Your API key is associated with a tier that determines available features:

TierObservationsSearch ModesSynthesis/dayRate Limit
Free5,000FTS only1060/min
Pro100,000FTS + Vector + Hybrid200300/min
TeamUnlimitedAll + cross-userUnlimited600/min
EnterpriseUnlimitedAll + SSO + auditUnlimitedCustom

Run mem_status to see your current tier and quota usage. The server endpoints /api/auth/me, /api/account, and /api/user/me all return tier and quota details.


Configuration

Stored at ~/.memforge/config.json:

OptionDescriptionDefault
apiKeyYour MemForge API key(required)
serverUrlServer URLhttps://memclaude.thaicloud.ai
syncEnabledEnable background synctrue
pollIntervalSync interval in ms2000
roleclient or adminclient

For self-hosted servers, change serverUrl to your server URL.


How It Works

claude-mem (local) memforge-client (this plugin) MemForge Server
━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━
LLM creates structured → SyncPoller reads SQLite → POST /api/sync/push
observations in SQLite every 2-10s (adaptive) stores + embeds + extracts entities
30 MCP tools ←───────────── Search, curation, graph, skills
+ workflow hints + 15 background workers
  • claude-mem creates structured observations via LLM (haiku) — this is the data source
  • memforge-client syncs observations to the server AND provides search tools
  • MemForge Server stores data in PostgreSQL + pgvector, provides search APIs

Sync runs in-process with the MCP server. No separate daemon or background process.


Troubleshooting

ProblemSolution
"Remote search not configured"Check ~/.memforge/config.json has valid apiKey
"Required: claude-mem plugin"Install: /plugin marketplace add thedotmack/claude-mem
"bun: command not found"Install: curl -fsSL https://bun.sh/install | bash
SSH error on plugin installUse HTTPS: claude plugin marketplace add pitimon/c-memforge
Sync not workingRun mem_status tool. Check syncEnabled: true in config
Slow searchUse mem_search (FTS) instead of vector. Add date filters. Lower limit
MCP server won't startMissing dependencies — see First-run dependency install below
MCP fails on Windows (≤ 2.10.0)The launcher used sh (absent on Windows). Update to v2.10.1+ (claude plugin install memforge-client@pitimon-c-memforge) and ensure bun is on PATH
Old observations not syncingRemove watermark file — see Backfill existing observations below
Claude Code hangs on startupclaude-mem smart-install.js runs bun install — wait 30-60s or check network
Old db-watcher zombie processSee Upgrading from v1.x below

First-run dependency install

After claude plugin install, the MCP server may fail to connect because dependencies aren't installed in the cache directory. Fix:

# macOS / Linux — find the cache directory and install dependenciescd~/.claude/plugins/cache/pitimon-c-memforge/memforge-client/*/
bun install
# Windows (PowerShell) — newest installed version
cd (Get-ChildItem"$env:USERPROFILE\.claude\plugins\cache\pitimon-c-memforge\memforge-client"|Sort-Object Name -Descending |Select-Object-First 1).FullName
bun install

Then reconnect: run /mcp in Claude Code and reconnect memforge, or restart Claude Code.

Backfill existing observations

If you installed c-memforge after using claude-mem for a while, your existing observations may not have synced. To backfill:

# Remove watermark — next startup will sync all observations from the beginning
rm -f ~/.memforge/.sync-watermark.json

Restart Claude Code. The SyncPoller will log:

[SyncPoller] Fresh install — backfilling N existing observations

Server-side deduplication prevents duplicates, so this is safe to run anytime.

Verify sync is actually working

If you suspect the observation count on the MemForge UI is lower than it should be, run mem_status — it includes a Pipeline Health section that pinpoints which layer is failing. The numbers you see will reflect your own activity:

### Pipeline Health
**Activity (last 24h):** N transcript file(s) modified
**Captured (last 24h):** M obs in claude-mem.db (latest id=…)
**Sync cursor:** obs #… (K unsynced)
**Server (lifetime):** … obs accepted
**Sync workers:** synced ok, 0 failed, 0 pending, circuit=closed
✓ Healthy — all 4 layers aligned.

The 4 layers form a pipeline. A gap between adjacent layers points at a specific failure mode:

GapSymptomLikely causeWhere to look
Atranscripts > 0 but Captured is 0 (or << transcripts)claude-mem hooks not running — observations are never produced locally~/.claude/settings.json PostToolUse hook + ~/.claude-mem/logs/
Bunsynced is large or circuit=opensync poller is behind or server unreachablesync-poller stderr; check connectivity in the same mem_status output
Cfailed > 0server rejected uploads (quota, auth, malformed payload)tier quota above; API key validity; server logs

This is the most common silent-failure mode: claude-mem hook misconfiguration produces no observations at all, yet mem_status connectivity/auth/sync all show GREEN. The Pipeline Health section is what makes Gap A visible.

If Captured keeps reporting 0 after Gap A is shown, re-check that claude-mem is installed and that ~/.claude-mem/claude-mem.db exists and is being written to (mtime should advance during use).

Upgrading from v1.x

v2.0+ moved sync into the MCP server process. If upgrading from v1.x, clean up legacy processes and files:

# Kill old daemon if still running
pkill -f db-watcher 2>/dev/null
# Remove old plugin cache (may spawn zombie db-watcher)
rm -rf ~/.claude/plugins/cache/pitimon-c-memforge/
# Remove legacy state files
rm -f ~/.memforge/.sync-queue.json
rm -f ~/.claude-mem/memforge-sync.pid ~/.claude-mem/memforge-sync.log

Then reinstall fresh:

claude plugin uninstall memforge-client@pitimon-c-memforge
claude plugin marketplace add pitimon/c-memforge
claude plugin install memforge-client@pitimon-c-memforge

Updating

claude plugin update pitimon-c-memforge

Config at ~/.memforge/config.json is preserved. Restart Claude Code after updating.


License

AGPL-3.0 — See LICENSE for details.

Credits

Development

See MAINTENANCE.md for architecture details, release runbook, and development setup.

About

MemForge Client - Persistent semantic memory for Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

MemForge Client

License: AGPL-3.0

Persistent semantic memory for Claude Code — search, recall, and connect knowledge across sessions and projects.

What You Can Do

  • Search memory across all your past sessions — by keyword, concept, or semantic similarity
  • Cross-project knowledge — find related work from other projects automatically
  • Team knowledge sharing — access shared knowledge pool from team members
  • Knowledge graph — query entity relationships and triplet connections
  • Automatic sync — observations sync to the server in the background, no manual steps

Installation

Codex

Codex uses the native package in .codex-plugin/ and the repo marketplace in .agents/plugins/marketplace.json:

codex plugin marketplace add https://github.com/pitimon/c-memforge.git
codex plugin add memforge-client@pitimon-c-memforge

To pin a release:

codex plugin marketplace add pitimon/c-memforge --ref v2.14.1
codex plugin add memforge-client@pitimon-c-memforge

Configure credentials in ~/.memforge/config.json as shown below, then start a new Codex thread so the MCP server is loaded. The Codex package exposes the MemForge MCP tools; Claude Code hook behavior remains Claude Code-specific.

Claude Code

Prerequisites

  1. Bun runtime (the MCP server runs on bun — node cannot substitute):

    • macOS / Linux: curl -fsSL https://bun.sh/install | bash
    • Windows (PowerShell): powershell -c "irm bun.sh/install.ps1 | iex"

    Ensure both bun and node are on your PATH — verify with bun --version and node --version. (Windows note: the MCP launcher no longer needs a Unix shell as of v2.10.1; earlier versions launched via sh, which Windows lacks, so the MCP server failed to start.)

  2. claude-mem plugin: /plugin marketplace add thedotmack/claude-mem

Step 1: Add Marketplace + Install Plugin

Run these commands in your terminal (not inside Claude Code):

# Add the marketplace source
claude plugin marketplace add pitimon/c-memforge
# Install the plugin
claude plugin install memforge-client@pitimon-c-memforge

Step 2: Configure API Key

Get your API key at https://memclaude.thaicloud.ai/settings, then create the config:

mkdir -p ~/.memforge
cat >~/.memforge/config.json << 'EOF'{ "apiKey": "your-api-key-here", "serverUrl": "https://memclaude.thaicloud.ai", "syncEnabled": true, "pollInterval": 2000, "role": "client"}EOF

Step 3: Restart Claude Code

Restart to load the plugin. Verify with mem_status tool — should show connectivity OK.


Try It — Example Prompts

You don't call tools directly — just talk to Claude in natural language, and it picks the right MemForge tool for you. Copy any prompt below into Claude Code. The Tool column shows what runs under the hood (handy for verifying which feature you're exercising).

1. Verify your setup (run these first)

PromptToolExpect
Check my MemForge status, tier, and quota.mem_statusConnectivity OK + your tier and observation count
Search my MemForge memory for anything about this repo.mem_semantic_searchA list of past observations (empty if brand new)

If mem_status returns connectivity OK, the plugin is working. New accounts start empty — your observations appear automatically after a few sessions (sync is background, no manual steps).

2. Search & recall

PromptTool
How did I fix the last deployment bug?mem_semantic_search (hybrid)
What did I work on yesterday? · …last week?mem_temporal_query
Find observations similar to "rate limiting strategy".mem_vector_search
Search my memory for the keyword "postgres".mem_search (full-text)
Show my 10 most recent observations.mem_semantic_recent
Show the context around observation 102945.mem_timeline

3. Cross-project & team

PromptTool
Find related work from my other projects about authentication.mem_cross_project
Search the team knowledge pool for our incident runbook.mem_team_knowledge (Team tier)

4. Knowledge graph

PromptTool
What is connected to the entity "Redis" in my memory?mem_entity_lookup
Show relationships where the predicate is "depends on".mem_triplets_query

5. Skills (SkillNet)

PromptTool
Search my skills for a database migration workflow.mem_skill_search
Browse the public skill catalog.mem_skill_discover
Turn my recent work into a reusable skill.mem_skill_create

6. Curate memory

PromptTool
Pin observation 102945 so it never gets archived.mem_pin
Mark observation 100200 as deprecated.mem_set_status
Observation 99000 is wrong — record the correction.mem_contradict
Which of my observations are oldest and unverified?mem_drift_check

Every tool response includes a suggested_next hint pointing you to the natural follow-up tool — so you can keep going without memorizing the catalog.


MCP Tools (30)

Search (start here)

ToolWhen to Use
mem_semantic_searchPrimary — use FIRST. Supports hybrid/fts/vector modes
mem_temporal_queryTime-based search ("yesterday", "last week", dates)
mem_hybrid_searchDedicated hybrid (backward compat — use semantic_search)
mem_vector_searchPure semantic similarity
mem_searchKeyword-only (FTS) with project/type filter

Retrieve

ToolPurpose
mem_semantic_getGet single observation by ID
mem_semantic_recentGet recent observations
mem_timelineGet context around an observation (before/after)
mem_get_observationsBatch fetch multiple observations by IDs

Memory Curation

ToolPurpose
mem_pinPin observation — protect from decay/archival
mem_set_importanceOverride importance score (0-1)
mem_set_event_dateSet temporal event date for time-based queries
mem_set_statusSet lifecycle status (active/deprecated/superseded/applied/archived)
mem_contradictMark stale + create correction observation
mem_drift_checkFind oldest unverified observations

Knowledge Graph

ToolPurpose
mem_entity_lookupFind all triplets mentioning an entity
mem_triplets_queryQuery subject-predicate-object relationships

Cross-Project & Team

ToolPurpose
mem_cross_projectFind related observations from other projects
mem_team_knowledgeSearch shared team knowledge pool
mem_stable_contextGet stable observation log (for prompt caching)

SkillNet

ToolPurpose
mem_skill_searchSearch skills by query, category, or tags
mem_skill_getGet a specific skill with full details
mem_skill_relatedFind related skills via graph traversal
mem_skill_createExtract a reusable skill from observations
mem_skill_discoverBrowse the public skill catalog

Data & Workflow

ToolPurpose
mem_ingestPush observations to the server
mem_workflow_suggestGet workflow suggestions based on context
mem_statusCheck config, connectivity, auth, tier, and quota

Session Continuity

ToolPurpose
mem_handoffWrite a session handoff (what's done, what's next, open loops)
mem_resumeResume work: latest handoff + open loops + prior handoffs + latest retrospective

All tool responses include workflow hints (suggested_next) guiding you to the right follow-up tool.

Commands

CommandPurpose
/forwardWrite a structured session handoff before ending/clearing (calls mem_handoff)
/resumeResume work: fetch latest handoff, open loops, recent context (calls mem_resume)
/retrospectiveWrite a first-person session retrospective — AI Diary + Honest Feedback (calls mem_ingest)

Tiers & Quotas

Your API key is associated with a tier that determines available features:

TierObservationsSearch ModesSynthesis/dayRate Limit
Free5,000FTS only1060/min
Pro100,000FTS + Vector + Hybrid200300/min
TeamUnlimitedAll + cross-userUnlimited600/min
EnterpriseUnlimitedAll + SSO + auditUnlimitedCustom

Run mem_status to see your current tier and quota usage. The server endpoints /api/auth/me, /api/account, and /api/user/me all return tier and quota details.


Configuration

Stored at ~/.memforge/config.json:

OptionDescriptionDefault
apiKeyYour MemForge API key(required)
serverUrlServer URLhttps://memclaude.thaicloud.ai
syncEnabledEnable background synctrue
pollIntervalSync interval in ms2000
roleclient or adminclient

For self-hosted servers, change serverUrl to your server URL.


How It Works

claude-mem (local) memforge-client (this plugin) MemForge Server
━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━
LLM creates structured → SyncPoller reads SQLite → POST /api/sync/push
observations in SQLite every 2-10s (adaptive) stores + embeds + extracts entities
30 MCP tools ←───────────── Search, curation, graph, skills
+ workflow hints + 15 background workers
  • claude-mem creates structured observations via LLM (haiku) — this is the data source
  • memforge-client syncs observations to the server AND provides search tools
  • MemForge Server stores data in PostgreSQL + pgvector, provides search APIs

Sync runs in-process with the MCP server. No separate daemon or background process.


Troubleshooting

ProblemSolution
"Remote search not configured"Check ~/.memforge/config.json has valid apiKey
"Required: claude-mem plugin"Install: /plugin marketplace add thedotmack/claude-mem
"bun: command not found"Install: curl -fsSL https://bun.sh/install | bash
SSH error on plugin installUse HTTPS: claude plugin marketplace add pitimon/c-memforge
Sync not workingRun mem_status tool. Check syncEnabled: true in config
Slow searchUse mem_search (FTS) instead of vector. Add date filters. Lower limit
MCP server won't startMissing dependencies — see First-run dependency install below
MCP fails on Windows (≤ 2.10.0)The launcher used sh (absent on Windows). Update to v2.10.1+ (claude plugin install memforge-client@pitimon-c-memforge) and ensure bun is on PATH
Old observations not syncingRemove watermark file — see Backfill existing observations below
Claude Code hangs on startupclaude-mem smart-install.js runs bun install — wait 30-60s or check network
Old db-watcher zombie processSee Upgrading from v1.x below

First-run dependency install

After claude plugin install, the MCP server may fail to connect because dependencies aren't installed in the cache directory. Fix:

# macOS / Linux — find the cache directory and install dependenciescd~/.claude/plugins/cache/pitimon-c-memforge/memforge-client/*/
bun install
# Windows (PowerShell) — newest installed version
cd (Get-ChildItem"$env:USERPROFILE\.claude\plugins\cache\pitimon-c-memforge\memforge-client"|Sort-Object Name -Descending |Select-Object-First 1).FullName
bun install

Then reconnect: run /mcp in Claude Code and reconnect memforge, or restart Claude Code.

Backfill existing observations

If you installed c-memforge after using claude-mem for a while, your existing observations may not have synced. To backfill:

# Remove watermark — next startup will sync all observations from the beginning
rm -f ~/.memforge/.sync-watermark.json

Restart Claude Code. The SyncPoller will log:

[SyncPoller] Fresh install — backfilling N existing observations

Server-side deduplication prevents duplicates, so this is safe to run anytime.

Verify sync is actually working

If you suspect the observation count on the MemForge UI is lower than it should be, run mem_status — it includes a Pipeline Health section that pinpoints which layer is failing. The numbers you see will reflect your own activity:

### Pipeline Health
**Activity (last 24h):** N transcript file(s) modified
**Captured (last 24h):** M obs in claude-mem.db (latest id=…)
**Sync cursor:** obs #… (K unsynced)
**Server (lifetime):** … obs accepted
**Sync workers:** synced ok, 0 failed, 0 pending, circuit=closed
✓ Healthy — all 4 layers aligned.

The 4 layers form a pipeline. A gap between adjacent layers points at a specific failure mode:

GapSymptomLikely causeWhere to look
Atranscripts > 0 but Captured is 0 (or << transcripts)claude-mem hooks not running — observations are never produced locally~/.claude/settings.json PostToolUse hook + ~/.claude-mem/logs/
Bunsynced is large or circuit=opensync poller is behind or server unreachablesync-poller stderr; check connectivity in the same mem_status output
Cfailed > 0server rejected uploads (quota, auth, malformed payload)tier quota above; API key validity; server logs

This is the most common silent-failure mode: claude-mem hook misconfiguration produces no observations at all, yet mem_status connectivity/auth/sync all show GREEN. The Pipeline Health section is what makes Gap A visible.

If Captured keeps reporting 0 after Gap A is shown, re-check that claude-mem is installed and that ~/.claude-mem/claude-mem.db exists and is being written to (mtime should advance during use).

Upgrading from v1.x

v2.0+ moved sync into the MCP server process. If upgrading from v1.x, clean up legacy processes and files:

# Kill old daemon if still running
pkill -f db-watcher 2>/dev/null
# Remove old plugin cache (may spawn zombie db-watcher)
rm -rf ~/.claude/plugins/cache/pitimon-c-memforge/
# Remove legacy state files
rm -f ~/.memforge/.sync-queue.json
rm -f ~/.claude-mem/memforge-sync.pid ~/.claude-mem/memforge-sync.log

Then reinstall fresh:

claude plugin uninstall memforge-client@pitimon-c-memforge
claude plugin marketplace add pitimon/c-memforge
claude plugin install memforge-client@pitimon-c-memforge

Updating

claude plugin update pitimon-c-memforge

Config at ~/.memforge/config.json is preserved. Restart Claude Code after updating.


License

AGPL-3.0 — See LICENSE for details.

Credits

Development

See MAINTENANCE.md for architecture details, release runbook, and development setup.

About

MemForge Client - Persistent semantic memory for Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

MemForge Client

License: AGPL-3.0

Persistent semantic memory for Claude Code — search, recall, and connect knowledge across sessions and projects.

What You Can Do

  • Search memory across all your past sessions — by keyword, concept, or semantic similarity
  • Cross-project knowledge — find related work from other projects automatically
  • Team knowledge sharing — access shared knowledge pool from team members
  • Knowledge graph — query entity relationships and triplet connections
  • Automatic sync — observations sync to the server in the background, no manual steps

Installation

Codex

Codex uses the native package in .codex-plugin/ and the repo marketplace in .agents/plugins/marketplace.json:

codex plugin marketplace add https://github.com/pitimon/c-memforge.git
codex plugin add memforge-client@pitimon-c-memforge

To pin a release:

codex plugin marketplace add pitimon/c-memforge --ref v2.14.1
codex plugin add memforge-client@pitimon-c-memforge

Configure credentials in ~/.memforge/config.json as shown below, then start a new Codex thread so the MCP server is loaded. The Codex package exposes the MemForge MCP tools; Claude Code hook behavior remains Claude Code-specific.

Claude Code

Prerequisites

  1. Bun runtime (the MCP server runs on bun — node cannot substitute):

    • macOS / Linux: curl -fsSL https://bun.sh/install | bash
    • Windows (PowerShell): powershell -c "irm bun.sh/install.ps1 | iex"

    Ensure both bun and node are on your PATH — verify with bun --version and node --version. (Windows note: the MCP launcher no longer needs a Unix shell as of v2.10.1; earlier versions launched via sh, which Windows lacks, so the MCP server failed to start.)

  2. claude-mem plugin: /plugin marketplace add thedotmack/claude-mem

Step 1: Add Marketplace + Install Plugin

Run these commands in your terminal (not inside Claude Code):

# Add the marketplace source
claude plugin marketplace add pitimon/c-memforge
# Install the plugin
claude plugin install memforge-client@pitimon-c-memforge

Step 2: Configure API Key

Get your API key at https://memclaude.thaicloud.ai/settings, then create the config:

mkdir -p ~/.memforge
cat >~/.memforge/config.json << 'EOF'{ "apiKey": "your-api-key-here", "serverUrl": "https://memclaude.thaicloud.ai", "syncEnabled": true, "pollInterval": 2000, "role": "client"}EOF

Step 3: Restart Claude Code

Restart to load the plugin. Verify with mem_status tool — should show connectivity OK.


Try It — Example Prompts

You don't call tools directly — just talk to Claude in natural language, and it picks the right MemForge tool for you. Copy any prompt below into Claude Code. The Tool column shows what runs under the hood (handy for verifying which feature you're exercising).

1. Verify your setup (run these first)

PromptToolExpect
Check my MemForge status, tier, and quota.mem_statusConnectivity OK + your tier and observation count
Search my MemForge memory for anything about this repo.mem_semantic_searchA list of past observations (empty if brand new)

If mem_status returns connectivity OK, the plugin is working. New accounts start empty — your observations appear automatically after a few sessions (sync is background, no manual steps).

2. Search & recall

PromptTool
How did I fix the last deployment bug?mem_semantic_search (hybrid)
What did I work on yesterday? · …last week?mem_temporal_query
Find observations similar to "rate limiting strategy".mem_vector_search
Search my memory for the keyword "postgres".mem_search (full-text)
Show my 10 most recent observations.mem_semantic_recent
Show the context around observation 102945.mem_timeline

3. Cross-project & team

PromptTool
Find related work from my other projects about authentication.mem_cross_project
Search the team knowledge pool for our incident runbook.mem_team_knowledge (Team tier)

4. Knowledge graph

PromptTool
What is connected to the entity "Redis" in my memory?mem_entity_lookup
Show relationships where the predicate is "depends on".mem_triplets_query

5. Skills (SkillNet)

PromptTool
Search my skills for a database migration workflow.mem_skill_search
Browse the public skill catalog.mem_skill_discover
Turn my recent work into a reusable skill.mem_skill_create

6. Curate memory

PromptTool
Pin observation 102945 so it never gets archived.mem_pin
Mark observation 100200 as deprecated.mem_set_status
Observation 99000 is wrong — record the correction.mem_contradict
Which of my observations are oldest and unverified?mem_drift_check

Every tool response includes a suggested_next hint pointing you to the natural follow-up tool — so you can keep going without memorizing the catalog.


MCP Tools (30)

Search (start here)

ToolWhen to Use
mem_semantic_searchPrimary — use FIRST. Supports hybrid/fts/vector modes
mem_temporal_queryTime-based search ("yesterday", "last week", dates)
mem_hybrid_searchDedicated hybrid (backward compat — use semantic_search)
mem_vector_searchPure semantic similarity
mem_searchKeyword-only (FTS) with project/type filter

Retrieve

ToolPurpose
mem_semantic_getGet single observation by ID
mem_semantic_recentGet recent observations
mem_timelineGet context around an observation (before/after)
mem_get_observationsBatch fetch multiple observations by IDs

Memory Curation

ToolPurpose
mem_pinPin observation — protect from decay/archival
mem_set_importanceOverride importance score (0-1)
mem_set_event_dateSet temporal event date for time-based queries
mem_set_statusSet lifecycle status (active/deprecated/superseded/applied/archived)
mem_contradictMark stale + create correction observation
mem_drift_checkFind oldest unverified observations

Knowledge Graph

ToolPurpose
mem_entity_lookupFind all triplets mentioning an entity
mem_triplets_queryQuery subject-predicate-object relationships

Cross-Project & Team

ToolPurpose
mem_cross_projectFind related observations from other projects
mem_team_knowledgeSearch shared team knowledge pool
mem_stable_contextGet stable observation log (for prompt caching)

SkillNet

ToolPurpose
mem_skill_searchSearch skills by query, category, or tags
mem_skill_getGet a specific skill with full details
mem_skill_relatedFind related skills via graph traversal
mem_skill_createExtract a reusable skill from observations
mem_skill_discoverBrowse the public skill catalog

Data & Workflow

ToolPurpose
mem_ingestPush observations to the server
mem_workflow_suggestGet workflow suggestions based on context
mem_statusCheck config, connectivity, auth, tier, and quota

Session Continuity

ToolPurpose
mem_handoffWrite a session handoff (what's done, what's next, open loops)
mem_resumeResume work: latest handoff + open loops + prior handoffs + latest retrospective

All tool responses include workflow hints (suggested_next) guiding you to the right follow-up tool.

Commands

CommandPurpose
/forwardWrite a structured session handoff before ending/clearing (calls mem_handoff)
/resumeResume work: fetch latest handoff, open loops, recent context (calls mem_resume)
/retrospectiveWrite a first-person session retrospective — AI Diary + Honest Feedback (calls mem_ingest)

Tiers & Quotas

Your API key is associated with a tier that determines available features:

TierObservationsSearch ModesSynthesis/dayRate Limit
Free5,000FTS only1060/min
Pro100,000FTS + Vector + Hybrid200300/min
TeamUnlimitedAll + cross-userUnlimited600/min
EnterpriseUnlimitedAll + SSO + auditUnlimitedCustom

Run mem_status to see your current tier and quota usage. The server endpoints /api/auth/me, /api/account, and /api/user/me all return tier and quota details.


Configuration

Stored at ~/.memforge/config.json:

OptionDescriptionDefault
apiKeyYour MemForge API key(required)
serverUrlServer URLhttps://memclaude.thaicloud.ai
syncEnabledEnable background synctrue
pollIntervalSync interval in ms2000
roleclient or adminclient

For self-hosted servers, change serverUrl to your server URL.


How It Works

claude-mem (local) memforge-client (this plugin) MemForge Server
━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━
LLM creates structured → SyncPoller reads SQLite → POST /api/sync/push
observations in SQLite every 2-10s (adaptive) stores + embeds + extracts entities
30 MCP tools ←───────────── Search, curation, graph, skills
+ workflow hints + 15 background workers
  • claude-mem creates structured observations via LLM (haiku) — this is the data source
  • memforge-client syncs observations to the server AND provides search tools
  • MemForge Server stores data in PostgreSQL + pgvector, provides search APIs

Sync runs in-process with the MCP server. No separate daemon or background process.


Troubleshooting

ProblemSolution
"Remote search not configured"Check ~/.memforge/config.json has valid apiKey
"Required: claude-mem plugin"Install: /plugin marketplace add thedotmack/claude-mem
"bun: command not found"Install: curl -fsSL https://bun.sh/install | bash
SSH error on plugin installUse HTTPS: claude plugin marketplace add pitimon/c-memforge
Sync not workingRun mem_status tool. Check syncEnabled: true in config
Slow searchUse mem_search (FTS) instead of vector. Add date filters. Lower limit
MCP server won't startMissing dependencies — see First-run dependency install below
MCP fails on Windows (≤ 2.10.0)The launcher used sh (absent on Windows). Update to v2.10.1+ (claude plugin install memforge-client@pitimon-c-memforge) and ensure bun is on PATH
Old observations not syncingRemove watermark file — see Backfill existing observations below
Claude Code hangs on startupclaude-mem smart-install.js runs bun install — wait 30-60s or check network
Old db-watcher zombie processSee Upgrading from v1.x below

First-run dependency install

After claude plugin install, the MCP server may fail to connect because dependencies aren't installed in the cache directory. Fix:

# macOS / Linux — find the cache directory and install dependenciescd~/.claude/plugins/cache/pitimon-c-memforge/memforge-client/*/
bun install
# Windows (PowerShell) — newest installed version
cd (Get-ChildItem"$env:USERPROFILE\.claude\plugins\cache\pitimon-c-memforge\memforge-client"|Sort-Object Name -Descending |Select-Object-First 1).FullName
bun install

Then reconnect: run /mcp in Claude Code and reconnect memforge, or restart Claude Code.

Backfill existing observations

If you installed c-memforge after using claude-mem for a while, your existing observations may not have synced. To backfill:

# Remove watermark — next startup will sync all observations from the beginning
rm -f ~/.memforge/.sync-watermark.json

Restart Claude Code. The SyncPoller will log:

[SyncPoller] Fresh install — backfilling N existing observations

Server-side deduplication prevents duplicates, so this is safe to run anytime.

Verify sync is actually working

If you suspect the observation count on the MemForge UI is lower than it should be, run mem_status — it includes a Pipeline Health section that pinpoints which layer is failing. The numbers you see will reflect your own activity:

### Pipeline Health
**Activity (last 24h):** N transcript file(s) modified
**Captured (last 24h):** M obs in claude-mem.db (latest id=…)
**Sync cursor:** obs #… (K unsynced)
**Server (lifetime):** … obs accepted
**Sync workers:** synced ok, 0 failed, 0 pending, circuit=closed
✓ Healthy — all 4 layers aligned.

The 4 layers form a pipeline. A gap between adjacent layers points at a specific failure mode:

GapSymptomLikely causeWhere to look
Atranscripts > 0 but Captured is 0 (or << transcripts)claude-mem hooks not running — observations are never produced locally~/.claude/settings.json PostToolUse hook + ~/.claude-mem/logs/
Bunsynced is large or circuit=opensync poller is behind or server unreachablesync-poller stderr; check connectivity in the same mem_status output
Cfailed > 0server rejected uploads (quota, auth, malformed payload)tier quota above; API key validity; server logs

This is the most common silent-failure mode: claude-mem hook misconfiguration produces no observations at all, yet mem_status connectivity/auth/sync all show GREEN. The Pipeline Health section is what makes Gap A visible.

If Captured keeps reporting 0 after Gap A is shown, re-check that claude-mem is installed and that ~/.claude-mem/claude-mem.db exists and is being written to (mtime should advance during use).

Upgrading from v1.x

v2.0+ moved sync into the MCP server process. If upgrading from v1.x, clean up legacy processes and files:

# Kill old daemon if still running
pkill -f db-watcher 2>/dev/null
# Remove old plugin cache (may spawn zombie db-watcher)
rm -rf ~/.claude/plugins/cache/pitimon-c-memforge/
# Remove legacy state files
rm -f ~/.memforge/.sync-queue.json
rm -f ~/.claude-mem/memforge-sync.pid ~/.claude-mem/memforge-sync.log

Then reinstall fresh:

claude plugin uninstall memforge-client@pitimon-c-memforge
claude plugin marketplace add pitimon/c-memforge
claude plugin install memforge-client@pitimon-c-memforge

Updating

claude plugin update pitimon-c-memforge

Config at ~/.memforge/config.json is preserved. Restart Claude Code after updating.


License

AGPL-3.0 — See LICENSE for details.

Credits

Development

See MAINTENANCE.md for architecture details, release runbook, and development setup.

About

MemForge Client - Persistent semantic memory for Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

MemForge Client

License: AGPL-3.0

Persistent semantic memory for Claude Code — search, recall, and connect knowledge across sessions and projects.

What You Can Do

  • Search memory across all your past sessions — by keyword, concept, or semantic similarity
  • Cross-project knowledge — find related work from other projects automatically
  • Team knowledge sharing — access shared knowledge pool from team members
  • Knowledge graph — query entity relationships and triplet connections
  • Automatic sync — observations sync to the server in the background, no manual steps

Installation

Codex

Codex uses the native package in .codex-plugin/ and the repo marketplace in .agents/plugins/marketplace.json:

codex plugin marketplace add https://github.com/pitimon/c-memforge.git
codex plugin add memforge-client@pitimon-c-memforge

To pin a release:

codex plugin marketplace add pitimon/c-memforge --ref v2.14.1
codex plugin add memforge-client@pitimon-c-memforge

Configure credentials in ~/.memforge/config.json as shown below, then start a new Codex thread so the MCP server is loaded. The Codex package exposes the MemForge MCP tools; Claude Code hook behavior remains Claude Code-specific.

Claude Code

Prerequisites

  1. Bun runtime (the MCP server runs on bun — node cannot substitute):

    • macOS / Linux: curl -fsSL https://bun.sh/install | bash
    • Windows (PowerShell): powershell -c "irm bun.sh/install.ps1 | iex"

    Ensure both bun and node are on your PATH — verify with bun --version and node --version. (Windows note: the MCP launcher no longer needs a Unix shell as of v2.10.1; earlier versions launched via sh, which Windows lacks, so the MCP server failed to start.)

  2. claude-mem plugin: /plugin marketplace add thedotmack/claude-mem

Step 1: Add Marketplace + Install Plugin

Run these commands in your terminal (not inside Claude Code):

# Add the marketplace source
claude plugin marketplace add pitimon/c-memforge
# Install the plugin
claude plugin install memforge-client@pitimon-c-memforge

Step 2: Configure API Key

Get your API key at https://memclaude.thaicloud.ai/settings, then create the config:

mkdir -p ~/.memforge
cat >~/.memforge/config.json << 'EOF'{ "apiKey": "your-api-key-here", "serverUrl": "https://memclaude.thaicloud.ai", "syncEnabled": true, "pollInterval": 2000, "role": "client"}EOF

Step 3: Restart Claude Code

Restart to load the plugin. Verify with mem_status tool — should show connectivity OK.


Try It — Example Prompts

You don't call tools directly — just talk to Claude in natural language, and it picks the right MemForge tool for you. Copy any prompt below into Claude Code. The Tool column shows what runs under the hood (handy for verifying which feature you're exercising).

1. Verify your setup (run these first)

PromptToolExpect
Check my MemForge status, tier, and quota.mem_statusConnectivity OK + your tier and observation count
Search my MemForge memory for anything about this repo.mem_semantic_searchA list of past observations (empty if brand new)

If mem_status returns connectivity OK, the plugin is working. New accounts start empty — your observations appear automatically after a few sessions (sync is background, no manual steps).

2. Search & recall

PromptTool
How did I fix the last deployment bug?mem_semantic_search (hybrid)
What did I work on yesterday? · …last week?mem_temporal_query
Find observations similar to "rate limiting strategy".mem_vector_search
Search my memory for the keyword "postgres".mem_search (full-text)
Show my 10 most recent observations.mem_semantic_recent
Show the context around observation 102945.mem_timeline

3. Cross-project & team

PromptTool
Find related work from my other projects about authentication.mem_cross_project
Search the team knowledge pool for our incident runbook.mem_team_knowledge (Team tier)

4. Knowledge graph

PromptTool
What is connected to the entity "Redis" in my memory?mem_entity_lookup
Show relationships where the predicate is "depends on".mem_triplets_query

5. Skills (SkillNet)

PromptTool
Search my skills for a database migration workflow.mem_skill_search
Browse the public skill catalog.mem_skill_discover
Turn my recent work into a reusable skill.mem_skill_create

6. Curate memory

PromptTool
Pin observation 102945 so it never gets archived.mem_pin
Mark observation 100200 as deprecated.mem_set_status
Observation 99000 is wrong — record the correction.mem_contradict
Which of my observations are oldest and unverified?mem_drift_check

Every tool response includes a suggested_next hint pointing you to the natural follow-up tool — so you can keep going without memorizing the catalog.


MCP Tools (30)

Search (start here)

ToolWhen to Use
mem_semantic_searchPrimary — use FIRST. Supports hybrid/fts/vector modes
mem_temporal_queryTime-based search ("yesterday", "last week", dates)
mem_hybrid_searchDedicated hybrid (backward compat — use semantic_search)
mem_vector_searchPure semantic similarity
mem_searchKeyword-only (FTS) with project/type filter

Retrieve

ToolPurpose
mem_semantic_getGet single observation by ID
mem_semantic_recentGet recent observations
mem_timelineGet context around an observation (before/after)
mem_get_observationsBatch fetch multiple observations by IDs

Memory Curation

ToolPurpose
mem_pinPin observation — protect from decay/archival
mem_set_importanceOverride importance score (0-1)
mem_set_event_dateSet temporal event date for time-based queries
mem_set_statusSet lifecycle status (active/deprecated/superseded/applied/archived)
mem_contradictMark stale + create correction observation
mem_drift_checkFind oldest unverified observations

Knowledge Graph

ToolPurpose
mem_entity_lookupFind all triplets mentioning an entity
mem_triplets_queryQuery subject-predicate-object relationships

Cross-Project & Team

ToolPurpose
mem_cross_projectFind related observations from other projects
mem_team_knowledgeSearch shared team knowledge pool
mem_stable_contextGet stable observation log (for prompt caching)

SkillNet

ToolPurpose
mem_skill_searchSearch skills by query, category, or tags
mem_skill_getGet a specific skill with full details
mem_skill_relatedFind related skills via graph traversal
mem_skill_createExtract a reusable skill from observations
mem_skill_discoverBrowse the public skill catalog

Data & Workflow

ToolPurpose
mem_ingestPush observations to the server
mem_workflow_suggestGet workflow suggestions based on context
mem_statusCheck config, connectivity, auth, tier, and quota

Session Continuity

ToolPurpose
mem_handoffWrite a session handoff (what's done, what's next, open loops)
mem_resumeResume work: latest handoff + open loops + prior handoffs + latest retrospective

All tool responses include workflow hints (suggested_next) guiding you to the right follow-up tool.

Commands

CommandPurpose
/forwardWrite a structured session handoff before ending/clearing (calls mem_handoff)
/resumeResume work: fetch latest handoff, open loops, recent context (calls mem_resume)
/retrospectiveWrite a first-person session retrospective — AI Diary + Honest Feedback (calls mem_ingest)

Tiers & Quotas

Your API key is associated with a tier that determines available features:

TierObservationsSearch ModesSynthesis/dayRate Limit
Free5,000FTS only1060/min
Pro100,000FTS + Vector + Hybrid200300/min
TeamUnlimitedAll + cross-userUnlimited600/min
EnterpriseUnlimitedAll + SSO + auditUnlimitedCustom

Run mem_status to see your current tier and quota usage. The server endpoints /api/auth/me, /api/account, and /api/user/me all return tier and quota details.


Configuration

Stored at ~/.memforge/config.json:

OptionDescriptionDefault
apiKeyYour MemForge API key(required)
serverUrlServer URLhttps://memclaude.thaicloud.ai
syncEnabledEnable background synctrue
pollIntervalSync interval in ms2000
roleclient or adminclient

For self-hosted servers, change serverUrl to your server URL.


How It Works

claude-mem (local) memforge-client (this plugin) MemForge Server
━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━
LLM creates structured → SyncPoller reads SQLite → POST /api/sync/push
observations in SQLite every 2-10s (adaptive) stores + embeds + extracts entities
30 MCP tools ←───────────── Search, curation, graph, skills
+ workflow hints + 15 background workers
  • claude-mem creates structured observations via LLM (haiku) — this is the data source
  • memforge-client syncs observations to the server AND provides search tools
  • MemForge Server stores data in PostgreSQL + pgvector, provides search APIs

Sync runs in-process with the MCP server. No separate daemon or background process.


Troubleshooting

ProblemSolution
"Remote search not configured"Check ~/.memforge/config.json has valid apiKey
"Required: claude-mem plugin"Install: /plugin marketplace add thedotmack/claude-mem
"bun: command not found"Install: curl -fsSL https://bun.sh/install | bash
SSH error on plugin installUse HTTPS: claude plugin marketplace add pitimon/c-memforge
Sync not workingRun mem_status tool. Check syncEnabled: true in config
Slow searchUse mem_search (FTS) instead of vector. Add date filters. Lower limit
MCP server won't startMissing dependencies — see First-run dependency install below
MCP fails on Windows (≤ 2.10.0)The launcher used sh (absent on Windows). Update to v2.10.1+ (claude plugin install memforge-client@pitimon-c-memforge) and ensure bun is on PATH
Old observations not syncingRemove watermark file — see Backfill existing observations below
Claude Code hangs on startupclaude-mem smart-install.js runs bun install — wait 30-60s or check network
Old db-watcher zombie processSee Upgrading from v1.x below

First-run dependency install

After claude plugin install, the MCP server may fail to connect because dependencies aren't installed in the cache directory. Fix:

# macOS / Linux — find the cache directory and install dependenciescd~/.claude/plugins/cache/pitimon-c-memforge/memforge-client/*/
bun install
# Windows (PowerShell) — newest installed version
cd (Get-ChildItem"$env:USERPROFILE\.claude\plugins\cache\pitimon-c-memforge\memforge-client"|Sort-Object Name -Descending |Select-Object-First 1).FullName
bun install

Then reconnect: run /mcp in Claude Code and reconnect memforge, or restart Claude Code.

Backfill existing observations

If you installed c-memforge after using claude-mem for a while, your existing observations may not have synced. To backfill:

# Remove watermark — next startup will sync all observations from the beginning
rm -f ~/.memforge/.sync-watermark.json

Restart Claude Code. The SyncPoller will log:

[SyncPoller] Fresh install — backfilling N existing observations

Server-side deduplication prevents duplicates, so this is safe to run anytime.

Verify sync is actually working

If you suspect the observation count on the MemForge UI is lower than it should be, run mem_status — it includes a Pipeline Health section that pinpoints which layer is failing. The numbers you see will reflect your own activity:

### Pipeline Health
**Activity (last 24h):** N transcript file(s) modified
**Captured (last 24h):** M obs in claude-mem.db (latest id=…)
**Sync cursor:** obs #… (K unsynced)
**Server (lifetime):** … obs accepted
**Sync workers:** synced ok, 0 failed, 0 pending, circuit=closed
✓ Healthy — all 4 layers aligned.

The 4 layers form a pipeline. A gap between adjacent layers points at a specific failure mode:

GapSymptomLikely causeWhere to look
Atranscripts > 0 but Captured is 0 (or << transcripts)claude-mem hooks not running — observations are never produced locally~/.claude/settings.json PostToolUse hook + ~/.claude-mem/logs/
Bunsynced is large or circuit=opensync poller is behind or server unreachablesync-poller stderr; check connectivity in the same mem_status output
Cfailed > 0server rejected uploads (quota, auth, malformed payload)tier quota above; API key validity; server logs

This is the most common silent-failure mode: claude-mem hook misconfiguration produces no observations at all, yet mem_status connectivity/auth/sync all show GREEN. The Pipeline Health section is what makes Gap A visible.

If Captured keeps reporting 0 after Gap A is shown, re-check that claude-mem is installed and that ~/.claude-mem/claude-mem.db exists and is being written to (mtime should advance during use).

Upgrading from v1.x

v2.0+ moved sync into the MCP server process. If upgrading from v1.x, clean up legacy processes and files:

# Kill old daemon if still running
pkill -f db-watcher 2>/dev/null
# Remove old plugin cache (may spawn zombie db-watcher)
rm -rf ~/.claude/plugins/cache/pitimon-c-memforge/
# Remove legacy state files
rm -f ~/.memforge/.sync-queue.json
rm -f ~/.claude-mem/memforge-sync.pid ~/.claude-mem/memforge-sync.log

Then reinstall fresh:

claude plugin uninstall memforge-client@pitimon-c-memforge
claude plugin marketplace add pitimon/c-memforge
claude plugin install memforge-client@pitimon-c-memforge

Updating

claude plugin update pitimon-c-memforge

Config at ~/.memforge/config.json is preserved. Restart Claude Code after updating.


License

AGPL-3.0 — See LICENSE for details.

Credits

Development

See MAINTENANCE.md for architecture details, release runbook, and development setup.

About

MemForge Client - Persistent semantic memory for Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

MemForge Client

License: AGPL-3.0

Persistent semantic memory for Claude Code — search, recall, and connect knowledge across sessions and projects.

What You Can Do

  • Search memory across all your past sessions — by keyword, concept, or semantic similarity
  • Cross-project knowledge — find related work from other projects automatically
  • Team knowledge sharing — access shared knowledge pool from team members
  • Knowledge graph — query entity relationships and triplet connections
  • Automatic sync — observations sync to the server in the background, no manual steps

Installation

Codex

Codex uses the native package in .codex-plugin/ and the repo marketplace in .agents/plugins/marketplace.json:

codex plugin marketplace add https://github.com/pitimon/c-memforge.git
codex plugin add memforge-client@pitimon-c-memforge

To pin a release:

codex plugin marketplace add pitimon/c-memforge --ref v2.14.1
codex plugin add memforge-client@pitimon-c-memforge

Configure credentials in ~/.memforge/config.json as shown below, then start a new Codex thread so the MCP server is loaded. The Codex package exposes the MemForge MCP tools; Claude Code hook behavior remains Claude Code-specific.

Claude Code

Prerequisites

  1. Bun runtime (the MCP server runs on bun — node cannot substitute):

    • macOS / Linux: curl -fsSL https://bun.sh/install | bash
    • Windows (PowerShell): powershell -c "irm bun.sh/install.ps1 | iex"

    Ensure both bun and node are on your PATH — verify with bun --version and node --version. (Windows note: the MCP launcher no longer needs a Unix shell as of v2.10.1; earlier versions launched via sh, which Windows lacks, so the MCP server failed to start.)

  2. claude-mem plugin: /plugin marketplace add thedotmack/claude-mem

Step 1: Add Marketplace + Install Plugin

Run these commands in your terminal (not inside Claude Code):

# Add the marketplace source
claude plugin marketplace add pitimon/c-memforge
# Install the plugin
claude plugin install memforge-client@pitimon-c-memforge

Step 2: Configure API Key

Get your API key at https://memclaude.thaicloud.ai/settings, then create the config:

mkdir -p ~/.memforge
cat >~/.memforge/config.json << 'EOF'{ "apiKey": "your-api-key-here", "serverUrl": "https://memclaude.thaicloud.ai", "syncEnabled": true, "pollInterval": 2000, "role": "client"}EOF

Step 3: Restart Claude Code

Restart to load the plugin. Verify with mem_status tool — should show connectivity OK.


Try It — Example Prompts

You don't call tools directly — just talk to Claude in natural language, and it picks the right MemForge tool for you. Copy any prompt below into Claude Code. The Tool column shows what runs under the hood (handy for verifying which feature you're exercising).

1. Verify your setup (run these first)

PromptToolExpect
Check my MemForge status, tier, and quota.mem_statusConnectivity OK + your tier and observation count
Search my MemForge memory for anything about this repo.mem_semantic_searchA list of past observations (empty if brand new)

If mem_status returns connectivity OK, the plugin is working. New accounts start empty — your observations appear automatically after a few sessions (sync is background, no manual steps).

2. Search & recall

PromptTool
How did I fix the last deployment bug?mem_semantic_search (hybrid)
What did I work on yesterday? · …last week?mem_temporal_query
Find observations similar to "rate limiting strategy".mem_vector_search
Search my memory for the keyword "postgres".mem_search (full-text)
Show my 10 most recent observations.mem_semantic_recent
Show the context around observation 102945.mem_timeline

3. Cross-project & team

PromptTool
Find related work from my other projects about authentication.mem_cross_project
Search the team knowledge pool for our incident runbook.mem_team_knowledge (Team tier)

4. Knowledge graph

PromptTool
What is connected to the entity "Redis" in my memory?mem_entity_lookup
Show relationships where the predicate is "depends on".mem_triplets_query

5. Skills (SkillNet)

PromptTool
Search my skills for a database migration workflow.mem_skill_search
Browse the public skill catalog.mem_skill_discover
Turn my recent work into a reusable skill.mem_skill_create

6. Curate memory

PromptTool
Pin observation 102945 so it never gets archived.mem_pin
Mark observation 100200 as deprecated.mem_set_status
Observation 99000 is wrong — record the correction.mem_contradict
Which of my observations are oldest and unverified?mem_drift_check

Every tool response includes a suggested_next hint pointing you to the natural follow-up tool — so you can keep going without memorizing the catalog.


MCP Tools (30)

Search (start here)

ToolWhen to Use
mem_semantic_searchPrimary — use FIRST. Supports hybrid/fts/vector modes
mem_temporal_queryTime-based search ("yesterday", "last week", dates)
mem_hybrid_searchDedicated hybrid (backward compat — use semantic_search)
mem_vector_searchPure semantic similarity
mem_searchKeyword-only (FTS) with project/type filter

Retrieve

ToolPurpose
mem_semantic_getGet single observation by ID
mem_semantic_recentGet recent observations
mem_timelineGet context around an observation (before/after)
mem_get_observationsBatch fetch multiple observations by IDs

Memory Curation

ToolPurpose
mem_pinPin observation — protect from decay/archival
mem_set_importanceOverride importance score (0-1)
mem_set_event_dateSet temporal event date for time-based queries
mem_set_statusSet lifecycle status (active/deprecated/superseded/applied/archived)
mem_contradictMark stale + create correction observation
mem_drift_checkFind oldest unverified observations

Knowledge Graph

ToolPurpose
mem_entity_lookupFind all triplets mentioning an entity
mem_triplets_queryQuery subject-predicate-object relationships

Cross-Project & Team

ToolPurpose
mem_cross_projectFind related observations from other projects
mem_team_knowledgeSearch shared team knowledge pool
mem_stable_contextGet stable observation log (for prompt caching)

SkillNet

ToolPurpose
mem_skill_searchSearch skills by query, category, or tags
mem_skill_getGet a specific skill with full details
mem_skill_relatedFind related skills via graph traversal
mem_skill_createExtract a reusable skill from observations
mem_skill_discoverBrowse the public skill catalog

Data & Workflow

ToolPurpose
mem_ingestPush observations to the server
mem_workflow_suggestGet workflow suggestions based on context
mem_statusCheck config, connectivity, auth, tier, and quota

Session Continuity

ToolPurpose
mem_handoffWrite a session handoff (what's done, what's next, open loops)
mem_resumeResume work: latest handoff + open loops + prior handoffs + latest retrospective

All tool responses include workflow hints (suggested_next) guiding you to the right follow-up tool.

Commands

CommandPurpose
/forwardWrite a structured session handoff before ending/clearing (calls mem_handoff)
/resumeResume work: fetch latest handoff, open loops, recent context (calls mem_resume)
/retrospectiveWrite a first-person session retrospective — AI Diary + Honest Feedback (calls mem_ingest)

Tiers & Quotas

Your API key is associated with a tier that determines available features:

TierObservationsSearch ModesSynthesis/dayRate Limit
Free5,000FTS only1060/min
Pro100,000FTS + Vector + Hybrid200300/min
TeamUnlimitedAll + cross-userUnlimited600/min
EnterpriseUnlimitedAll + SSO + auditUnlimitedCustom

Run mem_status to see your current tier and quota usage. The server endpoints /api/auth/me, /api/account, and /api/user/me all return tier and quota details.


Configuration

Stored at ~/.memforge/config.json:

OptionDescriptionDefault
apiKeyYour MemForge API key(required)
serverUrlServer URLhttps://memclaude.thaicloud.ai
syncEnabledEnable background synctrue
pollIntervalSync interval in ms2000
roleclient or adminclient

For self-hosted servers, change serverUrl to your server URL.


How It Works

claude-mem (local) memforge-client (this plugin) MemForge Server
━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━
LLM creates structured → SyncPoller reads SQLite → POST /api/sync/push
observations in SQLite every 2-10s (adaptive) stores + embeds + extracts entities
30 MCP tools ←───────────── Search, curation, graph, skills
+ workflow hints + 15 background workers
  • claude-mem creates structured observations via LLM (haiku) — this is the data source
  • memforge-client syncs observations to the server AND provides search tools
  • MemForge Server stores data in PostgreSQL + pgvector, provides search APIs

Sync runs in-process with the MCP server. No separate daemon or background process.


Troubleshooting

ProblemSolution
"Remote search not configured"Check ~/.memforge/config.json has valid apiKey
"Required: claude-mem plugin"Install: /plugin marketplace add thedotmack/claude-mem
"bun: command not found"Install: curl -fsSL https://bun.sh/install | bash
SSH error on plugin installUse HTTPS: claude plugin marketplace add pitimon/c-memforge
Sync not workingRun mem_status tool. Check syncEnabled: true in config
Slow searchUse mem_search (FTS) instead of vector. Add date filters. Lower limit
MCP server won't startMissing dependencies — see First-run dependency install below
MCP fails on Windows (≤ 2.10.0)The launcher used sh (absent on Windows). Update to v2.10.1+ (claude plugin install memforge-client@pitimon-c-memforge) and ensure bun is on PATH
Old observations not syncingRemove watermark file — see Backfill existing observations below
Claude Code hangs on startupclaude-mem smart-install.js runs bun install — wait 30-60s or check network
Old db-watcher zombie processSee Upgrading from v1.x below

First-run dependency install

After claude plugin install, the MCP server may fail to connect because dependencies aren't installed in the cache directory. Fix:

# macOS / Linux — find the cache directory and install dependenciescd~/.claude/plugins/cache/pitimon-c-memforge/memforge-client/*/
bun install
# Windows (PowerShell) — newest installed version
cd (Get-ChildItem"$env:USERPROFILE\.claude\plugins\cache\pitimon-c-memforge\memforge-client"|Sort-Object Name -Descending |Select-Object-First 1).FullName
bun install

Then reconnect: run /mcp in Claude Code and reconnect memforge, or restart Claude Code.

Backfill existing observations

If you installed c-memforge after using claude-mem for a while, your existing observations may not have synced. To backfill:

# Remove watermark — next startup will sync all observations from the beginning
rm -f ~/.memforge/.sync-watermark.json

Restart Claude Code. The SyncPoller will log:

[SyncPoller] Fresh install — backfilling N existing observations

Server-side deduplication prevents duplicates, so this is safe to run anytime.

Verify sync is actually working

If you suspect the observation count on the MemForge UI is lower than it should be, run mem_status — it includes a Pipeline Health section that pinpoints which layer is failing. The numbers you see will reflect your own activity:

### Pipeline Health
**Activity (last 24h):** N transcript file(s) modified
**Captured (last 24h):** M obs in claude-mem.db (latest id=…)
**Sync cursor:** obs #… (K unsynced)
**Server (lifetime):** … obs accepted
**Sync workers:** synced ok, 0 failed, 0 pending, circuit=closed
✓ Healthy — all 4 layers aligned.

The 4 layers form a pipeline. A gap between adjacent layers points at a specific failure mode:

GapSymptomLikely causeWhere to look
Atranscripts > 0 but Captured is 0 (or << transcripts)claude-mem hooks not running — observations are never produced locally~/.claude/settings.json PostToolUse hook + ~/.claude-mem/logs/
Bunsynced is large or circuit=opensync poller is behind or server unreachablesync-poller stderr; check connectivity in the same mem_status output
Cfailed > 0server rejected uploads (quota, auth, malformed payload)tier quota above; API key validity; server logs

This is the most common silent-failure mode: claude-mem hook misconfiguration produces no observations at all, yet mem_status connectivity/auth/sync all show GREEN. The Pipeline Health section is what makes Gap A visible.

If Captured keeps reporting 0 after Gap A is shown, re-check that claude-mem is installed and that ~/.claude-mem/claude-mem.db exists and is being written to (mtime should advance during use).

Upgrading from v1.x

v2.0+ moved sync into the MCP server process. If upgrading from v1.x, clean up legacy processes and files:

# Kill old daemon if still running
pkill -f db-watcher 2>/dev/null
# Remove old plugin cache (may spawn zombie db-watcher)
rm -rf ~/.claude/plugins/cache/pitimon-c-memforge/
# Remove legacy state files
rm -f ~/.memforge/.sync-queue.json
rm -f ~/.claude-mem/memforge-sync.pid ~/.claude-mem/memforge-sync.log

Then reinstall fresh:

claude plugin uninstall memforge-client@pitimon-c-memforge
claude plugin marketplace add pitimon/c-memforge
claude plugin install memforge-client@pitimon-c-memforge

Updating

claude plugin update pitimon-c-memforge

Config at ~/.memforge/config.json is preserved. Restart Claude Code after updating.


License

AGPL-3.0 — See LICENSE for details.

Credits

Development

See MAINTENANCE.md for architecture details, release runbook, and development setup.

About

MemForge Client - Persistent semantic memory for Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

MemForge Client

License: AGPL-3.0

Persistent semantic memory for Claude Code — search, recall, and connect knowledge across sessions and projects.

What You Can Do

  • Search memory across all your past sessions — by keyword, concept, or semantic similarity
  • Cross-project knowledge — find related work from other projects automatically
  • Team knowledge sharing — access shared knowledge pool from team members
  • Knowledge graph — query entity relationships and triplet connections
  • Automatic sync — observations sync to the server in the background, no manual steps

Installation

Codex

Codex uses the native package in .codex-plugin/ and the repo marketplace in .agents/plugins/marketplace.json:

codex plugin marketplace add https://github.com/pitimon/c-memforge.git
codex plugin add memforge-client@pitimon-c-memforge

To pin a release:

codex plugin marketplace add pitimon/c-memforge --ref v2.14.1
codex plugin add memforge-client@pitimon-c-memforge

Configure credentials in ~/.memforge/config.json as shown below, then start a new Codex thread so the MCP server is loaded. The Codex package exposes the MemForge MCP tools; Claude Code hook behavior remains Claude Code-specific.

Claude Code

Prerequisites

  1. Bun runtime (the MCP server runs on bun — node cannot substitute):

    • macOS / Linux: curl -fsSL https://bun.sh/install | bash
    • Windows (PowerShell): powershell -c "irm bun.sh/install.ps1 | iex"

    Ensure both bun and node are on your PATH — verify with bun --version and node --version. (Windows note: the MCP launcher no longer needs a Unix shell as of v2.10.1; earlier versions launched via sh, which Windows lacks, so the MCP server failed to start.)

  2. claude-mem plugin: /plugin marketplace add thedotmack/claude-mem

Step 1: Add Marketplace + Install Plugin

Run these commands in your terminal (not inside Claude Code):

# Add the marketplace source
claude plugin marketplace add pitimon/c-memforge
# Install the plugin
claude plugin install memforge-client@pitimon-c-memforge

Step 2: Configure API Key

Get your API key at https://memclaude.thaicloud.ai/settings, then create the config:

mkdir -p ~/.memforge
cat >~/.memforge/config.json << 'EOF'{ "apiKey": "your-api-key-here", "serverUrl": "https://memclaude.thaicloud.ai", "syncEnabled": true, "pollInterval": 2000, "role": "client"}EOF

Step 3: Restart Claude Code

Restart to load the plugin. Verify with mem_status tool — should show connectivity OK.


Try It — Example Prompts

You don't call tools directly — just talk to Claude in natural language, and it picks the right MemForge tool for you. Copy any prompt below into Claude Code. The Tool column shows what runs under the hood (handy for verifying which feature you're exercising).

1. Verify your setup (run these first)

PromptToolExpect
Check my MemForge status, tier, and quota.mem_statusConnectivity OK + your tier and observation count
Search my MemForge memory for anything about this repo.mem_semantic_searchA list of past observations (empty if brand new)

If mem_status returns connectivity OK, the plugin is working. New accounts start empty — your observations appear automatically after a few sessions (sync is background, no manual steps).

2. Search & recall

PromptTool
How did I fix the last deployment bug?mem_semantic_search (hybrid)
What did I work on yesterday? · …last week?mem_temporal_query
Find observations similar to "rate limiting strategy".mem_vector_search
Search my memory for the keyword "postgres".mem_search (full-text)
Show my 10 most recent observations.mem_semantic_recent
Show the context around observation 102945.mem_timeline

3. Cross-project & team

PromptTool
Find related work from my other projects about authentication.mem_cross_project
Search the team knowledge pool for our incident runbook.mem_team_knowledge (Team tier)

4. Knowledge graph

PromptTool
What is connected to the entity "Redis" in my memory?mem_entity_lookup
Show relationships where the predicate is "depends on".mem_triplets_query

5. Skills (SkillNet)

PromptTool
Search my skills for a database migration workflow.mem_skill_search
Browse the public skill catalog.mem_skill_discover
Turn my recent work into a reusable skill.mem_skill_create

6. Curate memory

PromptTool
Pin observation 102945 so it never gets archived.mem_pin
Mark observation 100200 as deprecated.mem_set_status
Observation 99000 is wrong — record the correction.mem_contradict
Which of my observations are oldest and unverified?mem_drift_check

Every tool response includes a suggested_next hint pointing you to the natural follow-up tool — so you can keep going without memorizing the catalog.


MCP Tools (30)

Search (start here)

ToolWhen to Use
mem_semantic_searchPrimary — use FIRST. Supports hybrid/fts/vector modes
mem_temporal_queryTime-based search ("yesterday", "last week", dates)
mem_hybrid_searchDedicated hybrid (backward compat — use semantic_search)
mem_vector_searchPure semantic similarity
mem_searchKeyword-only (FTS) with project/type filter

Retrieve

ToolPurpose
mem_semantic_getGet single observation by ID
mem_semantic_recentGet recent observations
mem_timelineGet context around an observation (before/after)
mem_get_observationsBatch fetch multiple observations by IDs

Memory Curation

ToolPurpose
mem_pinPin observation — protect from decay/archival
mem_set_importanceOverride importance score (0-1)
mem_set_event_dateSet temporal event date for time-based queries
mem_set_statusSet lifecycle status (active/deprecated/superseded/applied/archived)
mem_contradictMark stale + create correction observation
mem_drift_checkFind oldest unverified observations

Knowledge Graph

ToolPurpose
mem_entity_lookupFind all triplets mentioning an entity
mem_triplets_queryQuery subject-predicate-object relationships

Cross-Project & Team

ToolPurpose
mem_cross_projectFind related observations from other projects
mem_team_knowledgeSearch shared team knowledge pool
mem_stable_contextGet stable observation log (for prompt caching)

SkillNet

ToolPurpose
mem_skill_searchSearch skills by query, category, or tags
mem_skill_getGet a specific skill with full details
mem_skill_relatedFind related skills via graph traversal
mem_skill_createExtract a reusable skill from observations
mem_skill_discoverBrowse the public skill catalog

Data & Workflow

ToolPurpose
mem_ingestPush observations to the server
mem_workflow_suggestGet workflow suggestions based on context
mem_statusCheck config, connectivity, auth, tier, and quota

Session Continuity

ToolPurpose
mem_handoffWrite a session handoff (what's done, what's next, open loops)
mem_resumeResume work: latest handoff + open loops + prior handoffs + latest retrospective

All tool responses include workflow hints (suggested_next) guiding you to the right follow-up tool.

Commands

CommandPurpose
/forwardWrite a structured session handoff before ending/clearing (calls mem_handoff)
/resumeResume work: fetch latest handoff, open loops, recent context (calls mem_resume)
/retrospectiveWrite a first-person session retrospective — AI Diary + Honest Feedback (calls mem_ingest)

Tiers & Quotas

Your API key is associated with a tier that determines available features:

TierObservationsSearch ModesSynthesis/dayRate Limit
Free5,000FTS only1060/min
Pro100,000FTS + Vector + Hybrid200300/min
TeamUnlimitedAll + cross-userUnlimited600/min
EnterpriseUnlimitedAll + SSO + auditUnlimitedCustom

Run mem_status to see your current tier and quota usage. The server endpoints /api/auth/me, /api/account, and /api/user/me all return tier and quota details.


Configuration

Stored at ~/.memforge/config.json:

OptionDescriptionDefault
apiKeyYour MemForge API key(required)
serverUrlServer URLhttps://memclaude.thaicloud.ai
syncEnabledEnable background synctrue
pollIntervalSync interval in ms2000
roleclient or adminclient

For self-hosted servers, change serverUrl to your server URL.


How It Works

claude-mem (local) memforge-client (this plugin) MemForge Server
━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━
LLM creates structured → SyncPoller reads SQLite → POST /api/sync/push
observations in SQLite every 2-10s (adaptive) stores + embeds + extracts entities
30 MCP tools ←───────────── Search, curation, graph, skills
+ workflow hints + 15 background workers
  • claude-mem creates structured observations via LLM (haiku) — this is the data source
  • memforge-client syncs observations to the server AND provides search tools
  • MemForge Server stores data in PostgreSQL + pgvector, provides search APIs

Sync runs in-process with the MCP server. No separate daemon or background process.


Troubleshooting

ProblemSolution
"Remote search not configured"Check ~/.memforge/config.json has valid apiKey
"Required: claude-mem plugin"Install: /plugin marketplace add thedotmack/claude-mem
"bun: command not found"Install: curl -fsSL https://bun.sh/install | bash
SSH error on plugin installUse HTTPS: claude plugin marketplace add pitimon/c-memforge
Sync not workingRun mem_status tool. Check syncEnabled: true in config
Slow searchUse mem_search (FTS) instead of vector. Add date filters. Lower limit
MCP server won't startMissing dependencies — see First-run dependency install below
MCP fails on Windows (≤ 2.10.0)The launcher used sh (absent on Windows). Update to v2.10.1+ (claude plugin install memforge-client@pitimon-c-memforge) and ensure bun is on PATH
Old observations not syncingRemove watermark file — see Backfill existing observations below
Claude Code hangs on startupclaude-mem smart-install.js runs bun install — wait 30-60s or check network
Old db-watcher zombie processSee Upgrading from v1.x below

First-run dependency install

After claude plugin install, the MCP server may fail to connect because dependencies aren't installed in the cache directory. Fix:

# macOS / Linux — find the cache directory and install dependenciescd~/.claude/plugins/cache/pitimon-c-memforge/memforge-client/*/
bun install
# Windows (PowerShell) — newest installed version
cd (Get-ChildItem"$env:USERPROFILE\.claude\plugins\cache\pitimon-c-memforge\memforge-client"|Sort-Object Name -Descending |Select-Object-First 1).FullName
bun install

Then reconnect: run /mcp in Claude Code and reconnect memforge, or restart Claude Code.

Backfill existing observations

If you installed c-memforge after using claude-mem for a while, your existing observations may not have synced. To backfill:

# Remove watermark — next startup will sync all observations from the beginning
rm -f ~/.memforge/.sync-watermark.json

Restart Claude Code. The SyncPoller will log:

[SyncPoller] Fresh install — backfilling N existing observations

Server-side deduplication prevents duplicates, so this is safe to run anytime.

Verify sync is actually working

If you suspect the observation count on the MemForge UI is lower than it should be, run mem_status — it includes a Pipeline Health section that pinpoints which layer is failing. The numbers you see will reflect your own activity:

### Pipeline Health
**Activity (last 24h):** N transcript file(s) modified
**Captured (last 24h):** M obs in claude-mem.db (latest id=…)
**Sync cursor:** obs #… (K unsynced)
**Server (lifetime):** … obs accepted
**Sync workers:** synced ok, 0 failed, 0 pending, circuit=closed
✓ Healthy — all 4 layers aligned.

The 4 layers form a pipeline. A gap between adjacent layers points at a specific failure mode:

GapSymptomLikely causeWhere to look
Atranscripts > 0 but Captured is 0 (or << transcripts)claude-mem hooks not running — observations are never produced locally~/.claude/settings.json PostToolUse hook + ~/.claude-mem/logs/
Bunsynced is large or circuit=opensync poller is behind or server unreachablesync-poller stderr; check connectivity in the same mem_status output
Cfailed > 0server rejected uploads (quota, auth, malformed payload)tier quota above; API key validity; server logs

This is the most common silent-failure mode: claude-mem hook misconfiguration produces no observations at all, yet mem_status connectivity/auth/sync all show GREEN. The Pipeline Health section is what makes Gap A visible.

If Captured keeps reporting 0 after Gap A is shown, re-check that claude-mem is installed and that ~/.claude-mem/claude-mem.db exists and is being written to (mtime should advance during use).

Upgrading from v1.x

v2.0+ moved sync into the MCP server process. If upgrading from v1.x, clean up legacy processes and files:

# Kill old daemon if still running
pkill -f db-watcher 2>/dev/null
# Remove old plugin cache (may spawn zombie db-watcher)
rm -rf ~/.claude/plugins/cache/pitimon-c-memforge/
# Remove legacy state files
rm -f ~/.memforge/.sync-queue.json
rm -f ~/.claude-mem/memforge-sync.pid ~/.claude-mem/memforge-sync.log

Then reinstall fresh:

claude plugin uninstall memforge-client@pitimon-c-memforge
claude plugin marketplace add pitimon/c-memforge
claude plugin install memforge-client@pitimon-c-memforge

Updating

claude plugin update pitimon-c-memforge

Config at ~/.memforge/config.json is preserved. Restart Claude Code after updating.


License

AGPL-3.0 — See LICENSE for details.

Credits

Development

See MAINTENANCE.md for architecture details, release runbook, and development setup.

About

MemForge Client - Persistent semantic memory for Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

MemForge Client

License: AGPL-3.0

Persistent semantic memory for Claude Code — search, recall, and connect knowledge across sessions and projects.

What You Can Do

  • Search memory across all your past sessions — by keyword, concept, or semantic similarity
  • Cross-project knowledge — find related work from other projects automatically
  • Team knowledge sharing — access shared knowledge pool from team members
  • Knowledge graph — query entity relationships and triplet connections
  • Automatic sync — observations sync to the server in the background, no manual steps

Installation

Codex

Codex uses the native package in .codex-plugin/ and the repo marketplace in .agents/plugins/marketplace.json:

codex plugin marketplace add https://github.com/pitimon/c-memforge.git
codex plugin add memforge-client@pitimon-c-memforge

To pin a release:

codex plugin marketplace add pitimon/c-memforge --ref v2.14.1
codex plugin add memforge-client@pitimon-c-memforge

Configure credentials in ~/.memforge/config.json as shown below, then start a new Codex thread so the MCP server is loaded. The Codex package exposes the MemForge MCP tools; Claude Code hook behavior remains Claude Code-specific.

Claude Code

Prerequisites

  1. Bun runtime (the MCP server runs on bun — node cannot substitute):

    • macOS / Linux: curl -fsSL https://bun.sh/install | bash
    • Windows (PowerShell): powershell -c "irm bun.sh/install.ps1 | iex"

    Ensure both bun and node are on your PATH — verify with bun --version and node --version. (Windows note: the MCP launcher no longer needs a Unix shell as of v2.10.1; earlier versions launched via sh, which Windows lacks, so the MCP server failed to start.)

  2. claude-mem plugin: /plugin marketplace add thedotmack/claude-mem

Step 1: Add Marketplace + Install Plugin

Run these commands in your terminal (not inside Claude Code):

# Add the marketplace source
claude plugin marketplace add pitimon/c-memforge
# Install the plugin
claude plugin install memforge-client@pitimon-c-memforge

Step 2: Configure API Key

Get your API key at https://memclaude.thaicloud.ai/settings, then create the config:

mkdir -p ~/.memforge
cat >~/.memforge/config.json << 'EOF'{ "apiKey": "your-api-key-here", "serverUrl": "https://memclaude.thaicloud.ai", "syncEnabled": true, "pollInterval": 2000, "role": "client"}EOF

Step 3: Restart Claude Code

Restart to load the plugin. Verify with mem_status tool — should show connectivity OK.


Try It — Example Prompts

You don't call tools directly — just talk to Claude in natural language, and it picks the right MemForge tool for you. Copy any prompt below into Claude Code. The Tool column shows what runs under the hood (handy for verifying which feature you're exercising).

1. Verify your setup (run these first)

PromptToolExpect
Check my MemForge status, tier, and quota.mem_statusConnectivity OK + your tier and observation count
Search my MemForge memory for anything about this repo.mem_semantic_searchA list of past observations (empty if brand new)

If mem_status returns connectivity OK, the plugin is working. New accounts start empty — your observations appear automatically after a few sessions (sync is background, no manual steps).

2. Search & recall

PromptTool
How did I fix the last deployment bug?mem_semantic_search (hybrid)
What did I work on yesterday? · …last week?mem_temporal_query
Find observations similar to "rate limiting strategy".mem_vector_search
Search my memory for the keyword "postgres".mem_search (full-text)
Show my 10 most recent observations.mem_semantic_recent
Show the context around observation 102945.mem_timeline

3. Cross-project & team

PromptTool
Find related work from my other projects about authentication.mem_cross_project
Search the team knowledge pool for our incident runbook.mem_team_knowledge (Team tier)

4. Knowledge graph

PromptTool
What is connected to the entity "Redis" in my memory?mem_entity_lookup
Show relationships where the predicate is "depends on".mem_triplets_query

5. Skills (SkillNet)

PromptTool
Search my skills for a database migration workflow.mem_skill_search
Browse the public skill catalog.mem_skill_discover
Turn my recent work into a reusable skill.mem_skill_create

6. Curate memory

PromptTool
Pin observation 102945 so it never gets archived.mem_pin
Mark observation 100200 as deprecated.mem_set_status
Observation 99000 is wrong — record the correction.mem_contradict
Which of my observations are oldest and unverified?mem_drift_check

Every tool response includes a suggested_next hint pointing you to the natural follow-up tool — so you can keep going without memorizing the catalog.


MCP Tools (30)

Search (start here)

ToolWhen to Use
mem_semantic_searchPrimary — use FIRST. Supports hybrid/fts/vector modes
mem_temporal_queryTime-based search ("yesterday", "last week", dates)
mem_hybrid_searchDedicated hybrid (backward compat — use semantic_search)
mem_vector_searchPure semantic similarity
mem_searchKeyword-only (FTS) with project/type filter

Retrieve

ToolPurpose
mem_semantic_getGet single observation by ID
mem_semantic_recentGet recent observations
mem_timelineGet context around an observation (before/after)
mem_get_observationsBatch fetch multiple observations by IDs

Memory Curation

ToolPurpose
mem_pinPin observation — protect from decay/archival
mem_set_importanceOverride importance score (0-1)
mem_set_event_dateSet temporal event date for time-based queries
mem_set_statusSet lifecycle status (active/deprecated/superseded/applied/archived)
mem_contradictMark stale + create correction observation
mem_drift_checkFind oldest unverified observations

Knowledge Graph

ToolPurpose
mem_entity_lookupFind all triplets mentioning an entity
mem_triplets_queryQuery subject-predicate-object relationships

Cross-Project & Team

ToolPurpose
mem_cross_projectFind related observations from other projects
mem_team_knowledgeSearch shared team knowledge pool
mem_stable_contextGet stable observation log (for prompt caching)

SkillNet

ToolPurpose
mem_skill_searchSearch skills by query, category, or tags
mem_skill_getGet a specific skill with full details
mem_skill_relatedFind related skills via graph traversal
mem_skill_createExtract a reusable skill from observations
mem_skill_discoverBrowse the public skill catalog

Data & Workflow

ToolPurpose
mem_ingestPush observations to the server
mem_workflow_suggestGet workflow suggestions based on context
mem_statusCheck config, connectivity, auth, tier, and quota

Session Continuity

ToolPurpose
mem_handoffWrite a session handoff (what's done, what's next, open loops)
mem_resumeResume work: latest handoff + open loops + prior handoffs + latest retrospective

All tool responses include workflow hints (suggested_next) guiding you to the right follow-up tool.

Commands

CommandPurpose
/forwardWrite a structured session handoff before ending/clearing (calls mem_handoff)
/resumeResume work: fetch latest handoff, open loops, recent context (calls mem_resume)
/retrospectiveWrite a first-person session retrospective — AI Diary + Honest Feedback (calls mem_ingest)

Tiers & Quotas

Your API key is associated with a tier that determines available features:

TierObservationsSearch ModesSynthesis/dayRate Limit
Free5,000FTS only1060/min
Pro100,000FTS + Vector + Hybrid200300/min
TeamUnlimitedAll + cross-userUnlimited600/min
EnterpriseUnlimitedAll + SSO + auditUnlimitedCustom

Run mem_status to see your current tier and quota usage. The server endpoints /api/auth/me, /api/account, and /api/user/me all return tier and quota details.


Configuration

Stored at ~/.memforge/config.json:

OptionDescriptionDefault
apiKeyYour MemForge API key(required)
serverUrlServer URLhttps://memclaude.thaicloud.ai
syncEnabledEnable background synctrue
pollIntervalSync interval in ms2000
roleclient or adminclient

For self-hosted servers, change serverUrl to your server URL.


How It Works

claude-mem (local) memforge-client (this plugin) MemForge Server
━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━
LLM creates structured → SyncPoller reads SQLite → POST /api/sync/push
observations in SQLite every 2-10s (adaptive) stores + embeds + extracts entities
30 MCP tools ←───────────── Search, curation, graph, skills
+ workflow hints + 15 background workers
  • claude-mem creates structured observations via LLM (haiku) — this is the data source
  • memforge-client syncs observations to the server AND provides search tools
  • MemForge Server stores data in PostgreSQL + pgvector, provides search APIs

Sync runs in-process with the MCP server. No separate daemon or background process.


Troubleshooting

ProblemSolution
"Remote search not configured"Check ~/.memforge/config.json has valid apiKey
"Required: claude-mem plugin"Install: /plugin marketplace add thedotmack/claude-mem
"bun: command not found"Install: curl -fsSL https://bun.sh/install | bash
SSH error on plugin installUse HTTPS: claude plugin marketplace add pitimon/c-memforge
Sync not workingRun mem_status tool. Check syncEnabled: true in config
Slow searchUse mem_search (FTS) instead of vector. Add date filters. Lower limit
MCP server won't startMissing dependencies — see First-run dependency install below
MCP fails on Windows (≤ 2.10.0)The launcher used sh (absent on Windows). Update to v2.10.1+ (claude plugin install memforge-client@pitimon-c-memforge) and ensure bun is on PATH
Old observations not syncingRemove watermark file — see Backfill existing observations below
Claude Code hangs on startupclaude-mem smart-install.js runs bun install — wait 30-60s or check network
Old db-watcher zombie processSee Upgrading from v1.x below

First-run dependency install

After claude plugin install, the MCP server may fail to connect because dependencies aren't installed in the cache directory. Fix:

# macOS / Linux — find the cache directory and install dependenciescd~/.claude/plugins/cache/pitimon-c-memforge/memforge-client/*/
bun install
# Windows (PowerShell) — newest installed version
cd (Get-ChildItem"$env:USERPROFILE\.claude\plugins\cache\pitimon-c-memforge\memforge-client"|Sort-Object Name -Descending |Select-Object-First 1).FullName
bun install

Then reconnect: run /mcp in Claude Code and reconnect memforge, or restart Claude Code.

Backfill existing observations

If you installed c-memforge after using claude-mem for a while, your existing observations may not have synced. To backfill:

# Remove watermark — next startup will sync all observations from the beginning
rm -f ~/.memforge/.sync-watermark.json

Restart Claude Code. The SyncPoller will log:

[SyncPoller] Fresh install — backfilling N existing observations

Server-side deduplication prevents duplicates, so this is safe to run anytime.

Verify sync is actually working

If you suspect the observation count on the MemForge UI is lower than it should be, run mem_status — it includes a Pipeline Health section that pinpoints which layer is failing. The numbers you see will reflect your own activity:

### Pipeline Health
**Activity (last 24h):** N transcript file(s) modified
**Captured (last 24h):** M obs in claude-mem.db (latest id=…)
**Sync cursor:** obs #… (K unsynced)
**Server (lifetime):** … obs accepted
**Sync workers:** synced ok, 0 failed, 0 pending, circuit=closed
✓ Healthy — all 4 layers aligned.

The 4 layers form a pipeline. A gap between adjacent layers points at a specific failure mode:

GapSymptomLikely causeWhere to look
Atranscripts > 0 but Captured is 0 (or << transcripts)claude-mem hooks not running — observations are never produced locally~/.claude/settings.json PostToolUse hook + ~/.claude-mem/logs/
Bunsynced is large or circuit=opensync poller is behind or server unreachablesync-poller stderr; check connectivity in the same mem_status output
Cfailed > 0server rejected uploads (quota, auth, malformed payload)tier quota above; API key validity; server logs

This is the most common silent-failure mode: claude-mem hook misconfiguration produces no observations at all, yet mem_status connectivity/auth/sync all show GREEN. The Pipeline Health section is what makes Gap A visible.

If Captured keeps reporting 0 after Gap A is shown, re-check that claude-mem is installed and that ~/.claude-mem/claude-mem.db exists and is being written to (mtime should advance during use).

Upgrading from v1.x

v2.0+ moved sync into the MCP server process. If upgrading from v1.x, clean up legacy processes and files:

# Kill old daemon if still running
pkill -f db-watcher 2>/dev/null
# Remove old plugin cache (may spawn zombie db-watcher)
rm -rf ~/.claude/plugins/cache/pitimon-c-memforge/
# Remove legacy state files
rm -f ~/.memforge/.sync-queue.json
rm -f ~/.claude-mem/memforge-sync.pid ~/.claude-mem/memforge-sync.log

Then reinstall fresh:

claude plugin uninstall memforge-client@pitimon-c-memforge
claude plugin marketplace add pitimon/c-memforge
claude plugin install memforge-client@pitimon-c-memforge

Updating

claude plugin update pitimon-c-memforge

Config at ~/.memforge/config.json is preserved. Restart Claude Code after updating.


License

AGPL-3.0 — See LICENSE for details.

Credits

Development

See MAINTENANCE.md for architecture details, release runbook, and development setup.

About

MemForge Client - Persistent semantic memory for Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages