ln-agent-poc-v2: Command for Claude Code

.claude/commands/auto-purchase.md

auto-purchase is a command for Claude Code from cachet-jp/ln-agent-poc-v2. It costs 0 tokens per session (901 once invoked), scanned A, original, MIT.

A command that uses Bitcoin held as Cashu ecash, a form of digital Bitcoin cash, to pay Lightning invoices and automatically buy Japanese gift cards.

In plain words
What is it for?
Use it to buy Kyash, V-Preca, QUO Card Pay, au PAY, DMM, or Bitcash gift codes in Japanese yen using Cashu Bitcoin.
Why use it?
It removes the need to manually check the Cashu balance, make a Lightning payment, and retrieve the gift code. It asks for confirmation before spending and applies a per-purchase limit.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is cachet-jp/ln-agent-poc-v2's own configuration. It tells Claude Code how to work on ln-agent-poc-v2 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 ln-agent-poc-v2 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cachet-jp/ln-agent-poc-v2. 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/cachet-jp/ln-agent-poc-v2/main/.claude/commands/auto-purchase.md
Clone the repo
git clone --depth 1 https://github.com/cachet-jp/ln-agent-poc-v2

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 auto-purchase

README.md
[![agentmods](https://agentmods.dev/badge/commands/cachet-jp/ln-agent-poc-v2/auto-purchase/github.svg)](https://agentmods.dev/commands/cachet-jp/ln-agent-poc-v2/auto-purchase)
Your own site
<a href="https://agentmods.dev/commands/cachet-jp/ln-agent-poc-v2/auto-purchase"><img src="https://agentmods.dev/badge/commands/cachet-jp/ln-agent-poc-v2/auto-purchase/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 auto-purchase

Your own site · 80×15
<a href="https://agentmods.dev/commands/cachet-jp/ln-agent-poc-v2/auto-purchase"><img src="https://agentmods.dev/badge/commands/cachet-jp/ln-agent-poc-v2/auto-purchase.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 901 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.00000 $0.00901
Opus 5 $0.00000 $0.00451
Sonnet 5 $0.00000 $0.00180
Haiku 4.5 $0.00000 $0.00090

Measured 9d ago against content hash 7a38d359b5f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

auto-purchase 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 9d 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/auto-purchase.md · 107 lines

What it actually says

/auto-purchase - BTC でギフトカードを購入

Cashu ecash の BTC を使って、Lightning 支払いでギフトカードを自動購入します。

Instructions

このスキルが呼び出されたら、以下の手順で進めてください。

Step 1: 説明を表示してユーザーの確認を待つ

まず以下を表示し、ユーザーの「はい」を待ってから 次に進んでください:


BTC → ギフトカード購入フロー

以下のステップを自動で実行します:

  1. Cashu 残高確認
  2. 商品と金額を選択
  3. UseBitcoin.jp で Lightning 支払い
  4. ギフトコード取得

購入可能な商品:

  • Kyash ギフトコード (¥500〜¥50,000)
  • V-Preca ギフト (¥500〜¥100,000)
  • QUO カード Pay (¥500〜¥10,000)
  • au PAY ギフト (¥1,000〜¥50,000)
  • DMM ポイントコード (¥2,000〜¥100,000)
  • ビットキャッシュ (¥1,500〜¥50,000)

現在の安全制限:

  • 1回の購入上限: MAX_SPEND_JPY (デフォルト ¥5,000)

続行しますか? (はい / いいえ)


Step 2: ユーザーが「はい」と答えたら実行

ユーザーが「はい」「yes」「y」「ok」等の肯定的な返答をしたら、purchasing-agent MCP ツールを順に呼び出します。

2a. 残高確認
  1. cashu_get_balance で Cashu ecash 残高を確認
  2. 残高が 0 の場合は入金方法を案内して中断 (cashu_create_invoice → 外部 LN ウォレットで支払い → cashu_claim_invoice)
ウォレット残高:
  Cashu: XX,XXX sats (0.000XXXXX BTC)
2b. 商品選択

ユーザーに購入する商品と金額を確認。 usebitcoin_list_products で一覧を表示してもよい。

2c. 購入実行

usebitcoin_buy_gift_card を呼び出す:

  • product: 商品タイプ
  • amount: 金額 (JPY)
ギフトカード購入中...
  商品: Kyash ギフトコード ¥1,000
  Lightning invoice 取得中...
  Cashu で支払い中...
  完了!ギフトコードを取得しました。

Step 3: 結果サマリー

全フロー完了後、まとめを表示:

=== ギフトカード購入完了 ===
  商品: Kyash ギフトコード
  金額: ¥1,000
  ギフトコード: XXXXXXXXXX
  BTC 支払額: XX,XXX sats
  支払方法: Cashu
  残高 (購入後): XX,XXX sats

Error Handling

  • 各ステップでエラーが発生した場合は即座に中断し、エラー内容を日本語で報告
  • 「リトライしますか?」と確認してから再実行
  • Cashu 残高不足時は cashu_create_invoice で Lightning invoice を発行し、外部 LN ウォレット (Phoenix, Wallet of Satoshi 等) で支払う方法を案内

Prerequisites

purchasing-agent MCP サーバーが接続済みであること。未接続の場合は以下を案内:

cd purchasing-agent
pnpm install

# Claude Desktop の MCP 設定に追加:
# "purchasing-agent": {
#   "command": "npx",
#   "args": ["tsx", "src/server.ts"],
#   "cwd": "<path>/purchasing-agent"
# }
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. 9d ago First seen · 107 lines · 0 tokens per session scan A 7a38d359b5f7

Subscribe to this mod's changes

auto-purchase is a command published in the GitHub repository cachet-jp/ln-agent-poc-v2 (4 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 901 tokens. 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.