Skip to content

agent-name-filename-mismatch

Agent name must match filename

From plugin
claudelint
1513 skills13 agents1 command1 hook

Claude Code

> /plugin marketplace add pdugan20/claudelint
> /plugin install claudelint@claudelint

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
@pdugan20
Ships withclaudelint

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

Stars on GitHub

Momentum

stars in total
15
Star history of pdugan20/claudelint on GitHub, a chart by star-history.com

Other agents on claudelint.

claude-md-optimizer
Auto-invoked

claude-md-optimizer

Agent

Use this agent when the user wants to autonomously validate and optimize their CLAUDE.md files. This agent runs claudelint…

@pdugan20@pdugan20Install Agent

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about agent-name-filename-mismatch.

Which coding agents can use agent-name-filename-mismatch?
agent-name-filename-mismatch installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.