ctxlint — Claude Code MCP server: what it does, how to install
Validates AI agent context files against your actual repository. It catches dead file paths, broken build commands, and exposed secrets.
claude mcp add ctxlint -- npx -y @yawlabs/ctxlintWhat ctxlint does
Context files like CLAUDE.md, .cursorrules, and AGENTS.md rot when code moves around. A renamed directory leaves stale directions behind. The agent follows outdated guidance and fails. The ctxlint server inspects these markdown guides and cross-checks every reference directly against your project files and scripts.
It runs as a zero-dependency bundle and supplies 7 tools over MCP. The engine detects conflicting directives across guides, measures context window token usage, and flags raw secrets pasted into configuration files. When paths break, it uses Git history to suggest the correct location.
For projects using GitHub Actions, it also verifies whether deployment steps and secrets are documented for your assistants.
What it helps with
- find invalid file references inside
CLAUDE.mdand.cursorrules - detect build or test commands missing from
package.jsonandMakefile - reduce wasted tokens by flagging redundant context directives
- spot hardcoded credentials and exposed secrets in agent configs
- resolve conflicting instructions across multiple context documents
Example prompts for the agent
- Run ctxlint to check CLAUDE.md for broken file paths
- Audit all agent context files and calculate token consumption
- Verify that test commands in AGENTS.md match package.json scripts
How to install ctxlint
Platform CLI
claude mcp add ctxlint -- npx -y @yawlabs/ctxlintPlatform CLI
codex mcp add ctxlint -- npx -y @yawlabs/ctxlintConfig file
{
"mcpServers": {
"ctxlint": {
"command": "npx",
"args": [
"-y",
"@yawlabs/ctxlint"
]
}
}
}Config file
{
"servers": {
"ctxlint": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@yawlabs/ctxlint"
]
}
}
}Platform CLI
gemini mcp add ctxlint npx -y @yawlabs/ctxlintStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about ctxlint
How do I install ctxlint in Claude Code?
Run claude mcp add ctxlint -- npx -y @yawlabs/ctxlint in your terminal.
What does ctxlint check?
It validates context files like AGENTS.md and .mcp.json against real files in your repository. It catches broken paths, mismatched commands, rule contradictions, and leaked secrets.
How does ctxlint resolve dead paths?
It inspects Git rename history and applies fuzzy matching to locate moved files, offering suggestions or applying fixes with the --fix flag.