rpc-client

rpc-client is a command for Claude Code from smicolon/ai-kit. It costs 13 tokens per session (1,411 once invoked), scanned A, original, MIT.

A command for generating a typed client for a Hono API using the server's route definitions.

In plain words
What is it for?
Use it to create a shared API client in a monorepo or separate package and connect it to a Hono server.
Why use it?
It helps frontend or other client code use the API's current paths and data types without manually duplicating them.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to create a shared API client in a monorepo or separate package and connect it to a Hono server.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/smicolon/ai-kit/rpc-client
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.

Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

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 rpc-client

README.md
[![agentmods](https://agentmods.dev/badge/commands/smicolon/ai-kit/rpc-client.svg)](https://agentmods.dev/commands/smicolon/ai-kit/rpc-client)
Your own site
<a href="https://agentmods.dev/commands/smicolon/ai-kit/rpc-client"><img src="https://agentmods.dev/badge/commands/smicolon/ai-kit/rpc-client.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 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,411 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.00013 $0.01411
Opus 5 $0.00006 $0.00705
Sonnet 5 $0.00003 $0.00282
Haiku 4.5 $0.00001 $0.00141

Measured 3d ago against content hash 1739a92ba963, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

rpc-client 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 3d 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.

packs/hono/commands/rpc-client.md · 264 lines

How it starts

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

Generate Hono RPC Client

Create a type-safe client for your Hono API using the hc client.

Workflow

Step 1: Verify Server Setup

Check that the server exports the app type:

// src/index.ts
import { Hono } from 'hono'

const app = new Hono()

// ... routes ...

export default app

// REQUIRED: Export type for RPC client
export type AppType = typeof app

Step 2: Create Client Package

For monorepo or separate client package:

# If using monorepo with workspaces
mkdir -p packages/api-client
cd packages/api-client
bun init -y
bun add hono

packages/api-client/package.json:

{
  "name": "@{project}/api-client",
  "version": "1.0.0",
  "main": "src/index.ts",
  "types": "src/index.ts",
  "exports": {
    ".": "./src/index.ts"
  },
  "dependencies": {
    "hono": "^4.0.0"
  }
}

Step 3: Create Client

packages/api-client/src/index.ts:

import { hc } from 'hono/client'
import type { AppType } from '@{project}/api/src/index'

// Create typed client
export const createApiClient = (baseUrl: string) => {
  return hc<AppType>(baseUrl)
}

// Default client for common use
export const api = createApiClient(
  process.env.API_URL || 'http://localhost:8787'
)

// Re-export types for consumers
export type { AppType }

// Export inferred types for convenience
export type ApiClient = ReturnType<typeof createApiClient>

Step 4: Usage Examples

Basic Usage:

import { api } from '@{project}/api-client'

// GET request
const users = await api.api.users.$get()
const data = await users.json()

// POST request with body
const newUser = await api.api.users.$post({
  json: {
    email: '[email protected]',
    name: 'New User'
  }
})

// GET with query params
const searchResults = await api.api.users.$get({
  query: {
    page: 1,
    limit: 10,
    search: 'john'
  }
})

// GET with path params
const user = await api.api.users[':id'].$get({
  param: { id: 'user-uuid' }
})

// PUT with params and body
const updated = await api.api.users[':id'].$put({
  param: { id: 'user-uuid' },
  json: { name: 'Updated Name' }
})

// DELETE
await api.api.users[':id'].$delete({
  param: { id: 'user-uuid' }
})

Read the full file on GitHub · 264 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. 3d ago First seen · 264 lines · 13 tokens per session scan A 1739a92ba963

Subscribe to this mod's changes

rpc-client is a command published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 3d ago), licensed MIT. It adds 13 tokens to every session and 1,411 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-09-03.