toolhive: Agent for Claude Code

.claude/agents/golang-code-writer.md

golang-code-writer is an agent for Claude Code from stacklok/toolhive. It costs 27 tokens per session (439 once invoked), scanned A, original, Apache-2.0.

A coding agent for writing Go, a programming language. It creates or updates Go functions, data structures, interfaces, methods, packages, and starter code while following the project's conventions.

In plain words
What is it for?
Use it to add Go functionality or scaffold a new package; use other agents for tests, code reviews, architecture decisions, or documentation.
Why use it?
It helps implement new Go code in the right existing files instead of making unnecessary copies or mixing changes with unrelated work.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is stacklok/toolhive's own configuration. It tells Claude Code how to work on toolhive itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything toolhive configures →

About the project

ToolHive is a platform for running and managing Model Context Protocol servers, which give AI clients access to tools and data. Developers, platform teams, and enterprises use it to isolate MCP servers, control access, and monitor their operation. The catalogue entries provide agent workflows and configuration for operating ToolHive and its MCP servers.

stacklok/toolhive · 2,307 stars · on GitHub · stacklok.com

Reuse

Borrowing it

Nothing to install: this file belongs to stacklok/toolhive. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/stacklok/toolhive/main/.claude/agents/golang-code-writer.md
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive

Made for: Claude Code.

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-code-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/stacklok/toolhive/golang-code-writer/github.svg)](https://agentmods.dev/agents/stacklok/toolhive/golang-code-writer)
Your own site
<a href="https://agentmods.dev/agents/stacklok/toolhive/golang-code-writer"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/golang-code-writer/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-code-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/stacklok/toolhive/golang-code-writer"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/golang-code-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 439 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.00027 $0.00439
Opus 5.5 $0.00011 $0.00176
Sonnet 5.5 $0.00005 $0.00088
Haiku 4.5 $0.00003 $0.00044

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

Security

Grade A, and why

golang-code-writer 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/agents/golang-code-writer.md · 45 lines

What it actually says

Go Code Writer Agent

You are an expert Go developer specializing in clean, efficient, idiomatic Go code.

When to Invoke

Invoke when: Writing new Go functions, structs, interfaces, methods, packages, or scaffolding.

Do NOT invoke for: Writing tests (unit-test-writer), reviewing code (code-reviewer), architecture decisions (tech-lead-orchestrator), docs (documentation-writer).

File Modification Rules

CRITICAL: Always prefer editing existing files over creating new ones.

  • Use the Edit tool to modify existing files in place. NEVER create copies with _new.go, _v2.go, or similar suffixes.
  • Use the Write tool ONLY when creating genuinely new files that don't exist yet.
  • Read before editing: Always use the Read tool to examine a file's current content before modifying it.
  • If you need to add a function to an existing package, edit the appropriate existing file — do NOT create a new file unless the change warrants a new file for organizational reasons (e.g., a new logical grouping).

ToolHive Code Conventions

Follow Go style, error handling, logging, and testing conventions defined in .claude/rules/go-style.md, .claude/rules/testing.md, and .claude/rules/cli-commands.md. These rules are auto-loaded when touching matching files.

Output

  • Provide complete, runnable code with imports
  • Examine existing code patterns before writing new code
  • Brief explanations for complex logic or design decisions

Coordinating with Other Agents

  • unit-test-writer: For tests alongside new code
  • code-reviewer: For reviewing completed code
  • tech-lead-orchestrator: For architectural decisions
  • toolhive-expert: For understanding existing patterns
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 · 45 lines · 27 tokens per session scan A 17b5a68223c0

Subscribe to this mod's changes

golang-code-writer is an agent published in the GitHub repository stacklok/toolhive (2,307 stars, last pushed today), licensed Apache-2.0. It adds 27 tokens to every session and 439 once invoked, about $0.0001 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-30.

Related

Other agents, from other repositories

code-reviewer

Reviews code for the registry servers' best practices, security patterns, Go conventions, and architectural consistency.

stacklok/toolhive-registry-server · 23 tokens

golang-code-writer

Always use this agent when you need to write, generate, or create new Go code, including functions, structs, interfaces, methods, or complete packages. Examples: Context: User needs help implementing a new feature in their Go application. user: 'I need to write a function that validates email addresses using regex'…

stacklok/toolhive-registry-server · 0 tokens

unit-test-writer

Use this agent when you need to write comprehensive unit tests for Go code, particularly for functions, methods, or components that require thorough testing coverage. Examples: Context: User has just written a new function and wants unit tests for it. user: 'I just wrote this function to validate email addresses, can…

stacklok/toolhive-registry-server · 0 tokens

golang-pro

Use when building Go applications requiring concurrent programming, high-performance systems, microservices, or cloud-native architectures where idiomatic patterns, error handling excellence, and efficiency are critical.

alexmmatos/arthur-mcp · 38 tokens

go-expert

Go concurrency, error handling, stdlib patterns, Chi/Echo web frameworks specialist. Use when writing Go code, designing concurrent systems, or building Go web services. Trigger phrases: Go, Golang, goroutine, channel, Chi, Echo, stdlib, context, error handling, interface, module, go test.

travisjneuman/.claude · 69 tokens

backend-engineer

Senior backend engineer for Go API development. Invoke for API handlers, business logic, data access, concurrency patterns, observability, and backend implementation. Writes production code using TDD workflow.

irahardianto/awesome-agv · 41 tokens