golang-samber-slog Skill for Claude: What It Does and How to Install It
Makes Claude build Go logging pipelines with samber's slog packages: sampling, formatting, routing and log sinks.
- Installs
- 39.1K
- on skills.sh
- Stars
- 3.7K
- on GitHub
- Files
- 5
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
This skill covers the samber/slog-* family of packages for Go's slog. Claude builds a pipeline in a fixed order: sample first, format second, route last.
It includes slog-multi for fan-out and routing, slog-sampling to cut volume, slog-formatter to clean attributes, HTTP middleware for five frameworks and backend sinks. It loads when your code imports any github.com/samber/slog-* package.
Good for
- Go developers routing logs to Datadog, Sentry, Loki or Slack
- Teams scrubbing personal data from logs before they leave the process
- Anyone adding request logging to gin, echo, fiber or chi
Install golang-samber-slog
Claude Code
- 1
Copy this prompt.
Install the golang-samber-slog skill in Claude Code. Run this command: npx skills add https://github.com/samber/cc-skills-golang --skill golang-samber-slog Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
Structured logging extensions for Golang using samber/slog-**** packages — multi-handler pipelines (slog-multi), log sampling (slog-sampling), attribute formatting (slog-formatter), HTTP middleware (slog-fiber, slog-gin, slog-chi, slog-echo), and backend routing (slog-datadog, slog-sentry, slog-loki, slog-syslog, slog-logstash, slog-graylog...). Apply when using or adopting slog, or when the codebase already imports any github.com/samber/slog-* package.
Sections in SKILL.md
- The Pipeline Model
- Core Libraries
- slog-multi — Handler Composition
- slog-sampling — Throughput Control
- slog-formatter — Attribute Transformation
- HTTP Middlewares
- Backend Sinks
- Common Mistakes
- Performance Warnings
- Best Practices
- Cross-References
Key facts
- Author
- samber
- License
- MIT
- Installs on skills.sh
- 39,117 (Nov 2, 2026)
- Last repo commit
- Nov 1, 2026
- Skill version
- 1.1.2
What it includes
Sample first, format second, route last
Records flow through sampling, then formatting, then routing, so dropped records cost no formatting work.
Try: “Add a slog pipeline that samples noise, scrubs PII and sends errors to Sentry.”
Write ·
Pipeline modelFanout, Router, FirstMatch, Failover, Pool, Pipe
Six ways to combine handlers. Fanout runs handlers one after another, so its latency is the sum of all of them.
Write ·
slog-multiUniform, Threshold, Absolute and Custom strategies
Sampling must be the outermost handler. Threshold keeps the first N records per interval.
Write ·
slog-samplingPII, error, time and HTTP attribute formatters
Applied as Pipe middleware so every handler gets clean attributes. Also generic formatters by type, key or group.
Write ·
slog-formatterslog-gin, echo, fiber, chi and net/http
One pattern across frameworks with a shared Config for levels, request and response bodies and trace IDs.
Write ·
HTTP middlewaresDatadog, Sentry, Loki, Kafka, Slack and more
Batch handlers such as Datadog, Loki, Kafka and Parquet buffer records, so you must flush on shutdown or logs are lost.
Write ·
Backend sinksChecklist of ordering and latency pitfalls
Covers sampling after formatting, a router with no catch-all, and benchmarking the pipeline with go test -bench.
Read ·
Common mistakes and performance
From the official docs
Permissions
Low risk
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It lists git and shell commands as allowed tools
The allowed-tools line covers any go, golangci-lint and git command (git:*), not just read ones. Keep Claude Code's permission prompts on for git commands that change history. github.com
It may fetch web pages or query Context7
It lists WebFetch and the Context7 tools as allowed. Library names and questions can leave your machine. Do not put secrets in prompts about this code. github.com
Sink examples use webhook URLs and bot tokens
references/backend-handlers.md shows Slack and Telegram handlers configured with a webhook URL or token. Load real values from your secrets store, not from code Claude writes. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | No read-only mode in SKILL.md. Use version control. |
|---|---|
| Talks to | WebFetch is listed as an allowed tool. Library lookups go to Context7 if the Context7 MCP server is installed (the skill uses it as a fallback). Log sinks you configure (Datadog, Sentry, Loki and others) receive your logs; the skill helps wire them |
| Sign-in and keys | SKILL.md does not mention any account or key. The example code in references/backend-handlers.md configures a Slack webhook URL, a Slack bot token and a Telegram token in Go code; keep real values out of source control. |
| Scopes |
|
Questions
What does the golang-samber-slog skill do?
It teaches Claude to build structured logging pipelines on Go's slog with the samber/slog-* packages. That includes sampling, attribute formatting, routing and sending logs to backends.
How do I install golang-samber-slog?
Use the install box at the top of this page. It is a text skill with reference guides, so there is nothing to compile. Start a new session so it loads, then work in a Go project.
golang-samber-slog vs golang-observability?
This skill is about samber's slog packages. SKILL.md points to the golang-observability skill for slog fundamentals such as levels, context, handler setup and migration.
Why did my logs go missing on shutdown?
Batch handlers such as slog-datadog, slog-loki, slog-kafka and slog-parquet buffer records. The skill says to flush them on shutdown, for example with handler.Stop(ctx) for Datadog.
Does it need other skills from the same repo?
SKILL.md does not list any other skill as required. SKILL.md points to related skills in samber/cc-skills-golang for side topics, and the README says installing only a subset gives a partial and possibly inconsistent view of the guidelines. For best results it recommends installing the general-purpose Go skills together.
Is golang-samber-slog safe?
Mostly, for your own Go projects. It is instructions plus reference files, and it lets Claude edit files and run go and git commands. Review diffs, keep the project under version control and avoid secrets in prompts.
Does golang-samber-slog work in Codex, Cursor or the Claude app?
It is designed for Claude Code, Codex or a similar tool, and the README says the skills are built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor. Because it works on your Go files and uses the go command, use a coding tool rather than the Claude app.
Information
updated Nov 2, 2026
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-samber-slog
Sources
Docs, issue trackers and discussions this page is built from.
Show all 3Hide
- golang-samber-slog SKILL.md · github.com
- cc-skills-golang README · github.com
- golang-samber-slog backend-handlers.md · github.com