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

Function uninstall_claude_code

src/cli/cli.c:3896–3928  ·  view source on GitHub ↗

Remove Claude Code agent configs. */

Source from the content-addressed store, hash-verified

3894
3895/* Remove Claude Code agent configs. */
3896static void uninstall_claude_code(const char *home, bool dry_run) {
3897 char config_dir[CLI_BUF_1K];
3898 cbm_claude_config_dir(home, config_dir, sizeof(config_dir));
3899 char user_root[CLI_BUF_1K];
3900 cbm_claude_user_root(home, user_root, sizeof(user_root));
3901
3902 char skills_dir[CLI_BUF_1K];
3903 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
3904 int removed = cbm_remove_skills(skills_dir, dry_run);
3905 printf("Claude Code: removed %d skill(s)\n", removed);
3906
3907 char mcp_path[CLI_BUF_1K];
3908 snprintf(mcp_path, sizeof(mcp_path), "%s/.mcp.json", config_dir);
3909 if (!dry_run) {
3910 cbm_remove_editor_mcp(mcp_path);
3911 }
3912 printf(" removed MCP config entry\n");
3913
3914 char mcp_path2[CLI_BUF_1K];
3915 snprintf(mcp_path2, sizeof(mcp_path2), "%s/.claude.json", user_root);
3916 if (!dry_run) {
3917 cbm_remove_editor_mcp(mcp_path2);
3918 }
3919
3920 char settings_path[CLI_BUF_1K];
3921 snprintf(settings_path, sizeof(settings_path), "%s/settings.json", config_dir);
3922 if (!dry_run) {
3923 cbm_remove_claude_hooks(settings_path);
3924 cbm_remove_session_hooks(settings_path);
3925 cbm_remove_claude_subagent_hooks(settings_path);
3926 }
3927 printf(" removed PreToolUse + SessionStart + SubagentStart hooks\n");
3928}
3929
3930/* Remove MCP + instructions for a generic agent. */
3931

Callers 1

cbm_cmd_uninstallFunction · 0.85

Calls 7

cbm_claude_config_dirFunction · 0.85
cbm_claude_user_rootFunction · 0.85
cbm_remove_skillsFunction · 0.85
cbm_remove_editor_mcpFunction · 0.85
cbm_remove_claude_hooksFunction · 0.85
cbm_remove_session_hooksFunction · 0.85

Tested by

no test coverage detected