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

Function install_claude_code_config

src/cli/cli.c:7204–7373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7202 const char *legacy_verify_content, bool dry_run);
7203
7204static void install_claude_code_config(const char *home, const char *binary_path, bool force,
7205 bool dry_run) {
7206 char config_dir[CLI_BUF_1K];
7207 cbm_claude_config_dir(home, config_dir, sizeof(config_dir));
7208 char user_root[CLI_BUF_1K];
7209 cbm_claude_user_root(home, user_root, sizeof(user_root));
7210
7211 char skills_dir[CLI_BUF_1K];
7212 char agent_path[CLI_BUF_1K];
7213 snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir);
7214 snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.md", config_dir);
7215
7216 /* Plan mode: record the planned writes and return without mutating (#388). */
7217 if (g_install_plan) {
7218 char p[CLI_BUF_1K];
7219 snprintf(p, sizeof(p), "%s/codebase-memory/SKILL.md", skills_dir);
7220 plan_record("Claude Code", "skill", p);
7221 install_tiered_agent_profiles(
7222 (cbm_tiered_profile_set_t){
7223 .label = "Claude Code",
7224 .verify_path = agent_path,
7225 .binary_path = binary_path,
7226 .legacy_verify_content = legacy_claude_verify_agent_content,
7227 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
7228 },
7229 dry_run);
7230 snprintf(p, sizeof(p), "%s/.claude.json", user_root);
7231 plan_record("Claude Code", "mcp_config", p);
7232 snprintf(p, sizeof(p), "%s/settings.json", config_dir);
7233 plan_record("Claude Code", "hook", p);
7234 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_HOOK_GATE_SCRIPT);
7235 plan_record("Claude Code", "hook", p);
7236 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_SESSION_REMINDER_SCRIPT);
7237 plan_record("Claude Code", "hook", p);
7238 snprintf(p, sizeof(p), "%s/hooks/%s", config_dir, CMM_SUBAGENT_REMINDER_SCRIPT);
7239 plan_record("Claude Code", "hook", p);
7240 return;
7241 }
7242
7243 printf("Claude Code:\n");
7244
7245 int skill_count = cbm_install_skills(skills_dir, force, dry_run);
7246 printf(" skills: %d installed\n", skill_count);
7247 install_tiered_agent_profiles(
7248 (cbm_tiered_profile_set_t){
7249 .label = "Claude Code",
7250 .verify_path = agent_path,
7251 .binary_path = binary_path,
7252 .legacy_verify_content = legacy_claude_verify_agent_content,
7253 .dialect = CBM_GRAPH_DIALECT_CLAUDE,
7254 },
7255 dry_run);
7256
7257 if (cbm_remove_old_monolithic_skill(skills_dir, dry_run)) {
7258 printf(" removed old monolithic skill\n");
7259 }
7260
7261 /* ~/.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