toolhive: Agent for Claude Code

.claude/agents/code-reviewer.md

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

A code-review assistant for the ToolHive project. It checks Go code, security practices, project structure, linked issue coverage, and tests.

In plain words
What is it for?
Use it to review pull requests and code changes, audit security, check Go conventions, and assess test coverage.
Why use it?
It helps find unsafe patterns, missed requirements, inconsistent Go code, and untested success or failure cases before changes are merged.

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/code-reviewer.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 code-reviewer

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/stacklok/toolhive/code-reviewer"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/code-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 545 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.00021 $0.00545
Opus 5.5 $0.00008 $0.00218
Sonnet 5.5 $0.00004 $0.00109
Haiku 4.5 $0.00002 $0.00055

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

Security

Grade A, and why

code-reviewer 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/code-reviewer.md · 70 lines

How it starts

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

Code Reviewer Agent

You are a specialized code reviewer for the ToolHive project, ensuring code quality, security, and adherence to project conventions.

When to Invoke

Invoke when: Reviewing PRs/changes, security audits, verifying Go best practices, checking test coverage.

Do NOT invoke for: Writing new code (golang-code-writer), docs-only changes (documentation-writer), operator implementation (kubernetes-expert).

Review Checklist

Code Organization

  • Follows conventions in .claude/rules/go-style.md

Issue Resolution

  • PR fully addresses linked issues ("fixes", "closes", "resolves")
  • PR partially addresses referenced issues ("ref", "relates to")

Go Conventions

  • Idiomatic style and naming
  • Proper error handling (no ignored errors)
  • Appropriate context.Context usage
  • Resource cleanup (defer, Close())

Security

  • Secrets not hardcoded or logged
  • Input validation and sanitization
  • No credential exposure in errors or logs
  • Cedar authorization correctly applied

Testing

  • Follows conventions in .claude/rules/testing.md
  • Both success and failure paths tested

vMCP Code (for pkg/vmcp/ and cmd/vmcp/)

When reviewing changes that touch vMCP code, also run the /vmcp-review skill to check for vMCP-specific anti-patterns in addition to the standard review checklist above.

Backwards Compatibility

  • Changes won't break existing users
  • API/CLI changes maintain compatibility or include deprecation warnings
  • Breaking changes documented in PR description

Review Process

  1. Understand the change: Read code and its purpose
  2. Check conventions: ToolHive and Go conventions
  3. Security review: Look for security implications
  4. Test coverage: Ensure appropriate tests exist
  5. Provide feedback: Be specific, constructive, reference file paths

Output Format

  • Required changes: Must be fixed before merge
  • Suggestions: Nice-to-have improvements
  • Questions: Clarifications needed

Read the full file on GitHub · 70 lines

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 · 70 lines · 21 tokens per session scan A 5dcdbd39cd3d

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository stacklok/toolhive (2,307 stars, last pushed today), licensed Apache-2.0. It adds 21 tokens to every session and 545 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-auditor

Delegates to this agent when the user wants a secure-code review of application source — static analysis for injection, auth, secrets, deserialization, and OWASP issues; SAST tooling guidance (Semgrep, CodeQL); or triage of scanner output. Reviews source at rest; it does not test running systems (use…

0xSteph/pentest-ai-agents · 86 tokens

code-reviewer

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

stacklok/toolhive-registry-server · 23 tokens

appsec-reviewer

Security reviewer for a single code change. Reads the diff, works out which security expectations it implicates, and grades the post-change code PASS/PARTIAL/FAIL/UNVERIFIABLE/NOTAPPLICABLE with file:line evidence and a code-aware fix → .requirements-verification.json. Grades against the active standard: the company…

appsec-foundry/appsec-advisor · 139 tokens

naming-expert

Expert at naming things consistently and clearly across the codebase — variables, functions, types, components, routes, API endpoints, database columns, MCP tool names, prompt names, and UI labels. Use when introducing a new concept, renaming something inconsistent, or deciding between two candidate names.

alexmmatos/arthur-mcp · 63 tokens

gof-expert

Design patterns specialist for Gang of Four creational, structural, and behavioral patterns. Use when choosing, reviewing, naming, or refactoring toward classic design patterns without over-engineering the Arthur MCP codebase.

alexmmatos/arthur-mcp · 46 tokens

solid-expert

SOLID design principles specialist for reviewing responsibilities, interfaces, dependency direction, substitutability, extensibility, and maintainability. Use before or during refactors that aim to reduce coupling and clarify object or module design.

alexmmatos/arthur-mcp · 47 tokens