aiagent: Command for Claude Code

.claude/commands/new-tool.md

new-tool is a command for Claude Code from drujensen/aiagent. It costs 28 tokens per session (307 once invoked), scanned A, original, MIT.

A scaffolding command that creates a new tool implementation for the aiagent project and registers it with the application. It follows the project's interfaces, naming rules, default-tool setup, and test layout.

In plain words
What is it for?
Use it to add a tool by name and description, create its Go source and test files, connect it to the tool factory, and run formatting, build, and test checks.
Why use it?
It removes repetitive setup work and reduces the chance of missing registration, tests, or required project conventions.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is drujensen/aiagent's own configuration. It tells Claude Code how to work on aiagent 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 aiagent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to drujensen/aiagent. 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/drujensen/aiagent/main/.claude/commands/new-tool.md
Clone the repo
git clone --depth 1 https://github.com/drujensen/aiagent

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 new-tool

README.md
[![agentmods](https://agentmods.dev/badge/commands/drujensen/aiagent/new-tool/github.svg)](https://agentmods.dev/commands/drujensen/aiagent/new-tool)
Your own site
<a href="https://agentmods.dev/commands/drujensen/aiagent/new-tool"><img src="https://agentmods.dev/badge/commands/drujensen/aiagent/new-tool/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 new-tool

Your own site · 80×15
<a href="https://agentmods.dev/commands/drujensen/aiagent/new-tool"><img src="https://agentmods.dev/badge/commands/drujensen/aiagent/new-tool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 307 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.00028 $0.00307
Opus 5.5 $0.00011 $0.00123
Sonnet 5.5 $0.00006 $0.00061
Haiku 4.5 $0.00003 $0.00031

Measured 4d ago against content hash 8d5e90b053aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

new-tool 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 4d 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/new-tool.md · 27 lines

What it actually says

Create a new tool implementation for the aiagent project.

The user wants to add a tool named: $ARGUMENTS

Steps

  1. Read internal/impl/tools/tool_factory.go to understand how tools are registered
  2. Read an existing simple tool (e.g., internal/impl/tools/file_read.go) to understand the interface
  3. Read internal/domain/interfaces/ to find the Tool interface definition
  4. Create internal/impl/tools/<toolname>.go implementing the Tool interface
  5. Register the new tool in internal/impl/tools/tool_factory.go
  6. If it should be a default tool, add it to internal/impl/defaults/defaults.go
  7. Write a test file at internal/impl/tools/<toolname>_test.go
  8. Run the QA workflow: go fmt ./... && go vet ./... && go build . && go test ./...

Naming Conventions

  • File: internal/impl/tools/<name>.go (snake_case)
  • Struct: <Name>Tool (PascalCase)
  • Constructor: New<Name>Tool
  • Tool name string (used in JSON): the human-readable name that agents will see

Follow error wrapping pattern: fmt.Errorf("failed to %s: %w", operation, err)

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. 4d ago First seen · 27 lines · 28 tokens per session scan A 8d5e90b053aa

Subscribe to this mod's changes

new-tool is a command published in the GitHub repository drujensen/aiagent (5 stars, last pushed 2mo ago), licensed MIT. It adds 28 tokens to every session and 307 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-10-03.