lint-fix — Claude Code command: what it does, how to install
lint-fix detects repository linters, runs formatting and auto-fixes, then reports unresolved issues.
MIT ★ 1,424 updated 2026-10-06
.claude/commands/lint-fix.mdWhat lint-fix does
The prompt inspects root files, package.json scripts, staged git files, and recent commit diffs to discover the project setup. It then plans the correction pass accordingly.
Formatters run first, covering tools like Prettier, Black, gofmt, and rustfmt. After that, it executes fix-enabled linters: eslint --fix for JavaScript or TypeScript, ruff check --fix or black with isort for Python, go vet for Go, and cargo clippy --fix for Rust. You can also pass an optional file or directory path as an argument to limit the scope.
Execution relies strictly on system package runners like npm, pnpm, bun, python, go, and cargo. Missing CLI binaries will cause individual fixer steps to fail.
What it helps with
- clean up code formatting across changed files
- apply automated linter fixes for JS, Python, Go, or Rust
- identify syntax and style errors needing manual edits
Example prompts for the agent
- /lint-fix
- /lint-fix src/services
How to install lint-fix
Manually: put the files in place
.claude/commands/lint-fix.mdCall it with /lint-fix. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/lint-fix.mdCall it with /prompts:lint-fix. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/lint-fix.prompt.mdManually: put the files in place
.gemini/commands/lint-fix.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about lint-fix
How to install lint-fix in Claude Code?
Place the command markdown definition at .claude/commands/lint-fix.md within your project repository.
What does the lint-fix command do?
It identifies active linters in your workspace, executes formatters and auto-fixes, and prints a final list of remaining manual issues.
Can lint-fix target a specific directory?
Yes, you can supply a file or folder path directly as an argument after the command name.
Source text
lint-fix.md · MIT
--- allowed-tools: Bash(npm:*), Bash(npx:*), Bash(yarn:*), Bash(pnpm:*), Bash(bun:*), Bash(python:*), Bash(go:*), Bash(cargo:*) description: Auto-fix all linting and formatting issues argument-hint: "[optional file or directory path]" --- ## Context - Project root files (infer the project type and lint config from these): !`ls -a` - Package scripts: !`cat package.json 2>/dev/null | grep -A 20 '"scripts"' | head -25 || echo "No package.json"` - Staged files: !`git diff --name-only --cached 2>/dev/null` - Files changed in the last commit: !`git diff --name-only HEAD~1 2>/dev/null | head -50` ## Task Auto-fix all linting and formatting issues: 1. Detect the project type and available linters 2. Run formatters first (Prettier, Black, gofmt, rustfmt) 3. Run linters with auto-fix enabled: - JavaScript/TypeScript: `eslint --fix` - Python: `ruff check --fix` or `black` + `isort` - Go: `gofmt -w` + `go vet` - Rust: `cargo fmt` + `cargo clippy --fix` 4. Report what was fixed 5. List any remaining issues that require manual attention Scope: $ARGUMENTS
© CloudAI-X · MIT · CloudAI-X/claude-workflow-v2