Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Fix KiloCode config paths on Windows and macOS

Martin Vogel80e2752c097f
diff --git a/src/cli/cli.c b/src/cli/cli.c
index a0aab048d..e45a4108a 100644
--- a/src/cli/cli.c
+++ b/src/cli/cli.c
@@ -1002,7 +1002,17 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
agents.aider = cbm_find_cli("aider", home_dir)[0] != '\0';
- snprintf(path, sizeof(path), "%s/.config/Code/User/globalStorage/kilocode.kilo-code", home_dir);
+#ifdef __APPLE__
+ snprintf(path, sizeof(path),
+ "%s/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code", home_dir);
+#else
+ {
+ const char *kc_cfg = cbm_app_config_dir();
+ if (kc_cfg) {
+ snprintf(path, sizeof(path), "%s/Code/User/globalStorage/kilocode.kilo-code", kc_cfg);
+ }
+ }
+#endif
agents.kilocode = dir_exists(path);
#ifdef __APPLE__
@@ -2738,9 +2748,16 @@ static void install_editor_agent_configs(const cbm_detected_agents_t *agents, co
if (agents->kilocode) {
char cp[CLI_BUF_1K];
char ip[CLI_BUF_1K];
+#ifdef __APPLE__
snprintf(cp, sizeof(cp),
- "%s/.config/Code/User/globalStorage/kilocode.kilo-code/settings/mcp_settings.json",
+ "%s/Library/Application Support/Code/User/globalStorage/"
+ "kilocode.kilo-code/settings/mcp_settings.json",
home);
+#else
+ snprintf(cp, sizeof(cp),
+ "%s/Code/User/globalStorage/kilocode.kilo-code/settings/mcp_settings.json",
+ cbm_app_config_dir());
+#endif
snprintf(ip, sizeof(ip), "%s/.kilocode/rules/codebase-memory-mcp.md", home);
install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run,
cbm_install_editor_mcp);
@@ -3013,9 +3030,16 @@ static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const c
if (agents->kilocode) {
char cp[CLI_BUF_1K];
char ip[CLI_BUF_1K];
+#ifdef __APPLE__
snprintf(cp, sizeof(cp),
- "%s/.config/Code/User/globalStorage/kilocode.kilo-code/settings/mcp_settings.json",
+ "%s/Library/Application Support/Code/User/globalStorage/"
+ "kilocode.kilo-code/settings/mcp_settings.json",
home);
+#else
+ snprintf(cp, sizeof(cp),
+ "%s/Code/User/globalStorage/kilocode.kilo-code/settings/mcp_settings.json",
+ cbm_app_config_dir());
+#endif
snprintf(ip, sizeof(ip), "%s/.kilocode/rules/codebase-memory-mcp.md", home);
uninstall_agent_mcp_instr((mcp_uninstall_args_t){"KiloCode", cp, ip}, dry_run,
cbm_remove_editor_mcp);
diff --git a/tests/test_cli.c b/tests/test_cli.c
index 04a1bc0bc..50829d182 100644
--- a/tests/test_cli.c
+++ b/tests/test_cli.c
@@ -1475,7 +1475,12 @@ TEST(cli_detect_agents_finds_kilocode) {
SKIP("cbm_mkdtemp failed");
char dir[512];
+#ifdef __APPLE__
+ snprintf(dir, sizeof(dir),
+ "%s/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code", tmpdir);
+#else
snprintf(dir, sizeof(dir), "%s/.config/Code/User/globalStorage/kilocode.kilo-code", tmpdir);
+#endif
test_mkdirp(dir);
cbm_detected_agents_t agents = cbm_detect_agents(tmpdir);