Before submitting
📝 Manual Bug Report
Bug Description
When claude-mem is installed alongside another plugin that has already registered hooks with
matcher: "*", the npx claude-mem repair command does not register claude-mem's hooks into
settings.json. This results in observations never being captured, making the memory system
non-functional.
Additionally, even after manually fixing the hooks registration, there's a model compatibility
issue: when using a corporate LLM proxy that doesn't support Claude models, the SDK returns 401
error and observations are discarded.
Steps to Reproduce
Part 1: Hooks not registered
- Install another plugin (e.g., a corporate wrapper like
my-corp-cli) that registers hooks with
matcher: "*" in settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "*",
"_source": "my-corp-cli",
"hooks": [...]
}
]
}
}
- Install claude-mem:
npx claude-mem install
- Run repair:
npx claude-mem repair
- Output shows success: claude-mem repair complete.
- Check settings.json - claude-mem hooks are NOT added.
Part 2: Model compatibility issue
- Configure gateway auth in ~/.claude-mem/.env:
ANTHROPIC_BASE_URL=http://your-corporate-llm-proxy.example.com
ANTHROPIC_AUTH_TOKEN=your-key
- Update ~/.claude-mem/settings.json:
{
"CLAUDE_MEM_PROVIDER": "claude",
"CLAUDE_MEM_CLAUDE_AUTH_METHOD": "gateway"
}
- Restart worker:
npx claude-mem restart
- Check logs - SDK returns 401 error:
[SDK] ← Response received: Failed to authenticate. API Error: 401 key not allowed to access model
Expected Behavior
- npx claude-mem repair should detect and merge hooks alongside existing plugins
- When using gateway auth with a non-Claude proxy, SDK should either:
- Support configurable model names (e.g., glm-5-external, gpt-4o)
- Or provide clear error message about model incompatibility
Actual Behavior
Issue 1: Hooks not registered
- settings.json only contains hooks from the first plugin (my-corp-cli)
- claude-mem's PostToolUse hook never fires
- Observations are never captured
- Memory search returns empty results
Issue 2: Model incompatibility
After manually fixing hooks, observations are enqueued but SDK fails:
[SDK] ← Response received: Failed to authenticate. API Error: 401 key not allowed to access model.
This key can only access...
The SDK tries to use claude-haiku-4-5-20251001 but corporate proxy only supports non-Claude models
(e.g., glm, kimi, minimax, deepseek).
Environment
- Claude-mem version: 13.8.0
- Claude Code version: Latest
- OS: macOS (Darwin 23.5.0)
- Node.js: v20.x
- Bun: 1.3.14
- Corporate proxy: Supports glm/kimi/minimax/deepseek, NOT Claude models
Additional Context
Root Cause Analysis:
Issue 1 - The repair command appears to:
- ✅ Create .install-version file
- ✅ Verify runtime dependencies (Bun, uv)
- ❌ NOT check if hooks are registered in settings.json
- ❌ NOT merge hooks when another plugin already registered same matcher
Issue 2 - The SDK:
- ✅ Correctly receives environment variables (ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN)
- ❌ Hardcodes model to claude-haiku-4-5-20251001
- ❌ Cannot work with proxies that don't support Claude models
Evidence - Worker logs:
[SDK] Starting SDK query {authMethod=Gateway auth token (from ~/.claude-mem/.env)}
[SDK] ← Response received: Failed to authenticate. API Error: 401 key not allowed to access model
Workaround for Issue 1:
Manually add claude-mem hooks to settings.json, appending to existing hook arrays:
{
"hooks": {
"PostToolUse": [
{ "matcher": "", "_source": "my-corp-cli", "hooks": [...] },
{ "matcher": "", "_source": "claude-mem", "hooks": [...] }
]
}
}
Workaround for Issue 2:
None currently. Users with corporate proxies that don't support Claude models cannot use claude-mem.
Suggested Fix:
For Issue 1:
- repair command should verify hooks are registered, not just files exist
- Hook registration should append to arrays, not assume exclusive ownership
- Consider using _source field to detect and update existing claude-mem hooks
- Add a --verify-hooks flag to check if hooks are properly registered
For Issue 2:
- Allow configurable model via CLAUDE_MEM_MODEL when using gateway auth
- Support OpenAI-compatible APIs directly (not just via OpenRouter)
- Provide clear error message when model is incompatible with the gateway
Impact:
This affects any user who:
- Uses Claude Code with multiple plugins
- Has a corporate/internal wrapper that registers global hooks
- Uses a corporate LLM proxy that doesn't support Claude models
- Expects claude-mem to work alongside their existing tooling
Without observations being captured, the entire memory system is non-functional.
Before submitting
is not a duplicate
📝 Manual Bug Report
Bug Description
When
claude-memis installed alongside another plugin that has already registered hooks withmatcher: "*", thenpx claude-mem repaircommand does not register claude-mem's hooks intosettings.json. This results in observations never being captured, making the memory systemnon-functional.
Additionally, even after manually fixing the hooks registration, there's a model compatibility
issue: when using a corporate LLM proxy that doesn't support Claude models, the SDK returns 401
error and observations are discarded.
Steps to Reproduce
Part 1: Hooks not registered
my-corp-cli) that registers hooks withmatcher: "*"insettings.json:{ "hooks": { "PostToolUse": [ { "matcher": "*", "_source": "my-corp-cli", "hooks": [...] } ] } }npx claude-mem install
npx claude-mem repair
Part 2: Model compatibility issue
ANTHROPIC_BASE_URL=http://your-corporate-llm-proxy.example.com
ANTHROPIC_AUTH_TOKEN=your-key
{
"CLAUDE_MEM_PROVIDER": "claude",
"CLAUDE_MEM_CLAUDE_AUTH_METHOD": "gateway"
}
npx claude-mem restart
[SDK] ← Response received: Failed to authenticate. API Error: 401 key not allowed to access model
Expected Behavior
- Support configurable model names (e.g., glm-5-external, gpt-4o)
- Or provide clear error message about model incompatibility
Actual Behavior
Issue 1: Hooks not registered
Issue 2: Model incompatibility
After manually fixing hooks, observations are enqueued but SDK fails:
[SDK] ← Response received: Failed to authenticate. API Error: 401 key not allowed to access model.
This key can only access...
The SDK tries to use claude-haiku-4-5-20251001 but corporate proxy only supports non-Claude models
(e.g., glm, kimi, minimax, deepseek).
Environment
Additional Context
Root Cause Analysis:
Issue 1 - The repair command appears to:
Issue 2 - The SDK:
Evidence - Worker logs:
[SDK] Starting SDK query {authMethod=Gateway auth token (from ~/.claude-mem/.env)}
[SDK] ← Response received: Failed to authenticate. API Error: 401 key not allowed to access model
Workaround for Issue 1:
Manually add claude-mem hooks to settings.json, appending to existing hook arrays:
{
"hooks": {
"PostToolUse": [
{ "matcher": "", "_source": "my-corp-cli", "hooks": [...] },
{ "matcher": "", "_source": "claude-mem", "hooks": [...] }
]
}
}
Workaround for Issue 2:
None currently. Users with corporate proxies that don't support Claude models cannot use claude-mem.
Suggested Fix:
For Issue 1:
For Issue 2:
Impact:
This affects any user who:
Without observations being captured, the entire memory system is non-functional.