# ctxlint [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/YawLabs/ctxlint  
**GitHub Stars:** 12  
**npm Downloads (last month):** 127319  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ctxlint

## Description
Lint AI agent context files (CLAUDE.md, AGENTS.md, etc.) against your actual codebase

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "ctxlint": {
    "command": "npx",
    "args": ["-y","@yawlabs/ctxlint@latest"]
  }
}
```

## Documentation

## What ctxlint does

ctxlint compares the instructions and configuration surrounding an AI coding project with the files, scripts, workflows, and settings that actually exist. It covers common context formats and files such as `CLAUDE.md`, `AGENTS.md`, Cursor rules, Copilot instructions, Windsurf rules, `.mcp.json`, and Claude Code settings.

Its checks include references to missing files, commands that do not match `package.json`, Makefile, Gradle, or Maven configuration, and instructions that conflict between context files. It also measures context usage, identifies content likely to be redundant, and highlights context that has become stale after code changes.

Security-focused checks find inline credentials matching several provider token and private-key patterns. CI checks compare workflows and referenced secrets with project documentation. Cross-project checks can identify missing workflows or secrets, and configuration differences among sibling repositories. Memory entries pointing to deleted paths and hooks targeting missing scripts are also covered.

## How it works

The linter reads project context files and compares their claims with repository contents, build configuration, Git history, CI workflows, and selected settings. Git rename information and fuzzy matching help it suggest replacement paths when a referenced file moved. Secret findings redact the value and expose only a short prefix.

Run it as a command-line lint step, pre-commit check, CI job, or file watcher. The `--watch` option reruns checks when context files change, while `--fix` can rewrite broken paths using rename information. Output is available as human-readable text, JSON, or SARIF for GitHub Code Scanning.

As an MCP server, ctxlint exposes seven tools for editor and agent workflows. Tool annotations support clients that use them when deciding whether an action can be approved automatically.

## Setup and configuration

Run the package without a global installation:

```bash
npx -y @yawlabs/ctxlint@latest
```

For a team project, install it as a development dependency with npm or pnpm and add a script such as `ctxlint --strict` to `package.json`. A global npm installation is available when the command should be accessible across projects.

The MCP installation uses the package command and its `serve` argument. The project can also be added to a local Yaw MCP configuration for use in Yaw Terminal sessions. The `--hooks-global` option extends dead-hook scanning from the project’s Claude settings to the user-level `~/.claude/settings.json`.

## Tools and capabilities

- Check context files against real project paths and build commands.
- Detect contradictory instructions, stale references, redundant content, and token consumption.
- Validate frontmatter in Cursor, Copilot, and Windsurf rule files.
- Inspect CI workflows, documented secrets, sibling-project consistency, and missing workflows.
- Find inline secrets without echoing their complete values.
- Audit Claude Code hooks, permissions, and memory references.
- Suggest or apply path repairs based on Git renames.
- Serve results through MCP or emit text, JSON, and SARIF from the CLI.

## Limitations and notes

Automatic repair is focused on broken paths that can be resolved through Git history; other findings remain lint results or suggestions. Secret detection reports only a redacted prefix rather than the full value. The available checks depend on the repository artifacts being inspected, such as build files, workflow files, sibling projects, and Claude settings.

_Full upstream README: https://allmcps.com/mcp/ctxlint/readme_

