/everything-copilot-cli:go-runtime-debuggingfrom everything-copilot-cli
Diagnoses Go runtime issues: panics, hangs, deadlocks, goroutine/memory leaks, data races, and unexplained slowdowns using race detector, pprof, execution traces, and Delve.
Ships in everything-copilot-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
systematic-debugging gives you the language-neutral method. This skill adds the Go toolchain and
runtime techniques that matter once the bug involves goroutines, channels, the scheduler, or the
garbage collector — failures that do not show up in a stack trace from a single panic.
fatal error: all goroutines are asleep - deadlock!go test -race reports a data race, or a test fails only some of the time| Instead of go-runtime-debugging | Use |
|---|---|
A compile or go vet error | fix-build-errors |
| A logic bug that reproduces deterministically in one goroutine | systematic-debugging |
| Native crashes in cgo or C/C++ libraries | cpp-debugging |
| A logic bug where a failing regression test can be written before any runtime diagnosis | tdd-workflow first, then this skill if runtime behavior is involved |
go requirement and any toolchain directive
(go version, go env GOVERSION GOTOOLCHAIN)Record go version, GOOS/GOARCH, GOMAXPROCS, and the exact command. Turn an intermittent
failure into a repeatable one before reading code:
go test -run TestOrderFlow -count=200 -failfast ./internal/orders/
go test -run TestOrderFlow -count=50 -cpu=1,4,16 ./internal/orders/
go test -race -run TestOrderFlow -count=20 ./internal/orders/
A race report names two goroutines and the memory they share. Fix the ownership (a mutex, a
channel handoff, or no sharing), not the symptom. A clean -race run only covers the paths the run
executed — it does not prove the code race-free.
go test -v -timeout 30s -run TestOrderFlow ./internal/orders/ prints every
goroutine's stack when the timeout fires; target the hanging package so unrelated output stays out/debug/pprof/goroutine?debug=2 when net/http/pprof is enabled. As a last
resort, SIGQUIT (Unix) prints a stack dump and terminates the process under Go's default signal
handling — check that the program does not intercept or ignore SIGQUITGroup stacks by the line they are blocked on. Many goroutines parked on the same channel send,
receive, sync.WaitGroup.Wait, or select point to a missing close, a missing receiver, or a
context that is never cancelled.
go test -run TestOrderFlow -memprofile mem.out -cpuprofile cpu.out ./internal/orders/
go tool pprof -top mem.out
go tool pprof -top cpu.out
For a service with net/http/pprof, capture two steady-state heap profiles minutes apart with
/debug/pprof/heap?gc=1 (which runs a GC first) and compare them with
go tool pprof -diff_base=heap1.pb.gz heap2.pb.gz. Retained growth identifies leak candidates;
confirm the objects are retained unintentionally (not a bounded cache) before calling it a leak. Use the
block and mutex profiles for contention; they are off until the program sets
runtime.SetBlockProfileRate and runtime.SetMutexProfileFraction.
go test -run TestOrderFlow -trace trace.out ./internal/orders/
go tool trace trace.out
The trace shows when goroutines were runnable but not running, GC pauses, and syscall blocking. Use it when profiles look flat but requests are slow.
dlv test ./internal/orders/ -- -test.run TestOrderFlow
Delve starts paused: set a breakpoint (break orders.go:42) and continue to run to it or to the
failure. Then goroutines lists every goroutine and goroutine <id> bt shows its stack. Attach
to a running process with dlv attach <pid> only where pausing it is acceptable.
| Rationalization | Reality |
|---|---|
| "The test is flaky, retry it" | Intermittent Go failures are usually races or ordering bugs; -count and -race find them |
"Add a time.Sleep so the goroutine finishes" | Sleeps hide ordering bugs and fail under load; synchronize explicitly |
| "Memory grows because Go's GC is lazy" | Growth that survives repeated GC is a leak or intentional retention; inspect what retains it and the expected cache bounds |
| "-race passed, so it's safe" | The detector only sees executed paths; cover the concurrent path in the run |
recover() is added to silence a panic instead of fixing its cause-count (for example 200)go test -race ./... passes for the affected packagesgo vet ./... passesIf the patch introduces a new race, leak, or slowdown in these checks, revert it, keep the profiles and the reproduction command in the issue, and form the next hypothesis from them.
GOTRACEBACK=all prints all goroutines on a fatal panic, not just the crashing oneGODEBUG=gctrace=1 prints one line per GC cycle — a quick check on heap growthnet/http/pprof on an internal-only listener; never expose it publiclyWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub drvoss/everything-copilot-cli --plugin everything-copilot-cli115 skills in this plugin
/actions-debuggingUse when a GitHub Actions workflow fails — diagnose the run log, identify the root cause, and apply a targeted fix/add-to-changelogUse when you've shipped a feature, fix, or breaking change and need to update CHANGELOG.md — follows Keep a Changelog format and syncs version numbers across package manifests./agent-governanceUse when designing or reviewing an AI agent system that needs policy-based access controls, intent classification, tool-level rate limiting, trust scoring for multi-agent workflows, or append-only audit trails.
Other plugins' skills for the same job