thedotmack/claude-mem · warning

Missing schema for watch

Error message

Missing schema for watch

What it means

The transcript watcher could not resolve a schema for the configured WatchTarget (resolveSchema returned null), so it skips setting up that watch entirely. The watch is silently (warn-level) not started, and no files are tailed for it.

Solutions

  1. Check watch.name against the schemas the watcher supports and fix the typo/name.
  2. Remove the unsupported watch entry from the transcript watch config.
  3. Upgrade claude-mem if the schema exists in a newer release.
  4. If adding a custom tool, implement/register its schema before configuring the watch.

Example fix

// before (config)
{ "name": "cluade", "path": "~/.claude/projects" }
// after
{ "name": "claude", "path": "~/.claude/projects" }
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_SCHEMAS = ['claude','codex','gemini'];
if (!SUPPORTED_SCHEMAS.includes(watch.name)) {
  console.error(`Unsupported watch: ${watch.name}`);
}

Type guard

function hasSchema(watch: WatchTarget): boolean {
  return resolveSchema(watch) !== null;
}

Prevention

When it happens

Trigger: start -> setupWatch with a watch whose name/type has no registered schema — e.g. a custom watch entry in the transcript config JSON for an unsupported tool, or a typo in the watch name.

Common situations: User hand-edits the transcript watch config adding a watch for an unrecognized tool; new claude-mem version renamed/dropped a schema while an old config still references it; config file copied between machines with different supported watch types.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/c25b4ee6c80e2f12. Report an issue: GitHub.

Appendix: source

Thrown at src/services/transcripts/watcher.ts:137

      await this.setupWatch(watch);
    }
  }

  stop(): void {
    for (const tailer of this.tailers.values()) {
      tailer.close();
    }
    this.tailers.clear();
    for (const watcher of this.rootWatchers) {
      watcher.close();
    }
    this.rootWatchers = [];
  }

  private async setupWatch(watch: WatchTarget): Promise<void> {
    const schema = this.resolveSchema(watch);
    if (!schema) {
      logger.warn('TRANSCRIPT', 'Missing schema for watch', { watch: watch.name });
      return;
    }

    const resolvedPath = expandHomePath(watch.path);
    const files = this.resolveWatchFiles(resolvedPath);

    for (const filePath of files) {
      await this.addTailer(filePath, watch, schema);
    }

    const watchRoot = this.deepestNonGlobAncestor(resolvedPath);
    if (!watchRoot || !existsSync(watchRoot)) {
      logger.debug('TRANSCRIPT', 'Watch root does not exist, skipping fs.watch', { watch: watch.name, watchRoot });
      return;
    }

    try {
      const watcher = fsWatch(watchRoot, { recursive: true, persistent: true }, (event, name) => {

View on GitHub (pinned to d8bc9755e7)