| 2184 | /* ── Agent detection ──────────────────────────────────────────── */ |
| 2185 | |
| 2186 | static bool dir_exists(const char *path) { |
| 2187 | struct stat st; |
| 2188 | #ifndef _WIN32 |
| 2189 | return lstat(path, &st) == 0 && S_ISDIR(st.st_mode); |
| 2190 | #else |
| 2191 | return stat(path, &st) == 0 && S_ISDIR(st.st_mode); |
| 2192 | #endif |
| 2193 | } |
| 2194 | |
| 2195 | /* Resolve the Claude Code config dir. |
| 2196 | * Honors $CLAUDE_CONFIG_DIR; falls back to "$home_dir/.claude". */ |
no test coverage detected