go-code-reduce

go-code-reduce is a skill for Claude Code, Codex from yarlson/yarstack. It costs 49 tokens per session (694 once invoked), scanned A, original, MIT.

A Go code-reduction skill for removing unnecessary maintenance work while keeping behavior unchanged. Go is a programming language; the skill focuses on simpler standard language or library constructs rather than merely shortening files.

In plain words
What is it for?
Use it when asked to reduce Go boilerplate, duplication, obsolete idioms, or maintenance burden in an existing repository.
Why use it?
It helps reduce dead code, duplicated mechanics, obsolete compatibility code, and unnecessarily broad interfaces without changing errors, ordering, APIs, or other stated behavior.

Skill for Claude CodeCodex

Part of the yarstack plugin — 40 skills 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/yarlson/yarstack/go-code-reduce
Any agent
npx skills add yarlson/yarstack --skill go-code-reduce
Clone the repo
git clone --depth 1 https://github.com/yarlson/yarstack

Made for: Claude Code, Codex.

Or install yarstack, the plugin that ships this one along with the rest of its 40 skills.

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 go-code-reduce

README.md
[![agentmods](https://agentmods.dev/badge/skills/yarlson/yarstack/go-code-reduce.svg)](https://agentmods.dev/skills/yarlson/yarstack/go-code-reduce)
Your own site
<a href="https://agentmods.dev/skills/yarlson/yarstack/go-code-reduce"><img src="https://agentmods.dev/badge/skills/yarlson/yarstack/go-code-reduce.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 694 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00049 $0.00694
Opus 5 $0.00024 $0.00347
Sonnet 5 $0.00010 $0.00139
Haiku 4.5 $0.00005 $0.00069

Measured today against content hash cf46c854609f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

go-code-reduce scanned grade A with 0 findings 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 today.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/yarstack/skills/go-code-reduce/SKILL.md · 39 lines

How it starts

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

Reduce Go Code

Reduce authored maintenance burden, not raw repository lines. Prefer deleting mechanics through standard Go constructs over compressing domain logic or introducing project-specific abstractions.

Workflow

  1. Read the repository guidance, module Go version, closest source and tests, generated-file markers, and affected public consumers. Keep an assessment read-only unless edits are authorized.

  2. State the behavior that must remain unchanged, including errors and wrapped identities, nil versus empty values, ordering, serialization, cancellation, cleanup, exported APIs, build variants, and relevant performance bounds.

  3. Rank evidenced candidates in this order:

    • delete dead, obsolete, forwarding, compatibility, or unnecessarily exported code when consumers permit it;
    • replace hand-written mechanics with version-supported language, built-in, or standard-library operations;
    • shrink producer APIs and define small interfaces at actual consumers;
    • consolidate an algorithm only when multiple real copies differ solely by type or repeated traversal;
    • generate code only when repetition is mechanically derived from one authoritative source;
    • add a dependency only when it removes a meaningful subsystem after adapters, tooling, security, and update costs.
  4. Keep explicit code when the alternative adds indirection, reflection, modes, hidden allocation, a one-use helper, or a vocabulary maintainers must learn.

  5. Make one coherent reduction at a time. Preview automated rewrites such as go fix -diff ./..., apply only reviewed transformations, format changed Go files, and exclude unrelated modernization.

  6. Run focused tests and repository-native checks. Add race tests for concurrency changes, regeneration checks for generated code, and repeated benchmarks for performance-sensitive paths.

  7. Compare only relevant before-and-after evidence. Separate authored production, test, and generated code; a valid reduction lowers authored code or duplication without materially increasing complexity, API surface, dependencies, or runtime cost.

Read the full file on GitHub · 39 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. today First seen · 39 lines · 49 tokens per session scan A cf46c854609f

Subscribe to this mod's changes

go-code-reduce is a skill published in the GitHub repository yarlson/yarstack (3 stars, last pushed 2d ago), licensed MIT. It adds 49 tokens to every session and 694 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.