Claude Code Plugin
This guide covers how to install and use claudelint as a Claude Code plugin.
Installation
Prerequisites
The plugin's skills run claudelint CLI commands under the hood. Install the npm package first:
npm install -g claude-code-lintGlobal makes claudelint available in every project. Project-local pins a version for your team via package.json. See Global vs Project Install for help choosing.
From the Marketplace
Add the marketplace (one-time setup):
text/plugin marketplace add pdugan20/claudelintInstall the plugin:
text/plugin install claudelint@pdugan20-plugins
Choose your installation scope when prompted:
- User scope (default, recommended) — available in all your projects
- Project scope — shared with collaborators via
.claude/settings.json - Local scope — only you, only this repo
Team Setup
To pre-configure the plugin for all collaborators, commit this to .claude/settings.json:
{
"extraKnownMarketplaces": {
"pdugan20-plugins": {
"source": {
"source": "github",
"repo": "pdugan20/claudelint"
}
}
},
"enabledPlugins": {
"claudelint@pdugan20-plugins": true
}
}When a collaborator opens Claude Code in this project, they will be prompted to install the plugin.
Local Development / Testing
For plugin contributors, load the plugin directly:
claude --plugin-dir ./node_modules/claude-code-lintSkills
Once installed, the plugin adds 9 skills that Claude can use automatically. Ask naturally or invoke directly with /<name>.
Validation
/validate-allRuns every validator on your entire project — CLAUDE.md, skills, settings, hooks, MCP servers, and plugin manifests.
/validate-cc-mdChecks CLAUDE.md file size, @import directives, frontmatter, and section organization.
/validate-skillsChecks SKILL.md frontmatter, allowed-tools, file references, and shell script security.
/validate-settingsChecks settings.json schema, permissions, and environment variables.
/validate-hooksChecks hooks.json events, matcher patterns, and command script references.
/validate-mcpChecks .mcp.json transport types, server names, and environment variables.
/validate-pluginChecks plugin.json manifest schema, versioning, and component references.
Quality and Optimization
/format-ccAuto-formats Claude Code files with markdownlint, prettier, and shellcheck.
/optimize-cc-mdInteractive workflow to reduce CLAUDE.md size, remove generic content, and organize @import files.
The optimize-cc-md skill runs a guided 3-phase workflow (validate, assess, improve) to reduce CLAUDE.md file size by extracting content into @import files, removing generic instructions, and reorganizing by concern. Use it when claudelint check-all flags claude-md-size violations or when your CLAUDE.md has grown large.
See the CLI Reference for all available flags when using slash commands directly.
Automatic Validation
Set up a SessionStart hook so Claude is automatically aware of validation issues at the start of every session:
claudelint init --hooksThis creates .claude/hooks/hooks.json with a hook that runs claudelint check-all when a Claude Code session begins. See Claude Code Hooks for manual setup and alternative hook types.
Configuration
The plugin respects your project's configuration files:
.claudelintrc.json— Rule configuration.claudelintignore— Files to ignore
See the Configuration Guide for details.
Global vs Project Install
| Scenario | npm Install | Plugin Scope |
|---|---|---|
| Individual developer, all projects | npm install -g | User scope |
| Team project, pinned version | npm install --save-dev | Project scope |
| Trying it out | npm install --save-dev | Local scope |
- Global npm + User scope is the simplest setup. Install once and claudelint works everywhere.
- Local npm + Project scope gives teams a pinned version. Add
claude-code-linttodevDependenciesand commit.claude/settings.jsonso everyone gets the same setup.
Keeping Up to Date
The plugin and npm package are updated independently.
Plugin Updates
Third-party marketplace plugins don't auto-update by default. Enable it via /plugin → Marketplaces → pdugan20-plugins → Enable auto-update. When enabled, Claude Code checks for updates at startup and prompts you to run /reload-plugins when new versions are available.
To update manually:
/plugin marketplace update pdugan20-pluginsnpm Package Updates
npm install -g claude-code-lint@latestThe plugin's SessionStart hook detects version mismatches between the plugin and npm package — Claude will mention it and offer to fix it at the start of your session.
Environment variables for auto-update control
Set DISABLE_AUTOUPDATER=true to disable all automatic updates (Claude Code and plugins). To keep plugin auto-updates while disabling Claude Code updates, also set FORCE_AUTOUPDATE_PLUGINS=true.
Troubleshooting
Skills don't appear
Problem: Slash commands from the plugin aren't available in Claude Code.
Solution:
- Check plugin is installed:
/plugin list - Reinstall if needed:
/plugin uninstall claudelintthen reinstall - Restart Claude Code session
Validation fails
Problem: Running a validation skill returns unexpected errors.
Solution:
- Run with
--explainflag for detailed guidance - Check
.claudelintrc.jsonfor rule configuration - See error messages for specific line numbers and fixes
- Review Rules Reference for rule details
Permission denied
Problem: Permission errors when the plugin tries to run claudelint.
Solution:
- Check
claudelintis installed:which claudelint - Install globally if needed:
npm install -g claude-code-lint - Check PATH includes npm global bin directory
False positives
Problem: Warnings or errors that don't apply to your project.
Solution:
- Use inline disable comments:
<!-- claudelint-disable rule-name --> - Configure rules in
.claudelintrc.json - Add file overrides for specific patterns
- Report an issue if the rule is incorrect
Skills work in one project but not another
Problem: Plugin skills run in some projects but fail in others.
The npm package is likely installed locally (in node_modules) rather than globally.
Solution:
- Install globally:
npm install -g claude-code-lint - Or add
claude-code-linttodevDependenciesin each project
Version mismatch warning
Problem: Claude mentions a version mismatch between the plugin and npm package at session start.
The plugin and npm package are out of sync. Claude will offer to fix it for you, or you can update manually:
Solution:
npm install -g claude-code-lint@latestAuto-update not working
Problem: The plugin doesn't auto-update when new versions are released.
Third-party marketplaces have auto-update disabled by default. Also check that DISABLE_AUTOUPDATER is not set in your environment.
Solution: Enable auto-update via /plugin → Marketplaces → pdugan20-plugins → Enable auto-update, or update manually with /plugin marketplace update pdugan20-plugins.
Uninstalling
To remove the plugin:
/plugin uninstall claudelintSee Also
- Configuration Guide - Customize validation rules
- Claude Code Hooks - Automatic validation hooks
- Rules Reference - What gets validated
- CLI Reference - All commands and flags