rohitg00/agentmemory · info

${config.displayName} hooks skipped: ${hookResult.reason}. M

Error message

${config.displayName} hooks skipped: ${hookResult.reason}. MCP wiring still applied.

What it means

Raised after a successful (non-dry-run) MCP wiring of a JSON-config host: the agentmemory entry was written and verified, then the optional `--with-hooks` step invoked the host's `installHooks`, which returned kind 'skipped'. The warning makes clear the hooks were not installed but the MCP config write succeeded — this is a partial-success notice, not a failure.

Source

Thrown at src/cli/connect/json-mcp-adapter.ts:135

      writeJsonAtomic(config.configPath, next);

      const verify = readJsonSafe<McpConfig>(config.configPath);
      const verifyServers = verify?.[wrapperKey] as
        | Record<string, McpEntry>
        | undefined;
      if (!entryMatches(verifyServers?.["agentmemory"])) {
        p.log.error(
          `Verification failed: ${config.configPath} did not contain ${wrapperKey}.agentmemory after write.`,
        );
        return { kind: "skipped", reason: "verification-failed" };
      }

      logInstalled(config.displayName, config.configPath);

      if (opts.withHooks && config.installHooks) {
        const hookResult = config.installHooks(opts);
        if (hookResult.kind === "skipped") {
          p.log.warn(
            `${config.displayName} hooks skipped: ${hookResult.reason}. MCP wiring still applied.`,
          );
        }
      }

      return {
        kind: "installed",
        mutatedPath: config.configPath,
        ...(backupPath !== undefined && { backupPath }),
      };
    },
  };
}

View on GitHub (pinned to e04ba88819)

Solutions

  1. Read the `reason` text after 'hooks skipped:' and fix that specific condition.
  2. Re-run `agentmemory connect <host> --with-hooks --force` to redo wiring and retry hooks.
  3. Verify the MCP entry landed (it did — 'MCP wiring still applied') and install hooks manually if needed.

Example fix

// before
agentmemory connect droid --with-hooks
droid hooks skipped: hook-manifest-already-installed.

// after
agentmemory connect droid --with-hooks --force
# or manually merge hook entries into ~/.factory/hooks.json
Defensive patterns

Strategy: fallback

Validate before calling

// Check hook-manifest prerequisites before connecting
import { accessSync, constants } from "node:fs";
try {
  accessSync(hooksManifestPath, constants.W_OK);
} catch {
  console.log("Hooks manifest unwritable — run connect without --with-hooks or fix permissions.");
}

Type guard

function isSkipped(r: ConnectResult): r is { kind: "skipped"; reason: string } {
  return r.kind === "skipped" && typeof (r as { reason?: unknown }).reason === "string";
}

Try / catch

const result = await adapter.install({ ...opts, withHooks: true });
if (result.kind === "installed") {
  console.log("MCP wiring applied.");
  if (hookResult?.kind === "skipped") console.warn(`Hooks skipped: ${hookResult.reason} — wire hooks manually.`);
}

Prevention

When it happens

Trigger: Running `agentmemory connect <host> --with-hooks` (no --dry-run) where the config write + verification succeeds but `installHooks(opts)` returns `{ kind: 'skipped', reason }` (hook manifest already present/current, unwritable path, unsupported host state).

Common situations: Fresh installs on hosts whose hook manifest already exists from a manual setup; restricted home-directory permissions; version drift where the installer recognizes the existing manifest as up-to-date and skips rewriting.

Related errors


AI-assisted analysis of rohitg00/agentmemory@e04ba88819 (2026-08-30). Data as JSON: /api/errors/31270174cb71b620. Report an issue: GitHub.