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

Function install_claude_code_config

src/cli/cli.c:7353–7522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7351 const char *legacy_verify_content, bool dry_run);
7352
7353static void install_claude_code_config(const char *home, const char *binary_path, bool force,
7354 bool dry_run) {
7355 char config_dir[CLI_BUF_1K];
7356 cbm_claude_config_dir(home, config_dir, sizeof(config_dir));
7357 char user_root[CLI_BUF_1K];
7358 cbm_claude_user_root(home, user_root, sizeof(user_root));
7359
7360 char skills_dir[CLI_BUF_1K];
7361 char agent_path[CLI_BUF_1K];
7362 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
7363 snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.md", config_dir);
7364
7365 /* Plan mode: record the planned writes and return without mutating (#388). */
7366 if (g_install_plan) {
7367 char p[CLI_BUF_1K];
7368 snprintf(p, sizeof(p), "%s/codebase-memory/SKILL.md", skills_dir);
7369 plan_record("Claude Code", "skill", p);
7370 install_tiered_agent_profiles(
7371 (cbm_tiered_profile_set_t){
7372 .label = "Claude Code",
7373 .verify_path = agent_path,
7374 .binary_path = binary_path,
7375 .legacy_verify_content = legacy_claude_verify_agent_content,
7376 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
7377 },
7378 dry_run);
7379 snprintf(p, sizeof(p), "%s/.claude.json", user_root);
7380 plan_record("Claude Code", "mcp_config", p);
7381 snprintf(p, sizeof(p), "%s/settings.json", config_dir);
7382 plan_record("Claude Code", "hook", p);
7383 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_HOOK_GATE_SCRIPT);
7384 plan_record("Claude Code", "hook", p);
7385 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_SESSION_REMINDER_SCRIPT);
7386 plan_record("Claude Code", "hook", p);
7387 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_SUBAGENT_REMINDER_SCRIPT);
7388 plan_record("Claude Code", "hook", p);
7389 return;
7390 }
7391
7392 printf("Claude Code:\n");
7393
7394 int skill_count = cbm_install_skills(skills_dir, force, dry_run);
7395 printf(" skills: %d installed\n", skill_count);
7396 install_tiered_agent_profiles(
7397 (cbm_tiered_profile_set_t){
7398 .label = "Claude Code",
7399 .verify_path = agent_path,
7400 .binary_path = binary_path,
7401 .legacy_verify_content = legacy_claude_verify_agent_content,
7402 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
7403 },
7404 dry_run);
7405
7406 if (cbm_remove_old_monolithic_skill(skills_dir, dry_run)) {
7407 printf(" removed old monolithic skill\n");
7408 }
7409
7410 /* ~/.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