code-review

A command for reviewing and fixing Go code, including correctness, security, performance, tests, and documentation.

In plain words
What is it for?
Use it after Go changes to inspect code quality, security risks, resource handling, test coverage, and exported documentation, then fix the findings.
Why use it?
It provides a structured check for issues that may be missed during ordinary development, from error handling to concurrent-code problems.

Command for Claude Code

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.

agentmods
npx agentmods add commands/rshade/finfocus/code-review
Clone the repo
git clone --depth 1 https://github.com/rshade/finfocus

Made for: Claude Code.

Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,237 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00010 $0.01237
Opus 5 $0.00005 $0.00619
Sonnet 5 $0.00002 $0.00247
Haiku 4.5 $0.00001 $0.00124

Measured 2d ago against content hash aeb22e520502, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-review 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 2d 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/commands/code-review.md · 158 lines

How it starts

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

Code Review and Fix Protocol

Phase 1: Code Review

Use the golang-code-reviewer agent to perform a comprehensive review of recent changes focusing on:

Review Criteria

  1. Code Quality and Best Practices

    • Readability, maintainability, and adherence to Go best practices
    • Proper error handling and return value checking
    • Interface design and abstraction patterns
    • Resource cleanup (defer statements, context handling)
  2. Security Concerns

    • Potential vulnerabilities or security issues
    • Input validation and sanitization
    • Secret handling and credential management
    • File permissions and subprocess usage
  3. Performance Considerations

    • Potential performance bottlenecks
    • Memory allocation patterns and efficiency
    • Concurrent code safety and race conditions
    • Algorithm complexity and optimization opportunities
  4. Testing and Coverage

    • Test coverage and quality assessment
    • Edge case handling in tests
    • Test organization and clarity
    • Mock usage and test isolation
  5. Documentation

    • Package and exported type documentation
    • Function comment completeness
    • Code comment clarity and necessity
    • README and architecture documentation
  6. FinFocus-Specific Requirements

    • Cross-repo consistency (spec, core, plugin alignment)
    • Plugin protocol implementation correctness
    • Cost calculation logic accuracy
    • CLI UX and error messaging quality
  7. Go Version Idioms (Go 1.25.6+)

    • Use Go Go 1.25.6+ language features and standard library improvements
    • Leverage modern Go patterns and best practices
    • Ensure compatibility with Go Go 1.25.6+ runtime behavior
    • Utilize updated standard library APIs and optimizations

Context for Review

  • Current branch: !git branch --show-current
  • Recent changes: !git diff HEAD~1
  • Recent commits: !git log --oneline -5
  • Current git status: !git status
  • Current linting issues: !make lint
  • Current test status: !make test

Read the full file on GitHub · 158 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. 2d ago First seen · 158 lines · 10 tokens per session scan A aeb22e520502

Subscribe to this mod's changes

code-review is a command published in the GitHub repository rshade/finfocus (5 stars, last pushed 16d ago), licensed Apache-2.0. It adds 10 tokens to every session and 1,237 once invoked, about $0.0001 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-31.