| 2315 | /* ── Agent detection ──────────────────────────────────────────── */ |
| 2316 | |
| 2317 | static bool dir_exists(const char *path) { |
| 2318 | struct stat st; |
| 2319 | #ifndef _WIN32 |
| 2320 | return lstat(path, &st) == 0 && S_ISDIR(st.st_mode); |
| 2321 | #else |
| 2322 | return stat(path, &st) == 0 && S_ISDIR(st.st_mode); |
| 2323 | #endif |
| 2324 | } |
| 2325 | |
| 2326 | /* Resolve the Claude Code config dir. |
| 2327 | * Honors $CLAUDE_CONFIG_DIR; falls back to "$home_dir/.claude". */ |
no test coverage detected