rohitg00/agentmemory · warning
Claude Code hooks fallback skipped: ${hookResult.reason}.
Error message
Claude Code hooks fallback skipped: ${hookResult.reason}. What it means
Warning during `connect claude-code --with-hooks` (or install with hooks enabled) when MCP wiring is already present (already-wired path) but the hooks fallback installer returned a "skipped" result; the reason is surfaced verbatim. MCP remains functional; only hook installation was not performed.
Source
Thrown at src/cli/connect/claude-code.ts:67
},
async install(opts: ConnectOptions): Promise<ConnectResult> {
const existing = readJsonSafe<ClaudeConfig>(CLAUDE_JSON);
const next: ClaudeConfig = existing ? { ...existing } : {};
const servers: Record<string, ClaudeMcpEntry> = {
...((next.mcpServers as Record<string, ClaudeMcpEntry>) ?? {}),
};
const alreadyHas = entryMatches(servers["agentmemory"]);
if (alreadyHas && !opts.force) {
logAlreadyWired("Claude Code", CLAUDE_JSON);
// --with-hooks is independent of MCP wiring (issue #508). Run the
// hooks fallback even when MCP is already in place so users with a
// healthy MCP setup can still pick up version-stable hook paths.
if (opts.withHooks) {
const hookResult = installClaudeHooks(opts);
if (hookResult.kind === "skipped") {
p.log.warn(
`Claude Code hooks fallback skipped: ${hookResult.reason}.`,
);
}
}
return { kind: "already-wired", mutatedPath: CLAUDE_JSON };
}
if (opts.dryRun) {
p.log.info(
`[dry-run] Would ${alreadyHas ? "overwrite" : "add"} mcpServers.agentmemory in ${CLAUDE_JSON}`,
);
return { kind: "installed", mutatedPath: CLAUDE_JSON };
}
let backupPath: string | undefined;
if (existsSync(CLAUDE_JSON)) {
backupPath = backupFile(CLAUDE_JSON, "claude-code");
logBackup(backupPath);View on GitHub (pinned to e04ba88819)
Solutions
- Read the reported reason in the warning and address it (e.g. conflicting settings.json entries)
- Remove/rename stale hook entries in ~/.claude/settings.json and re-run install with --with-hooks
- Skip the hooks fallback if MCP is healthy and hooks are not needed — this is non-fatal
Defensive patterns
Strategy: fallback
Validate before calling
const res = installClaudeHooks(opts);
if (res.kind === "skipped") console.warn(`hooks not installed: ${res.reason}`); Type guard
function isSkipped(r: {kind: string; reason?: string}): r is {kind: "skipped"; reason: string} { return r.kind === "skipped"; } Prevention
- Review ~/.claude/settings.json for pre-existing hook entries before installing
- Keep hook paths in sync when upgrading agentmemory versions
- Treat hook-skip warnings as non-fatal; verify MCP health separately
When it happens
Trigger: install() detects CLAUDE_JSON already wired to agentmemory MCP and opts.withHooks is true, but installClaudeHooks(opts) returns { kind: "skipped", reason } — e.g. hooks already installed with different paths, unsupported platform, or settings file conflicts.
Common situations: Re-running install over an existing setup; hooks previously installed by another version; read-only ~/.claude/settings.json; Claude Code not fully installed.
Related errors
- Claude Code hooks fallback skipped: ${hookResult.reason}. MC
- agentmemory: could not locate bundled plugin/ directory (sea
- Codex hooks fallback skipped: ${hookResult.reason}. MCP wiri
- Codex runs only trusted hooks: launch `codex` (the TUI) once
- ${config.displayName} hooks skipped: ${hookResult.reason}.
AI-assisted analysis of rohitg00/agentmemory@e04ba88819 (2026-08-30).
Data as JSON: /api/errors/42e896e2083c05d0.
Report an issue: GitHub.