thedotmack/claude-mem · warning

WARNING: Antigravity CLI hook path contains spaces

Error message

  WARNING: Antigravity CLI hook path contains spaces: ${filePath}
  agy splits commands on spaces, so hooks may fail to launch.
  Move bun or the plugin to a path without spaces.

What it means

When installing Antigravity (agy) CLI hooks, claude-mem resolves paths for bun and the worker script. agy splits its command string on spaces and cannot handle quoted paths, so a path containing a space would break hook launching. On non-Windows platforms (or before 8.3 resolution) the installer prints this warning and returns the raw path instead of blocking the install.

Solutions

  1. Move bun (or the plugin directory) to a path without spaces and reinstall
  2. Create a symlink at a space-free path (e.g. /usr/local/bin/bun) pointing to the real binary
  3. On Windows, ensure 8.3 short-name generation is enabled so the installer can resolve a space-free short path instead

Example fix

// before: bun at a spaced path
// /opt/my tools/bin/bun
// after: symlink to a clean path and reinstall
ln -s "/opt/my tools/bin/bun" /usr/local/bin/bun
Defensive patterns

Strategy: fallback

Validate before calling

if (typeof bunPath === 'string' && bunPath.includes(' ')) {
  console.warn('bun path contains spaces; move it to a space-free location before installing Antigravity hooks');
}

Type guard

function isSpaceFree(p: string): boolean {
  return typeof p === 'string' && !p.includes(' ');
}

Try / catch

if (path.includes(' ')) {
  console.warn('Hook path contains spaces; agy may fail to launch hooks. Relocate bun/plugin.');
}

Prevention

When it happens

Trigger: toSpaceFreePath receives a filePath containing a space while process.platform !== 'win32'; called via formattedBunPath or formattedWorkerPath, e.g. bun installed in '/usr/local/my tools/bin/bun' or plugin under a directory with spaces.

Common situations: macOS/Linux user accounts or install dirs with spaces ('/Users/John Smith/...', '/opt/my plugins/'); custom BUN_INSTALL paths containing spaces.

Related errors


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

Appendix: source

Thrown at src/services/integrations/AntigravityCliHooksInstaller.ts:105

const ANTIGRAVITY_EVENT_TO_INTERNAL_EVENT: Record<string, string> = {
  'PreInvocation': 'context',
  'PreToolUse': 'observation',
  'PostToolUse': 'observation',
  'PostInvocation': 'observation',
  'Stop': 'summarize',
};

// `agy` splits a hook command string on spaces and does NOT strip quotes, so a
// quoted path makes bun receive a literal `"C:/path/bun"` argument and fail
// with "File not found" (verified on a live install — quoted paths broke every
// hook with exit status 1). On Windows, a space inside the path can't be
// quoted away either, so resolve the 8.3 short path to remove the space; if 8.3
// generation is disabled we fall back to the raw path with a warning rather
// than blocking the install.
function toSpaceFreePath(filePath: string): string {
  if (!filePath.includes(' ')) return filePath;
  if (process.platform !== 'win32') {
    console.warn(
      `  WARNING: Antigravity CLI hook path contains spaces: ${filePath}\n` +
      `  agy splits commands on spaces, so hooks may fail to launch.\n` +
      `  Move bun or the plugin to a path without spaces.`,
    );
    return filePath;
  }
  try {
    const shortPath = execSync(
      `for %~I in ("${filePath}") do @echo %~sI`,
      { shell: 'cmd.exe', encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] },
    ).trim();
    if (shortPath && !shortPath.includes(' ')) return shortPath;
  } catch (error) {
    if (error instanceof Error) {
      logger.error('WORKER', 'Failed to resolve Windows 8.3 short path', { path: filePath }, error);
    }
  }
  console.warn(

View on GitHub (pinned to d8bc9755e7)