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