4215
let claudeMdCount = 0;
4216
for (const s of sources) {
4218
>
// AGENTS.md / CLAUDE.md / GEMINI.md as `home`/`repo`/`model`
4219
>
if (s.type === 'home' || s.type === 'repo' || s.type === 'model') {
4220
>
agentInstructionsCount++;
4221
>
}
4222
>
4223
>
if (s.applyTo && s.applyTo.length > 0) {
4224
>
applyingInstructionsCount++;
4225
>
}
4226
>
4227
>
if (s.type === 'child-instructions' || s.type === 'nested-agents') {
4228
>
referencedInstructionsCount++;
4229
>
}
4230
>
4231
>
const lastSep = Math.max(s.sourcePath.lastIndexOf('/'), s.sourcePath.lastIndexOf('\\'));
4232
>
const filename = lastSep >= 0 ? s.sourcePath.slice(lastSep + 1) : s.sourcePath;
4233
>
if (filename === 'CLAUDE.md') {
4234
>
claudeMdCount++;
4235
>
}
4236
>
}
4237
4238
type AgentHostInstructionsCollectedEvent = {