
Go binary size
Guides an agent to shrink Go binaries and container images with measured changes
Go binary size is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 90
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Go binary size
This skill walks an agent through reducing the on-disk size of compiled Go programs and their container images. It insists on recording a baseline build first and attributing bytes to packages with a size analyzer, then applying one change class at a time: stripping symbols and debug data, weighing inlining and cgo trade-offs, reviewing build tags across Makefiles, release configs and Dockerfiles, trimming heavy dependencies and embedded assets, and choosing a minimal runtime base image.
The agent is asked to verify each candidate binary by running it and executing the test suite, and to report a table of each change with its size saving and cost. It also covers compressed size, since gzip narrows the gap between stripped and unstripped builds. UPX packing is treated as a last resort with explicit caveats about startup cost and antivirus false positives.
It expects a Go project with the Go toolchain available. Optional tools such as go-size-analyzer and upx are referenced in its allowed commands, and the examples target a cmd/app entry point and standard go build workflows.
When your agent uses it
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).
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Instructions only, no scripts(see the files on GitHub)
- Asks for: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*), Bash(strip:*)…(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 1 file (7 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.
What it does
- Baseline measurement
- Records a reproducible build size and identifies which packages and symbols take the most space.
- Symbol stripping
- Applies linker flags to drop symbol and DWARF data, with notes on what debugging capability is lost.
- Inlining and cgo trade-offs
- Explains how disabling inlining or cgo affects size and runtime, and how to measure both sides.
- Build tag audit
- Searches Go sources and build configs for tags that gate optional features and can be excluded.
- Dependency weight analysis
- Attributes binary bytes to modules and flags common heavy dependencies to review.
- Container image slimming
- Shows a multi-stage Dockerfile and guidance on choosing a minimal base image.
Good for
- Shrink a Go CLI before distributing it to users
- Find out what is making my Go binary large
- Reduce the size of a Go service's Docker image
- Audit which dependency adds the most bytes to the build
- Strip debug symbols from a Go release build without breaking panics
Go binary size FAQ
When does Go binary size trigger?
When a Go binary or image is too large, when shrinking a CLI for distribution, or when auditing what a dependency adds to the build. Example phrases include binary is too big, strip symbols and ldflags -s -w.
What does stripping with -s -w cost?
Debuggers such as dlv and gdb can no longer resolve source lines, so stripped binaries should not ship where a debugger will be attached. Panic messages and stack traces still work, and the skill recommends keeping an unstripped copy of each release build.
Does Go binary size cover runtime performance or CI setup?
No. Runtime speed and allocations, CI setup, release pipelines and signing, and dependency CVEs are handled by other skills named in its description.
Is UPX recommended?
Only rarely. The skill says it roughly halves on-disk size but adds decompression on every start, breaks mmap-based tooling and can trigger antivirus heuristics, so it is suggested only for size-constrained embedded targets.
Does Go binary size run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Go binary size?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Go binary size?
The closest alternatives to Go binary size are Go performance review, Go build release, Go refactoring, Go project layout and Go dependency audit.
Where this comes from
- Description: from the skill's own SKILL.md.
More from eduardo-sl/go-agent-skills

Guides Go agents in designing HTTP REST APIs, handlers, middleware and shutdown
- Open source
- 90 GitHub stars
- Developer tools

Reviews Go project structure, dependency direction and module boundaries
- Open source
- 90 GitHub stars
- Developer tools

Guides an AI agent to build Go command-line tools with clean flags, streams and exit codes
- Open source
- 90 GitHub stars
- Developer tools

Guides Go code toward constructor injection, explicit wiring and no global state
- Open source
- 90 GitHub stars
- Developer tools

Guides Go code toward idiomatic design patterns like functional options and factories
- Open source
- 90 GitHub stars
- Developer tools

Guides building Go GraphQL servers with gqlgen, covering N+1 batching and query limits
- Open source
- 90 GitHub stars
- Developer tools

