PlugWiki

golang-samber-hot Skill for Claude: What It Does and How to Install It

Makes Claude add an in-memory cache to a Go service with samber/hot, including eviction, expiry and metrics.

Installs
39K
on skills.sh
Stars
3.7K
on GitHub
Files
4
besides SKILL.md
Updated
Nov 2026
last repo commit

This skill covers samber/hot, a generic Go cache with nine eviction algorithms, TTL, loader chains, sharding and Prometheus metrics. Claude treats caching as a design decision and sizes the cache from your memory budget.

It starts with W-TinyLFU unless profiling says otherwise, and asks you how much memory the cache gets in production. It loads when you adopt samber/hot or when a service keeps loading the same medium-to-low cardinality data at high frequency.

Good for

  • Go developers cutting latency on data loaded again and again
  • Teams protecting a backend from repeated reads
  • Anyone choosing between LRU, LFU, TinyLFU and other eviction rules

Install golang-samber-hot

Claude Code

  1. 1

    Copy this prompt.

    Install the golang-samber-hot skill in Claude Code. Run this command:
    
    npx skills add https://github.com/samber/cc-skills-golang --skill golang-samber-hot
    
    Then check that it loaded and tell me how to use it.
  2. 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

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 github.com/samber/hot, or when the project repeatedly loads the same medium-to-low cardinality resources at high frequency and needs to reduce latency or backend pressure.

Sections in SKILL.md

  1. Algorithm Selection
  2. Core Usage
  3. Basic Cache with TTL
  4. Loader Pattern (Read-Through)
  5. Capacity Sizing
  6. Common Mistakes
  7. Best Practices
  8. Cross-References

Key facts

Author
samber
License
MIT
Installs on skills.sh
38,982 (Nov 2, 2026)
Last repo commit
Nov 1, 2026
Skill version
1.1.2
Library version covered
0.13.0

What it includes

  • Picks an eviction algorithm from your access pattern

    Nine options including LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC and SIEVE. The shortcut is to start with W-TinyLFU.

    Try: “Add a samber/hot cache in front of this user lookup with a 5 minute TTL.”

    Write · Algorithm selection

  • Builds a cache with expiry

    Always set a TTL. It suggests jitter so items created together do not expire together.

    Write · Basic cache with TTL

  • Read-through loading with singleflight

    Concurrent gets for the same missing key share one loader call.

    Write · Loader pattern

  • Capacity = memory budget / estimated item size

    Claude asks the developer for the memory budget and may suggest a unit test using runtime.ReadMemStats to measure item size.

    Read · Capacity sizing

  • Janitor, missing cache and locking pitfalls

    Covers WithJanitor, SetMissing needing a missing cache, and WithoutLocking being incompatible with WithJanitor.

    Read · Common mistakes

  • Revalidation, sharding, monitoring

    Reference guide in references/production-patterns.md. The algorithm guide and API reference are separate files.

    Read · Production patterns

From the official docs

Permissions

Low risk

The skill lets Claude edit your Go files and run go, golangci-lint and git commands, and it may fetch web pages. Keep permission prompts on for git and review diffs.

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

Security advisories

No published security advisories as of Nov 2, 2026.

Technical details
Turning on read-onlyNo read-only mode in SKILL.md. Use version control.
Talks toWebFetch 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)
Sign-in and keysSKILL.md does not mention any account or key.
Scopes
  • Reads and edits files in your Go project

  • SKILL.md lists these as allowed tools: go, golangci-lint, git, godig and gopls commands

Questions

What does the golang-samber-hot skill do?

It teaches Claude to add and tune an in-memory cache in Go with samber/hot. That includes choosing an eviction algorithm, setting TTL, loaders and metrics.

How do I install golang-samber-hot?

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.

Which eviction algorithm does it pick?

It starts with W-TinyLFU and switches only when profiling shows the miss rate is too high for your target. An algorithm guide in the skill compares the nine options.

How big should the cache be?

The skill sizes it from a memory budget: capacity is the budget divided by the estimated size of one item. It says a cache that holds everything is a map with overhead, and sizing to the working set (typically 10 to 20 percent of the data) is the usual goal.

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-hot 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-hot 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

Folder
skills/golang-samber-hot

samber/cc-skills-golangskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. golang-samber-hot SKILL.md · github.com
  2. cc-skills-golang README · github.com

Updated Nov 2, 2026.