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

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.

agentmods
npx agentmods add skills/madappgang/claude-code/golang-performance
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00016 $0.02805
Sonnet 5 $0.00007 $0.01122
Haiku 4.5 $0.00003 $0.00561

Measured 2d ago against content hash d76da06a2a6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 2d 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. 2d 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 (279 stars, last pushed 5mo ago), licensed MIT. It adds 33 tokens to every session and 5,610 once invoked, about $0.0002 per session on Opus 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.

Related

Other skills, from other repositories

cairo-optimization

Improves Cairo performance after correctness is established. Trigger on "optimize", "gas usage", "reduce steps", "profile", "BoundedInt", "storage packing", "benchmark". Guides profiling, arithmetic optimization, and bounded-int hardening.

keep-starknet-strange/starknet-agentic · 55 tokens

performance-expert

Expert-level performance optimization, profiling, benchmarking, and tuning. Use when the user mentions optimization, profiling, benchmarking, or scalability, or when the task involves Performance Fundamentals, Optimization Areas, Profiling Tools, or General.

personamanagmentlayer/pcl · 48 tokens

performance-optimization

Enterprise performance optimization skill that identifies bottlenecks, analyzes caching strategies, performs load testing, and provides actionable optimization recommendations with detailed profiling metrics.

XSpoonAi/spoon-awesome-skill · 31 tokens

golang-testing

Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.

affaan-m/ECC · 37 tokens

golang-patterns

Go-specific design patterns and best practices including functional options, small interfaces, dependency injection, concurrency patterns, error handling, and package organization. Use when working with Go code to apply idiomatic Go patterns.

affaan-m/ECC · 45 tokens

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for…

JanDeDobbeleer/oh-my-posh · 80 tokens