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

Function install_claude_code_config

src/cli/cli.c:7266–7435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7264 const char *legacy_verify_content, bool dry_run);
7265
7266static void install_claude_code_config(const char *home, const char *binary_path, bool force,
7267 bool dry_run) {
7268 char config_dir[CLI_BUF_1K];
7269 cbm_claude_config_dir(home, config_dir, sizeof(config_dir));
7270 char user_root[CLI_BUF_1K];
7271 cbm_claude_user_root(home, user_root, sizeof(user_root));
7272
7273 char skills_dir[CLI_BUF_1K];
7274 char agent_path[CLI_BUF_1K];
7275 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
7276 snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.md", config_dir);
7277
7278 /* Plan mode: record the planned writes and return without mutating (#388). */
7279 if (g_install_plan) {
7280 char p[CLI_BUF_1K];
7281 snprintf(p, sizeof(p), "%s/codebase-memory/SKILL.md", skills_dir);
7282 plan_record("Claude Code", "skill", p);
7283 install_tiered_agent_profiles(
7284 (cbm_tiered_profile_set_t){
7285 .label = "Claude Code",
7286 .verify_path = agent_path,
7287 .binary_path = binary_path,
7288 .legacy_verify_content = legacy_claude_verify_agent_content,
7289 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
7290 },
7291 dry_run);
7292 snprintf(p, sizeof(p), "%s/.claude.json", user_root);
7293 plan_record("Claude Code", "mcp_config", p);
7294 snprintf(p, sizeof(p), "%s/settings.json", config_dir);
7295 plan_record("Claude Code", "hook", p);
7296 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_HOOK_GATE_SCRIPT);
7297 plan_record("Claude Code", "hook", p);
7298 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_SESSION_REMINDER_SCRIPT);
7299 plan_record("Claude Code", "hook", p);
7300 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_SUBAGENT_REMINDER_SCRIPT);
7301 plan_record("Claude Code", "hook", p);
7302 return;
7303 }
7304
7305 printf("Claude Code:\n");
7306
7307 int skill_count = cbm_install_skills(skills_dir, force, dry_run);
7308 printf(" skills: %d installed\n", skill_count);
7309 install_tiered_agent_profiles(
7310 (cbm_tiered_profile_set_t){
7311 .label = "Claude Code",
7312 .verify_path = agent_path,
7313 .binary_path = binary_path,
7314 .legacy_verify_content = legacy_claude_verify_agent_content,
7315 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
7316 },
7317 dry_run);
7318
7319 if (cbm_remove_old_monolithic_skill(skills_dir, dry_run)) {
7320 printf(" removed old monolithic skill\n");
7321 }
7322
7323 /* ~/.claude/.mcp.json is not a documented Claude Code MCP location.

Callers 1

Calls 15

cbm_claude_config_dirFunction · 0.85
cbm_claude_user_rootFunction · 0.85
plan_recordFunction · 0.85
cbm_install_skillsFunction · 0.85
cbm_file_existsFunction · 0.85
prepare_config_parentFunction · 0.85
cbm_install_editor_mcpFunction · 0.85

Tested by

no test coverage detected