golang-performance

golang-performance is a skill for Claude Code from MadAppGang/claude-code. It costs 33 tokens per session (5,610 once invoked), scanned A, original, MIT.

A guide to measuring and improving the performance of Go applications. It covers CPU, memory, and goroutine profiling with pprof, benchmarks, memory allocation analysis, and runtime tuning.

In plain words
What is it for?
Use it to profile production Go code, investigate slow requests or memory leaks, run benchmarks, inspect allocations, and tune garbage collection.
Why use it?
It helps locate real performance bottlenecks before making optimisation changes based on guesswork.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dev plugin — 47 skills, 12 commands, 14 agents shipped together

Good fit Use it to profile production Go code, investigate slow requests or memory leaks, run benchmarks, inspect allocations, and tune garbage collection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/madappgang/claude-code/golang-performance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add MadAppGang/claude-code --skill golang-performance
Clone the repo
git clone --depth 1 https://github.com/MadAppGang/claude-code

Made for: Claude Code.

Or install dev, the plugin that ships this one along with the rest of its 47 skills, 12 commands, 14 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for golang-performance

README.md
[![agentmods](https://agentmods.dev/badge/skills/madappgang/claude-code/golang-performance/github.svg)](https://agentmods.dev/skills/madappgang/claude-code/golang-performance)
Your own site
<a href="https://agentmods.dev/skills/madappgang/claude-code/golang-performance"><img src="https://agentmods.dev/badge/skills/madappgang/claude-code/golang-performance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for golang-performance

Your own site · 80×15
<a href="https://agentmods.dev/skills/madappgang/claude-code/golang-performance"><img src="https://agentmods.dev/badge/skills/madappgang/claude-code/golang-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,610 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.05610
Opus 5.5 $0.00013 $0.02244
Sonnet 5.5 $0.00007 $0.01122
Haiku 4.5 $0.00003 $0.00561

Measured 2mo ago against content hash d76da06a2a6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

golang-performance scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost:6060/debug/pprof/profile?seconds=30 > cpu.prof
plugins/dev/skills/backend/golang-performance/SKILL.md · 927 lines

How it starts

The opening of the file, as written. The whole thing — 927 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Go Performance Optimization

Overview

This skill provides comprehensive guidance for profiling, benchmarking, and optimizing Go applications. Use this skill when working on performance-critical code, investigating bottlenecks, or optimizing production systems.

When to Use This Skill:

  • Profiling application performance
  • Benchmarking code changes
  • Investigating memory leaks or high allocations
  • Optimizing hot paths
  • Tuning garbage collection
  • Reducing latency in production

Core Tools:

  • pprof - CPU, memory, and goroutine profiling
  • go test -bench - Benchmarking framework
  • go build -gcflags - Escape analysis
  • GOGC and GOMEMLIMIT - GC tuning

1. Profiling with pprof

1.1 CPU Profiling

Enable CPU Profiling in Code:

import (
    "os"
    "runtime/pprof"
)

func main() {
    f, err := os.Create("cpu.prof")
    if err != nil {
        log.Fatal("could not create CPU profile: ", err)
    }
    defer f.Close()

    if err := pprof.StartCPUProfile(f); err != nil {
        log.Fatal("could not start CPU profile: ", err)
    }
    defer pprof.StopCPUProfile()

    // Your application code here
    runApplication()
}

CLI Profiling:

# Profile a test
go test -cpuprofile=cpu.prof -bench=.

# Profile a binary
go test -c
./myapp.test -test.cpuprofile=cpu.prof -test.bench=.

Analysis Commands:

# Interactive web UI (recommended)
go tool pprof -http=:8080 cpu.prof

# Text output - top functions by CPU time
go tool pprof -top cpu.prof

# Top 20 with cumulative time
go tool pprof -top -cum cpu.prof | head -20

# Call graph visualization
go tool pprof -svg cpu.prof > cpu.svg

# Focus on specific function
go tool pprof -focus=processData cpu.prof

# Exclude standard library
go tool pprof -ignore=runtime cpu.prof

Interpreting CPU Profiles:

  • flat: Time spent in function itself (excludes callees)
  • flat%: Percentage of total runtime
  • sum%: Cumulative percentage
  • cum: Time spent in function and callees
  • cum%: Cumulative time percentage

Read the full file on GitHub · 927 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 927 lines · 33 tokens per session scan A d76da06a2a6f

Subscribe to this mod's changes

golang-performance is a skill published in the GitHub repository MadAppGang/claude-code (286 stars, last pushed 7mo ago), licensed MIT. It adds 33 tokens to every session and 5,610 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.