#1180: a bare ~/.claude directory is not a Claude Code install -- other * tools create it -- and treating it as one wrote hooks, skills and MCP * entries for a client the user never installed. Claude Code itself leaves * its user config .claude.json (under CLAUDE_CONFIG_DIR when set), its * settings.json, or the claude CLI. */
| 3124 | * its user config .claude.json (under CLAUDE_CONFIG_DIR when set), its |
| 3125 | * settings.json, or the claude CLI. */ |
| 3126 | static bool cbm_claude_code_detected(const char *home_dir) { |
| 3127 | char dir[CLI_BUF_1K]; |
| 3128 | char path[CLI_BUF_1K]; |
| 3129 | cbm_claude_config_dir(home_dir, dir, sizeof(dir)); |
| 3130 | int written = snprintf(path, sizeof(path), "%s/settings.json", dir); |
| 3131 | if (dir[0] && written > 0 && (size_t)written < sizeof(path) && cbm_file_exists(path)) { |
| 3132 | return true; |
| 3133 | } |
| 3134 | cbm_claude_user_root(home_dir, dir, sizeof(dir)); |
| 3135 | written = snprintf(path, sizeof(path), "%s/.claude.json", dir); |
| 3136 | if (dir[0] && written > 0 && (size_t)written < sizeof(path) && cbm_file_exists(path)) { |
| 3137 | return true; |
| 3138 | } |
| 3139 | return cbm_agent_cli_exists("claude", home_dir); |
| 3140 | } |
| 3141 | |
| 3142 | /* OpenCode keeps its data (auth, logs, sessions; the global config itself on |
| 3143 | * older installs) in ~/.local/share/opencode on every OS -- |
no test coverage detected