Back to Commands

/check

🧪Code & Analysis & Testing

Run project checks and fix any errors without committing

Allowed Tools: Bash, Edit, Read

Quick Actions

Installation

Option A: Install as User Command (available in all projects)

macOS/Linux:

cp check.md ~/.claude/commands/

Windows:

copy check.md %USERPROFILE%\.claude\commands\

Option B: Install as Project Command (current project only)

macOS/Linux:

mkdir -p .claude/commands && cp check.md .claude/commands/

Windows:

mkdir .claude\commands 2>nul && copy check.md .claude\commands\

Note: After installation, restart Claude Code to load the new command.

Usage

Slash command:

/check

Command Instructions


Run project validation checks and resolve any errors found.


Process:


  • **Detect Package Manager** (for JavaScript/TypeScript projects):
  • - npm: Look for package-lock.json

    - pnpm: Look for pnpm-lock.yaml

    - yarn: Look for yarn.lock

    - bun: Look for bun.lockb


  • **Check Available Scripts**:
  • - Read package.json to find check/validation scripts

    - Common script names: check, validate, verify, test, lint


  • **Run Appropriate Check Command**:
  • - JavaScript/TypeScript:

    - npm: npm run check or npm test

    - pnpm: pnpm check or pnpm test

    - yarn: yarn check or yarn test

    - bun: bun check or bun test


    - Other languages:

    - Python: pytest, flake8, mypy, or make check

    - Go: go test ./... or golangci-lint run

    - Rust: cargo check or cargo test

    - Ruby: rubocop or rake test


  • **Fix Any Errors**:
  • - Analyze error output

    - Fix code issues, syntax errors, or test failures

    - Re-run checks after fixing


  • **Important Constraints**:
  • - DO NOT commit any code

    - DO NOT change version numbers

    - Only fix errors to make checks pass


    If no check script exists, run the most appropriate validation for the project type.