golang-context Skill (samber): What It Does and How to Install It
Makes Claude pass, cancel and scope Go context.Context correctly across handlers, services, database calls and background work.
- Installs
- 41.9K
- on skills.sh
- Stars
- 3.7K
- on GitHub
- Files
- 4
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
golang-context makes Claude follow ten rules for context.Context in Go. They include propagating the same context through the whole request, taking ctx as the first parameter, always calling cancel, and using context.WithoutCancel for work that must outlive a request. It applies when you design propagation, debug leaked contexts, choose between Background, TODO and WithoutCancel, or store values in a context. SKILL.md says it is not for code that merely accepts ctx as a first parameter.
Good for
- Go developers designing how context flows from handler to database
- Reviewers hunting leaked or never-cancelled contexts
- Claude Code and Codex users on Go services
Install golang-context
Claude Code
- 1
Copy this prompt.
Install the golang-context skill in Claude Code. Run this command: /plugin marketplace add samber/cc /plugin install cc-skills-golang@samber 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.
The README says these skills are built as atomic, cross-referencing units, and that installing only a subset gives a partial and potentially inconsistent view of the guidelines. It recommends installing all the general-purpose skills together, which the plugin does. Its manifest lists no hooks or MCP servers, and the repo holds 46 skills. Use the skills CLI line only if you want just this one. Pick one route, not both.
From the project README. Source.
What's in the skill
When it loads
Idiomatic context.Context usage in Golang — propagation through API boundaries, cancellation, timeouts and deadlines, request-scoped values, context.WithoutCancel for background work outliving requests. Apply when designing context propagation across layers, debugging leaked or unexpired contexts, choosing between context.Background/TODO/WithoutCancel, or storing values in context. Not for code that merely accepts ctx as first parameter.
Sections in SKILL.md
- Best Practices Summary
- Creating Contexts
- Context Propagation: The Core Principle
- Deep Dives
- Cross-References
- Enforce with Linters
Key facts
- Author
- samber
- Repository
- samber/cc-skills-golang
- License
- MIT
- Skill version
- 1.3.1
- Installs on skills.sh
- 41,921 (Nov 2, 2026)
- GitHub stars
- 3,749 (Nov 2, 2026)
- skills.sh audits
- Gen Agent Trust Hub pass, Socket pass, Snyk pass (Nov 2, 2026)
- Last repo commit
- Nov 1, 2026
What it includes
Ten rules, from propagating one context end to end to WithoutCancel for background work
Best Practices SummaryFive-row table: which of Background, TODO, r.Context(), WithCancel or WithTimeout to use
Creating ContextsShows a bad and a good example of passing the caller context into a database call
The core rule: propagate the same context through the entire call chain so cancelling the parent cancels all downstream work.
Context PropagationGuide to WithCancel, WithTimeout, WithDeadline, AfterFunc and WithoutCancel
Cancellation, Timeouts & DeadlinesGuide to unexported key types, request IDs and passing trace context between services
Context Values & Cross-Service TracingGuide to handler contexts, NewRequestWithContext, client timeouts and *Context DB calls
Context in HTTP Servers & Service CallsPoints to govet and staticcheck, and to the golang-lint skill for their setup
Enforce with Linters
From the official docs
Permissions
Low risk
It lets Claude edit your Go files and run go, golangci-lint and git commands in your project.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It edits Go files and runs go and git commands
The frontmatter allows Edit, Write and Bash for go, golangci-lint and git. Work on a branch and read the diff before you commit.
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | No read-only setting is documented in SKILL.md. |
|---|---|
| Talks to | Your AI provider receives the Go code and command output Claude reads |
| Sign-in and keys | SKILL.md names no account or API key. |
| Scopes |
|
Questions
How do I install golang-context?
Use the install box above. The plugin route installs the whole Go skill set (46 skills in the repo), and the skills CLI route installs only this skill. Pick one so you do not get every skill twice. The README says these skills cross-reference each other and installing a subset gives a partial view.
Does golang-context work in the Claude app?
The README documents no Claude app install, so the Claude tab in the install box is our generic zip-upload route, not a documented one. The skill reads and edits Go files and runs go commands on your machine, so Claude Code or Codex is the better fit.
Does golang-context need an API key?
SKILL.md names no API key or account. It does need Go installed on your machine.
Is golang-context safe to run?
It edits your Go files and runs go, golangci-lint and git commands in your project, so work on a branch and read the diff before you commit. The skill bundles no scripts: its other files are reference guides and an evals/evals.json file.
When does golang-context apply, and when does it not?
It applies to context propagation across layers, leaked or unexpired contexts, choosing between Background, TODO and WithoutCancel, and values stored in a context. SKILL.md says it is not for code that merely accepts ctx as its first parameter.
Do I need the other golang skills with it?
No part of SKILL.md requires them. It points to golang-concurrency, golang-database, golang-observability, golang-design-patterns and golang-lint with "See" lines, and the README recommends installing the general-purpose skills together.
Information
updated Nov 2, 2026
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-context
Sources
Docs, issue trackers and discussions this page is built from.
Show all 7Hide
- cc-skills-golang · github.com
- cc-skills-golang README · github.com
- plugin.json · github.com
- skills CLI commands · github.com
- README.md#-how-to-use · github.com
- golang-context SKILL.md · github.com
- golang-context on skills.sh · skills.sh