| 2134 | /* ── Agent detection ──────────────────────────────────────────── */ |
| 2135 | |
| 2136 | static bool dir_exists(const char *path) { |
| 2137 | struct stat st; |
| 2138 | #ifndef _WIN32 |
| 2139 | return lstat(path, &st) == 0 && S_ISDIR(st.st_mode); |
| 2140 | #else |
| 2141 | return stat(path, &st) == 0 && S_ISDIR(st.st_mode); |
| 2142 | #endif |
| 2143 | } |
| 2144 | |
| 2145 | /* Resolve the Claude Code config dir. |
| 2146 | * Honors $CLAUDE_CONFIG_DIR; falls back to "$home_dir/.claude". */ |
no test coverage detected