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

Function install_claude_code_config

src/cli/cli.c:7210–7379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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