Skip to main content
command CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/lint-fix.md
Open on GitHub

What 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.md

Call it with /lint-fix. For all projects use ~/.claude/commands/

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

Similar slash commands

All slash commands for Code review and refactoring →

From the same set46

The whole set →

Project sponsors

Companies that keep this analytics open