golang-samber-hot

golang-samber-hot is a skill for Claude Code from samber/cc-skills-golang. It costs 122 tokens per session (1,988 once invoked), scanned A, original, MIT.

A Go library for storing frequently used values in memory, with several ways to remove old entries and options such as expiration times, loading missing values, sharding, and metrics. It is intended for Go 1.22 and newer.

In plain words
What is it for?
Use it to add an in-memory cache to a Go application, choose an eviction method, set time limits, load missing values, prevent duplicate loads, divide cache work across shards, or expose Prometheus metrics.
Why use it?
It avoids repeatedly performing the same expensive work or fetching the same data. Its expiration, loading, and monitoring options help manage stale entries, repeated misses, and cache size.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; mentions Claude Code; mentions Codex.

Part of the cc-skills-golang plugin — 46 skills shipped together

Good fit Use it to add an in-memory cache to a Go application, choose an eviction method, set time limits, load missing values, prevent duplicate loads, divide cache work across shards, or expose Prometheus metrics.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/samber/cc-skills-golang/golang-samber-hot
About the project

samber/cc-skills-golang is a collection of reusable agent instructions for Go development, covering areas such as the language, testing, security, and observability. It is for coding agents assisting with production-oriented Golang projects. The catalogue entries are its Go-specific skills, rule, plugin, and instruction.

samber/cc-skills-golang · 3,232 stars · on GitHub · skills.sh

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 samber/cc-skills-golang --skill golang-samber-hot
Clone the repo
git clone --depth 1 https://github.com/samber/cc-skills-golang

Made for: Claude Code.

Or install cc-skills-golang, the plugin that ships this one along with the rest of its 46 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 golang-samber-hot

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/samber/cc-skills-golang/golang-samber-hot"><img src="https://agentmods.dev/badge/skills/samber/cc-skills-golang/golang-samber-hot.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,988 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. Third-party audits
  • Socket pass 29 Apr 2026
  • Snyk pass 29 Apr 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00122 $0.01988
Opus 5 $0.00061 $0.00994
Sonnet 5 $0.00024 $0.00398
Haiku 4.5 $0.00012 $0.00199

Measured 8d ago against content hash 96f8bdb1affb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

golang-samber-hot 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 8d 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

skills/golang-samber-hot/SKILL.md · 142 lines

How it starts

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

Persona: You are a Go engineer who treats caching as a system design decision. You choose eviction algorithms based on measured access patterns, size caches from working-set data, and always plan for expiration, loader failures, and monitoring.

Using samber/hot for In-Memory Caching in Go

Generic, type-safe in-memory caching library for Go 1.22+ with 9 eviction algorithms, TTL, loader chains with singleflight deduplication, sharding, stale-while-revalidate, and Prometheus metrics.

Official Resources:

This skill is not exhaustive — refer to library documentation and code examples for more information:

  • For Go package docs, symbols, versions, importers, and known vulnerabilities, → See samber/cc-skills-golang@golang-pkg-go-dev skill (godig), preferred over Context7 for Go package facts.
  • To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See samber/cc-skills-golang@golang-gopls skill (gopls).
  • Context7 remains a fallback for docs not indexed on pkg.go.dev.
go get -u github.com/samber/hot

Algorithm Selection

Pick based on your access pattern — the wrong algorithm wastes memory or tanks hit rate.

Algorithm Constant Best for Avoid when
W-TinyLFU hot.WTinyLFU General-purpose, mixed workloads (default) You need simplicity for debugging
LRU hot.LRU Recency-dominated (sessions, recent queries) Frequency matters (scan pollution evicts hot items)
LFU hot.LFU Frequency-dominated (popular products, DNS) Access patterns shift (stale popular items never evict)
TinyLFU hot.TinyLFU Read-heavy with frequency bias Write-heavy (admission filter overhead)
S3FIFO hot.S3FIFO High throughput, scan-resistant Small caches (<1000 items)
ARC hot.ARC Self-tuning, unknown patterns Memory-constrained (2x tracking overhead)
TwoQueue hot.TwoQueue Mixed with hot/cold split Tuning complexity is unacceptable
SIEVE hot.SIEVE Simple scan-resistant LRU alternative Highly skewed access patterns
FIFO hot.FIFO Simple, predictable eviction order Hit rate matters (no frequency/recency awareness)

Read the full file on GitHub · 142 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago Changed · +4 lines 96f8bdb1affb
  2. 10d ago Changed 8088d9585486
  3. 13d ago First seen · 138 lines · 122 tokens per session scan A f03a025f2fa8

Subscribe to this mod's changes

golang-samber-hot is a skill published in the GitHub repository samber/cc-skills-golang (3,232 stars, last pushed 5d ago), licensed MIT. It adds 122 tokens to every session and 1,988 once invoked, about $0.0006 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-08-30.

Related

Other skills, from other repositories

golang-samber-hot

In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports…

yzfly/skills · 122 tokens

golang-samber-hot

In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports…

emilioforrer/go-stack · 122 tokens

swift-actor-persistence

Thread-safe data persistence in Swift using actors — in-memory cache with file-backed storage, eliminating data races by design.

masrisystems/dot-agents · 29 tokens

golang-samber-hot

In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports…

alexastrum/skl · 122 tokens

Azure Cosmos Ts

Azure Cosmos DB JavaScript/TypeScript SDK (@azure/cosmos) for data plane operations. Use for CRUD operations on documents, queries, bulk operations, and container management. Triggers: "Cosmos DB", "@azure/cosmos", "CosmosClient", "document CRUD", "NoSQL queries", "bulk operations", "partition key", "container.items".

mayurrathi/awesome-agent-skills · 78 tokens

Azure Resource Manager Redis Dotnet

Azure Resource Manager SDK for Redis in .NET. Use for MANAGEMENT PLANE operations: creating/managing Azure Cache for Redis instances, firewall rules, access keys, patch schedules, linked servers (geo-replication), and private endpoints via Azure Resource Manager. NOT for data plane operations (get/set keys, pub/sub) …

mayurrathi/awesome-agent-skills · 113 tokens