go-logging

go-logging is a skill for Claude Code from muratmirgun/gophers. It costs 83 tokens per session (2,205 once invoked), scanned A, original, MIT.

A set of guidelines for operational logging in Go, meaning messages that help people understand what happened when a program runs. It covers structured messages, severity levels, request data, and safe handling of errors and sensitive information.

In plain words
What is it for?
Use it when choosing or configuring a Go logger, writing log statements, adding request-related fields, or replacing older logging packages.
Why use it?
It reduces noisy, duplicated, inconsistent, or unsafe logs that make production problems harder to diagnose.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code; built for openclaw.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Read [references/levels-and-context.md](../../../skills/go-logging/references/levels-and-context.md) when choosing between `Warn` and `Error`, defining custom v.

Part of the gophers plugin — 26 skills, 4 agents shipped together

Good fit Use it when choosing or configuring a Go logger, writing log statements, adding request-related fields, or replacing older logging packages.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/muratmirgun/gophers
agentmods
npx agentmods add skills/muratmirgun/gophers/go-logging

Made for: Claude Code.

Or install gophers, the plugin that ships this one along with the rest of its 26 skills, 4 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 go-logging

README.md
[![agentmods](https://agentmods.dev/badge/skills/muratmirgun/gophers/go-logging/github.svg)](https://agentmods.dev/skills/muratmirgun/gophers/go-logging)
Your own site
<a href="https://agentmods.dev/skills/muratmirgun/gophers/go-logging"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-logging/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 go-logging

Your own site · 80×15
<a href="https://agentmods.dev/skills/muratmirgun/gophers/go-logging"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-logging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,205 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00083 $0.02205
Opus 5.5 $0.00033 $0.00882
Sonnet 5.5 $0.00017 $0.00441
Haiku 4.5 $0.00008 $0.00220

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

Security

Grade A, and why

go-logging 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 1mo 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.

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.

.claude-plugin/skills/go-logging/SKILL.md · 195 lines

How it starts

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

Go Logging

Logs are written for operators — the human who will be paged at 3 a.m. and needs to know what happened. Every log line either helps diagnose a production issue or it is noise. log/slog from the standard library is the default; reach for anything else only after measuring.

This skill covers logging only. Metrics, distributed tracing, profiling, and RUM are a separate concern — they belong to a future go-observability skill. Do not confuse them with logging here.

Core Rules

  1. Use log/slog for new code. Structured, leveled, in the standard library since Go 1.21.
  2. Static message, structured fields. The message describes what happened; data goes in key-value attributes.
  3. Log or return, never both. Logging a wrapped error makes the same failure appear at every layer.
  4. Log at the boundary. HTTP handlers, job runners, and main log. Library code wraps and returns.
  5. Use snake_case keys consistently across the codebase (user_id, request_id, elapsed_ms).
  6. slog.Error always carries an "err" attribute. Without it, you logged a sentence, not an error.
  7. Never log secrets, PII, or unbounded data. Tokens, full credit cards, request bodies — none of it.

Choosing a Logger

Situation Use
New production service log/slog
Trivial CLI / one-off script log (the standard package)
Measured hot-path bottleneck where slog dominates the flame graph zap or zerolog, but keep the structured style
Existing zap/logrus/zerolog code Migrate to slog with a bridge handler; see references/slog-handler-ecosystem.md

slog's API is stable, the ecosystem has consolidated around it, and JSON output works with every log shipper. Do not introduce a third-party logger without a benchmark showing the win.

Structured Logging

Build log messages from a static message plus typed fields:

// Good — static message, structured fields
slog.Info("order placed", "order_id", orderID, "total_cents", totalCents)

// Bad — dynamic data baked into the message string
slog.Info(fmt.Sprintf("order %d placed for $%.2f", orderID, total))

Read the full file on GitHub · 195 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. 1mo ago First seen · 195 lines · 83 tokens per session scan A 3645a4b653d3

Subscribe to this mod's changes

go-logging is a skill published in the GitHub repository muratmirgun/gophers (9 stars, last pushed 2mo ago), licensed MIT. It adds 83 tokens to every session and 2,205 once invoked, about $0.0003 per session on Opus 5.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-08-31.

Related

Other skills, from other repositories

go

Use when writing Go services, CLIs, or libraries. Covers idiomatic error wrapping, goroutine and context discipline, interface design, table-driven tests, and the race detector. Trigger on "goroutine leak", "how should i wrap this error in go", "race detector is flagging this", "write table-driven tests for this". Do…

nimadorostkar/Claude-Skills-collection · 90 tokens

cpp

Use when writing modern C++ (17/20/23). Covers RAII, smart-pointer ownership, move semantics, ranges, concepts, and eliminating undefined behavior with sanitizers. Trigger on "segfault in my c++ code", "should this be a uniqueptr or sharedptr", "get rid of the raw new and delete", "asan reports heap-use-after-free".

nimadorostkar/Claude-Skills-collection · 78 tokens

integrate-arcjet-guard-agent-framework-go

Integrate Arcjet Guard into Microsoft Agent Framework for Go (github.com/microsoft/agent-framework-go). Wrap a functool or MCP tool with GuardTool, guard every tool an agent can see and screen inbound text with GuardMiddleware, or guard any Go function with arcjet.GuardAction. Use when asked to add Arcjet to a Go…

arcjet/skills · 119 tokens

go-expert

Use when writing or reviewing Go code that starts goroutines, holds a sync.Mutex/RWMutex, or closes channels - to enforce goroutine lifecycle ownership, lock-hygiene, and channel-close-side rules, and to wire up the detection tooling (go test -race, go vet, go.uber.org/goleak) that catches violations tests alone…

shennawardana23/skillme · 107 tokens

golang-performance

Go performance workflow: benchmark and profile (pprof/trace), identify hotspots, reduce allocations/GC and contention, and verify improvements with repeatable measurement. Use only after you have evidence the Go code is the bottleneck.

AeonDave/malskill · 49 tokens

cmd_go_build

Fix Go build errors, go vet warnings, and linter issues incrementally. Invokes the go-build-resolver agent for minimal, surgical fixes.

majiang213/OpenClaw-MAS · 34 tokens