MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / uninstall_claude_code

Function uninstall_claude_code

src/cli/cli.c:10190–10322  ·  view source on GitHub ↗

Remove Claude Code agent configs. */

Source from the content-addressed store, hash-verified

10188
10189/* Remove Claude Code agent configs. */
10190static void uninstall_claude_code(const char *home, bool dry_run) {
10191 char installed_binary[CLI_BUF_1K];
10192 cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary));
10193 char config_dir[CLI_BUF_1K];
10194 cbm_claude_config_dir(home, config_dir, sizeof(config_dir));
10195 char user_root[CLI_BUF_1K];
10196 cbm_claude_user_root(home, user_root, sizeof(user_root));
10197
10198 char skills_dir[CLI_BUF_1K];
10199 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
10200 int removed = cbm_remove_skills(skills_dir, dry_run);
10201 printf("Claude Code: removed %d skill(s)\n", removed);
10202 char agent_path[CLI_BUF_1K];
10203 snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.md", config_dir);
10204 uninstall_tiered_agent_profiles(
10205 (cbm_tiered_profile_set_t){
10206 .label = "Claude Code",
10207 .verify_path = agent_path,
10208 .binary_path = installed_binary,
10209 .legacy_verify_content = legacy_claude_verify_agent_content,
10210 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
10211 },
10212 dry_run);
10213
10214 char mcp_path[CLI_BUF_1K];
10215 snprintf(mcp_path, sizeof(mcp_path), "%s/.mcp.json", config_dir);
10216 if (!dry_run && cbm_remove_editor_mcp_owned(installed_binary, mcp_path) != CLI_OK) {
10217 record_agent_config_error(true, "Claude Code", "legacy_mcp_uninstall", mcp_path);
10218 }
10219 printf(" removed MCP config entry\n");
10220
10221 char mcp_path2[CLI_BUF_1K];
10222 snprintf(mcp_path2, sizeof(mcp_path2), "%s/.claude.json", user_root);
10223 if (!dry_run && cbm_remove_editor_mcp_owned(installed_binary, mcp_path2) != CLI_OK) {
10224 record_agent_config_error(true, "Claude Code", "mcp_uninstall", mcp_path2);
10225 }
10226
10227 char settings_path[CLI_BUF_1K];
10228 snprintf(settings_path, sizeof(settings_path), "%s/settings.json", config_dir);
10229 if (!dry_run) {
10230 if (cbm_remove_claude_hooks(settings_path) != CLI_OK) {
10231 record_agent_config_error(true, "Claude Code", "pretool_hook_uninstall", settings_path);
10232 }
10233 if (cbm_remove_session_hooks(settings_path) != CLI_OK) {
10234 record_agent_config_error(true, "Claude Code", "session_hook_uninstall", settings_path);
10235 }
10236 if (cbm_remove_claude_subagent_hooks(settings_path) != CLI_OK) {
10237 record_agent_config_error(true, "Claude Code", "subagent_hook_uninstall",
10238 settings_path);
10239 }
10240 char current_gate[CLI_BUF_8K];
10241 char current_session[CLI_BUF_8K];
10242 char current_subagent[CLI_BUF_8K];
10243 char released_gate[CLI_BUF_8K];
10244 const char *const gate_legacy[] = {released_gate};
10245 const char *const session_legacy[] = {cmm_released_session_script};
10246 const char *const subagent_legacy[] = {cmm_released_subagent_script};
10247 size_t gate_legacy_count = cbm_build_released_gate_script(installed_binary, released_gate,

Callers 1

cli_uninstall_activateFunction · 0.85

Tested by

no test coverage detected