No description
Find a file
2025-11-26 12:12:35 +00:00
.github Dependencies: switch to weekly with cooldown 2025-11-26 12:12:35 +00:00
checkers Ignore some output for JS tests 2025-07-22 22:19:22 +01:00
cmd/gofish Initial version 2025-07-12 21:25:06 +01:00
.gitignore Initial version 2025-07-12 21:25:06 +01:00
go.mod Initial version 2025-07-12 21:25:06 +01:00
LICENCE Initial version 2025-07-12 21:25:06 +01:00
README.md Add javascript test runner 2025-07-22 22:09:26 +01:00
staticcheck.conf Initial version 2025-07-12 21:25:06 +01:00

gofish

Tool to automatically run various checks, for use when an LLM agent such as Claude Code thinks it's finished working.

Available Checkers

Go projects

  • gofmt
  • go vet
  • go test
  • staticcheck (only if there's a custom config file)

JavaScript/TypeScript projects

  • svelte-check (if listed as a dependency)
  • prettier (if listed as a dependency)
  • test (if "test" script is defined in package.json)

Installation

Install from source

go install github.com/csmith/gofish/cmd/gofish@latest

Build locally

git clone https://github.com/csmith/gofish.git
cd gofish
go build ./cmd/gofish

Usage

Command Line

Run gofish in any directory to scan its subdirectories. It can handle 'nested' projects (e.g. having a project.json in a frontend directory).

Claude Code Integration

gofish is designed to be run as a Stop hook in Claude Code.

Setup Hook

  1. Install gofish globally:

    go install github.com/csmith/gofish/cmd/gofish@latest
    
  2. Configure Claude Code settings: Add the following to your Claude Code settings.json:

    {
      "hooks": {
        "Stop": [
          {
            "matcher": "",
            "hooks": [
              {
                "type": "command",
                "command": "gofish"
              }
            ]
          }
        ]
      }
    }
    

    Alternatively, use the /hooks slash command to manually set it up.

The hook will automatically run gofish whenever Claude Code stops working on your code, ensuring it doesn't leave anything in a mess.

For more information on Claude Code hooks, see the official documentation.

Exit Codes

  • 0: Success, no issues found
  • 1: Error running checkers
  • 2: Code quality issues detected