(filePath: string)
| 223 | |
| 224 | // Always ask when Claude Code tries to edit its own config files |
| 225 | function isClaudeConfigFilePath(filePath: string): boolean { |
| 226 | if (isClaudeSettingsPath(filePath)) { |
| 227 | return true |
| 228 | } |
| 229 | |
| 230 | // Check if file is within .claude/commands or .claude/agents directories |
| 231 | // using proper path segment validation (not string matching with includes()) |
| 232 | // pathInWorkingPath now handles case-insensitive comparison to prevent bypasses |
| 233 | const commandsDir = join(getOriginalCwd(), '.claude', 'commands') |
| 234 | const agentsDir = join(getOriginalCwd(), '.claude', 'agents') |
| 235 | const skillsDir = join(getOriginalCwd(), '.claude', 'skills') |
| 236 | |
| 237 | return ( |
| 238 | pathInWorkingPath(filePath, commandsDir) || |
| 239 | pathInWorkingPath(filePath, agentsDir) || |
| 240 | pathInWorkingPath(filePath, skillsDir) |
| 241 | ) |
| 242 | } |
| 243 | |
| 244 | // Check if file is the plan file for the current session |
| 245 | function isSessionPlanFile(absolutePath: string): boolean { |
no test coverage detected