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

Function install_claude_code_config

src/cli/cli.c:8550–8720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8548 const char *legacy_verify_content, bool dry_run);
8549
8550static void install_claude_code_config(const char *home, const char *binary_path, bool force,
8551 bool dry_run) {
8552 char config_dir[CLI_BUF_1K];
8553 cbm_claude_config_dir(home, config_dir, sizeof(config_dir));
8554 char user_root[CLI_BUF_1K];
8555 cbm_claude_user_root(home, user_root, sizeof(user_root));
8556
8557 char skills_dir[CLI_BUF_1K];
8558 char agent_path[CLI_BUF_1K];
8559 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
8560 snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.md", config_dir);
8561
8562 /* Plan mode: record the planned writes and return without mutating (#388). */
8563 if (g_install_plan) {
8564 char p[CLI_BUF_1K];
8565 snprintf(p, sizeof(p), "%s/codebase-memory/SKILL.md", skills_dir);
8566 plan_record("Claude Code", "skill", p);
8567 install_tiered_agent_profiles(
8568 (cbm_tiered_profile_set_t){
8569 .label = "Claude Code",
8570 .verify_path = agent_path,
8571 .binary_path = binary_path,
8572 .legacy_verify_content = legacy_claude_verify_agent_content,
8573 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
8574 },
8575 dry_run);
8576 snprintf(p, sizeof(p), "%s/.claude.json", user_root);
8577 plan_record("Claude Code", "mcp_config", p);
8578 snprintf(p, sizeof(p), "%s/settings.json", config_dir);
8579 plan_record("Claude Code", "hook", p);
8580 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_HOOK_GATE_SCRIPT);
8581 plan_record("Claude Code", "hook", p);
8582 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_SESSION_REMINDER_SCRIPT);
8583 plan_record("Claude Code", "hook", p);
8584 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_SUBAGENT_REMINDER_SCRIPT);
8585 plan_record("Claude Code", "hook", p);
8586 return;
8587 }
8588
8589 printf("Claude Code:\n");
8590
8591 int skill_count = cbm_install_skills(skills_dir, force, dry_run);
8592 printf(" skills: %d installed\n", skill_count);
8593 install_tiered_agent_profiles(
8594 (cbm_tiered_profile_set_t){
8595 .label = "Claude Code",
8596 .verify_path = agent_path,
8597 .binary_path = binary_path,
8598 .legacy_verify_content = legacy_claude_verify_agent_content,
8599 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
8600 },
8601 dry_run);
8602
8603 if (cbm_remove_old_monolithic_skill(skills_dir, dry_run)) {
8604 printf(" removed old monolithic skill\n");
8605 }
8606
8607 /* ~/.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