Skip to content

agent-name-filename-mismatch

Agent name must match filename

From plugin
claudelint
1113 skills13 agents1 command1 hook
Install
$ npx -y skills add pdugan20/claudelint --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Agent name must match filename

Agent definition

agent-name-filename-mismatch.md
description: "Agent name must match filename"

agent-name-filename-mismatch

<RuleHeader description="Agent name must match filename" severity="error" :fixable="false" :configurable="false" category="Agents" />

Rule Details

This rule checks that the `name` field in agent frontmatter exactly matches the filename (without the `.md` extension). For example, an agent at `.claude/agents/code-reviewer.md` must have `name: code-reviewer` in its frontmatter. This consistency ensures agents are discoverable and prevents confusion when the filename and configuration disagree about the agent identity.

Incorrect

Agent name does not match filename (file at .claude/agents/code-reviewer.md)

---
name: review-agent
description: Reviews code for quality
---

Correct

Agent name matches filename (file at .claude/agents/code-reviewer.md)

---
name: code-reviewer
description: Reviews code for quality
---

How To Fix

Either rename the file to match the agent name, or update the `name` field in frontmatter to match the filename (without the `.md` extension).

Options

This rule does not have any configuration options.

Related Rules

  • [`agent-name`](/rules/agents/agent-name)

Resources

  • [Rule Implementation](https://github.com/pdugan20/claudelint/blob/main/src/rules/agents/agent-name-filename-mismatch.ts)
  • [Rule Tests](https://github.com/pdugan20/claudelint/blob/main/tests/rules/agents/agent-name-filename-mismatch.test.ts)

Version

Available since: v0.2.0

Read more
Ships withclaudelint

A linter for Claude Code projects. Validates CLAUDE.md files, skills, settings, hooks, MCP servers, plugins, and more.

Get the whole plugin, auto-invoked
Stats
11
Stars
0
Views
0
Forks
Active
Maintenance
TypeScript
Language
MIT
License
2d ago
Last commit
6mo ago
Created

Repo: pdugan20/claudelint