{"record":{"id":"32da8712f0bff1b6","repo":"thedotmack/claude-mem","slug":"warning-antigravity-cli-hook-path-contains-spaces-filepath","errorCode":null,"errorMessage":"  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.","messagePattern":"  WARNING: Antigravity CLI hook path contains spaces: (.+?)\n  agy splits commands on spaces, so hooks may fail to launch\\.\n  Move bun or the plugin to a path without spaces\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/integrations/AntigravityCliHooksInstaller.ts","lineNumber":105,"sourceCode":"const ANTIGRAVITY_EVENT_TO_INTERNAL_EVENT: Record<string, string> = {\n  'PreInvocation': 'context',\n  'PreToolUse': 'observation',\n  'PostToolUse': 'observation',\n  'PostInvocation': 'observation',\n  'Stop': 'summarize',\n};\n\n// `agy` splits a hook command string on spaces and does NOT strip quotes, so a\n// quoted path makes bun receive a literal `\"C:/path/bun\"` argument and fail\n// with \"File not found\" (verified on a live install — quoted paths broke every\n// hook with exit status 1). On Windows, a space inside the path can't be\n// quoted away either, so resolve the 8.3 short path to remove the space; if 8.3\n// generation is disabled we fall back to the raw path with a warning rather\n// than blocking the install.\nfunction toSpaceFreePath(filePath: string): string {\n  if (!filePath.includes(' ')) return filePath;\n  if (process.platform !== 'win32') {\n    console.warn(\n      `  WARNING: Antigravity CLI hook path contains spaces: ${filePath}\\n` +\n      `  agy splits commands on spaces, so hooks may fail to launch.\\n` +\n      `  Move bun or the plugin to a path without spaces.`,\n    );\n    return filePath;\n  }\n  try {\n    const shortPath = execSync(\n      `for %~I in (\"${filePath}\") do @echo %~sI`,\n      { shell: 'cmd.exe', encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] },\n    ).trim();\n    if (shortPath && !shortPath.includes(' ')) return shortPath;\n  } catch (error) {\n    if (error instanceof Error) {\n      logger.error('WORKER', 'Failed to resolve Windows 8.3 short path', { path: filePath }, error);\n    }\n  }\n  console.warn(","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/integrations/AntigravityCliHooksInstaller.ts#L87-L123","documentation":"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.","triggerScenarios":"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.","commonSituations":"macOS/Linux user accounts or install dirs with spaces ('/Users/John Smith/...', '/opt/my plugins/'); custom BUN_INSTALL paths containing spaces.","solutions":["Move bun (or the plugin directory) to a path without spaces and reinstall","Create a symlink at a space-free path (e.g. /usr/local/bin/bun) pointing to the real binary","On Windows, ensure 8.3 short-name generation is enabled so the installer can resolve a space-free short path instead"],"exampleFix":"// before: bun at a spaced path\n// /opt/my tools/bin/bun\n// after: symlink to a clean path and reinstall\nln -s \"/opt/my tools/bin/bun\" /usr/local/bin/bun","handlingStrategy":"fallback","validationCode":"if (typeof bunPath === 'string' && bunPath.includes(' ')) {\n  console.warn('bun path contains spaces; move it to a space-free location before installing Antigravity hooks');\n}","typeGuard":"function isSpaceFree(p: string): boolean {\n  return typeof p === 'string' && !p.includes(' ');\n}","tryCatchPattern":"if (path.includes(' ')) {\n  console.warn('Hook path contains spaces; agy may fail to launch hooks. Relocate bun/plugin.');\n}","preventionTips":["Install bun and the plugin under space-free directories","Create symlinks at canonical paths (/usr/local/bin/bun) for spaced installs","Check install locations for spaces before running the Antigravity installer","Keep project/plugin directories out of user folders with spaces"],"tags":["paths","windows","installer","spaces"],"backgroundTag":"path-with-spaces","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}