| 2162 | /* ── Agent detection ──────────────────────────────────────────── */ |
| 2163 | |
| 2164 | static bool dir_exists(const char *path) { |
| 2165 | struct stat st; |
| 2166 | #ifndef _WIN32 |
| 2167 | return lstat(path, &st) == 0 && S_ISDIR(st.st_mode); |
| 2168 | #else |
| 2169 | return stat(path, &st) == 0 && S_ISDIR(st.st_mode); |
| 2170 | #endif |
| 2171 | } |
| 2172 | |
| 2173 | /* Resolve the Claude Code config dir. |
| 2174 | * Honors $CLAUDE_CONFIG_DIR; falls back to "$home_dir/.claude". */ |
no test coverage detected