golangci-lint hangs in sandbox mode

Resolved 💬 2 comments Opened Jan 20, 2026 by jaeyeom Closed Jan 20, 2026

Description

When running golangci-lint run ./... through a git pre-commit hook, the command hangs indefinitely in sandbox mode but completes quickly when run directly on the machine.

Steps to Reproduce

  1. Have a Go project with .golangci.yml configured
  2. Have a pre-commit hook that runs golangci-lint run ./...
  3. Attempt to commit via Claude Code

Expected Behavior

golangci-lint should complete in a reasonable time (similar to running it directly).

Actual Behavior

The command hangs indefinitely. Other commands in the pre-commit hook (like bazel test) complete successfully.

Environment

  • Platform: macOS (Darwin 25.1.0)
  • Claude Code sandbox mode enabled

Hypothesis

golangci-lint likely needs access to paths that are restricted by the sandbox, such as:

  • Go module cache (~/go/pkg/mod)
  • Go build cache (GOCACHE)
  • Potentially other Go toolchain paths

The sandbox may be blocking read/write access to these directories, causing the linter to hang while waiting for resources.

Workaround

Currently, using dangerouslyDisableSandbox: true allows the commit to proceed, but this defeats the purpose of the sandbox.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗