Shrink Go binaries
Shrinks Go binaries and container images by measuring what costs bytes, so your CLI and images ship smaller.
Claude's review
7/10 Measurement first Go binary shrinking guide with costs of each flag and container advice.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Reduce the size of compiled Go binaries and container images: linker flags, inlining budget, CGO and build tags, embedded assets, dependency weight, and measuring what actually costs bytes. Use when a binary or image is too large, when shrinking a CLI for distribution, or when auditing what a dependency adds to the build. Trigger examples: "binary is too big", "shrink the binary", "reduce image size", "strip symbols", "what is making my binary large", "ldflags -s -w". Not for: runtime speed and allocations (go-performance-review), CI setup (go-ci), release pipelines and signing (go-build-release), dependency CVEs (go-dependency-audit).
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: go-binary-size
description: >
Reduce the size of compiled Go binaries and container images: linker
flags, inlining budget, CGO and build tags, embedded assets, dependency
weight, and measuring what actually costs bytes. Use when a binary or
image is too large, when shrinking a CLI for distribution, or when
auditing what a dependency adds to the build. Trigger examples: "binary is
too big", "shrink the binary", "reduce image size", "strip symbols", "what
is making my binary large", "ldflags -s -w".
Not for: runtime speed and allocations (go-performance-review), CI setup
(go-ci), release pipelines and signing (go-build-release), dependency
CVEs (go-dependency-audit).
user-invocable: true
license: MIT
compatibility: Designed for Claude Code or similar AI coding agents working on Go projects. Requires the Go toolchain. upx and go-size-analyzer are optional.
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(gofmt:*) Bash(strip:*) Bash(upx:*) Bash(gsa:*)
metadata:
author: eduardo-sl
version: "1.0.2"
---
# Go Binary Size
A stock Go binary carries the runtime, the garbage collector, full symbol and
line tables, and every transitively reachable package. 8-15 MiB for a small
CLI is normal. Most of it is removable, but only with measurement — guessing
which dependency is heavy is almost always wrong.
## Procedure
Never apply a flag without a before and after number.
1. Build a baseline and record its size.
2. Find where the bytes are.
3. Apply one change class at a time, measuring after each.
4. Verify the binary still runs and its tests still pass.
5. Report the table of change → bytes saved → cost.
## 1. Measure First
...From eduardo-sl's repository, MIT licence.
Related skills
-
Checked
Rust code review
Reviews Rust code for idiom, errors, safety and API design, with a ranked report and a fix for every finding.
7/101 credit -
Checked
Java Debugging Guide
Finds the cause of Java bugs and failing tests, and attaches a debugger safely in Maven, Gradle, Spring or Docker.
7/101 credit -
Checked
Python games with pygame
Builds and debugs 2D pygame games with a proper loop and delta time, so they run the same on any PC.
7/101 credit -
Checked
Go Benchmarking and Profiling
Writes Go benchmarks, profiles them with pprof and proves each speedup with benchstat before you claim it.
7/101 credit -
Checked
nvMolKit GPU cheminformatics
Writes nvMolKit code for GPU fingerprints, similarity and clustering, so molecule searches run far faster.
7/101 credit -
Checked
Modern Java Coding
Writes and reviews modern Java 21 and 25 code with records, sealed types, pattern matching and virtual threads.
7/101 credit