sparkbtcbot: Instructions file for Claude Code

CLAUDE.md

sparkbtcbot CLAUDE.md is an instructions file for Claude Code from echennells/sparkbtcbot. It costs 1,996 tokens per session, scanned A, original, MIT.

A Claude Code skill that gives an AI agent Bitcoin wallet operations through Spark, a Bitcoin layer-2 network for faster transfers. It covers balances, deposits, transfers, invoices, tokens, withdrawals, signing, purchases, and recovery backups.

In plain words
What is it for?
Use it to initialize or import a wallet, check balances, receive or send Bitcoin, work with Lightning or Spark invoices, transfer tokens, withdraw to the Bitcoin network, sign messages, make supported purchases, or maintain recovery data.
Why use it?
It provides instructions for carrying out wallet and payment tasks in one workflow, including moving funds between Spark and regular on-chain Bitcoin. It also documents safeguards for spending and recovery.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

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

Reuse

Borrowing it

Nothing to install: this file belongs to echennells/sparkbtcbot. 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/echennells/sparkbtcbot/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/echennells/sparkbtcbot

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 sparkbtcbot CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/echennells/sparkbtcbot/claude-md/github.svg)](https://agentmods.dev/instructions/echennells/sparkbtcbot/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/echennells/sparkbtcbot/claude-md"><img src="https://agentmods.dev/badge/instructions/echennells/sparkbtcbot/claude-md/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 sparkbtcbot CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/echennells/sparkbtcbot/claude-md"><img src="https://agentmods.dev/badge/instructions/echennells/sparkbtcbot/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,996 This file is loaded in full into every session.
When invoked 1,996 The same file — it is already loaded in full.
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.01996 $0.01996
Opus 5.5 $0.00798 $0.00798
Sonnet 5.5 $0.00399 $0.00399
Haiku 4.5 $0.00200 $0.00200

Measured today against content hash 1002dd911afc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sparkbtcbot CLAUDE.md 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 today.

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.md · 110 lines

How it starts

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

sparkbtcbot

Claude Code skill for setting up Spark Bitcoin L2 wallet capabilities for AI agents.

Installation: the plugin marketplace, or clone anywhere (e.g. ~/sparkbtcbot) and symlink the nested skill: ln -s ~/sparkbtcbot/skills/sparkbtcbot ~/.claude/skills/sparkbtcbot. Never clone directly into ~/.claude/skills/ — the skill nests at skills/sparkbtcbot/, so a direct clone buries SKILL.md too deep to be discovered (README → Local clone).

What This Skill Does

Teaches Claude Code how to give AI agents Bitcoin capabilities using the Spark L2:

  1. Initialize Wallet — Create or import a BIP39 mnemonic-based wallet
  2. Check Balance — Query BTC and token balances
  3. Receive Deposits — Generate L1 Bitcoin deposit addresses
  4. Transfer BTC — Instant, zero-fee Spark-to-Spark transfers
  5. Lightning Invoices — Create and pay BOLT11 invoices (Lightning Network interop)
  6. Spark Invoices — Native Spark invoices payable in sats or tokens
  7. Token Operations — Transfer BTKN/LRC20 tokens natively
  8. Withdraw to L1 — Cooperative exit back to on-chain Bitcoin
  9. Message Signing — Sign and verify messages for identity proof
  10. Merchant Purchases — Buy real-world goods/services with sats (Bitrefill, nadanada) under a shared payment policy (references/merchant-spending.md): invoice-vs-quote guard, confirm-before-buy, PII consent, bearer-secret deliverables
  11. Unilateral-Exit Backup — Continuously-fresh spark.unilateral-exit-bundle.v1 recovery bundle (the "leaf-vault"), consumed by Blink's spark-unilateral-exit tool if the operators ever vanish

Structure

lib/
  atomic-file.js                      # the one atomic writer (temp+fsync+link/rename+dir-fsync)
  encrypted-seed.js                   # scrypt + AES-256-GCM seed file helper
  leaf-vault.js                       # SDK-free recovery-bundle persistence + shape validation
  fee-guards.js                       # fee/amount ceilings for sends, claims, withdrawals
  l402-token.js                       # SDK-free: read the expiry a server signed into an L402 token (fetchL402 refuses dead ones)
  payment-outcome.js                  # PaymentCommittedError + the SDK's pre-send error list (pinned to the installed SDK)
  fiat-rate.js                        # BTC price from mempool.space + Coinbase, cross-checked (the number behind "$100")
  spend-ledger.js                     # rolling-window cumulative budget (bounds send LOOPS)
  transfer-ids.js                     # persisted per-invoice Lightning dedup transferId (safe retries)
  wallet-privacy.js                   # SDK-free: turn the operators' per-wallet privacy setting on (wallets are public by default)
  recipients-allowlist.js             # opt-in outbound allowlist guardrail
  wallet-options.js                   # sparkWalletOptions: every wallet opens with the SDK's fee ladders OFF (default ON since 0.13)
  index.js / index.d.ts               # npm entry (also exports ./leaf-vault subpaths)
skills/
  sparkbtcbot/
    SKILL.md                          # Always-loaded skill body (security, setup, navigator)
    references/                       # Detail loaded on demand (SDK API, agent class, L402, etc.)
      encrypted-seed.md               # Threat model, setup modes, recovery
      unilateral-exit.md              # The leaf-vault backup + Blink's exit tool
      first-spend.md                  # The product path: fiat invoice for a newbie → country-aware gift card sized under the balance
      supply-chain.md                 # When/how to offer npm hardening (moved out of SKILL.md for the size ratchet)
      recovery-scenarios.md           # Recovery properties (staleness, justice, economics)
    scripts/                          # Runnable example scripts
      cli.js                          # `sparkbtcbot <command>` — the single published bin (dispatcher)
      setup-encrypted-seed.js         # `npm run setup` — one-time bootstrap
      leaf-vault.js                   # snapshotLeafVault / verifyVault / enableLeafVault (library)
      leaf-vault-cli.js               # `npm run leaf-vault [-- verify]` — snapshot/verify CLI
      viewer-key.js                   # `sparkbtcbot viewer` — read-only access to a private wallet: status/grant(y/N)/revoke/pubkey/balance
      balance-and-deposits.js
      payment-flow.js
      token-operations.js
      spark-agent.js
      l402-paywalls.js
    evals/                            # Skill-quality evals (does the skill make Claude produce correct/safe code?)
      evals.json                      # Output evals: SDK-correctness + security-behavior + user-story (graded on the reply), with checkable assertions
      trigger-eval.json               # Description-triggering queries (see eval-notes/NOTES.md: not measurable via claude -p here)
eval-notes/                           # Eval run notes, kept out of the package: how to run + every run's results
  NOTES.md                            # How to run (subagent output evals, with-skill vs baseline) + results, newest at the bottom
  findings-*.md / rerun-*.md          # Per-run reports
tests/                                # vitest suite for the LIBRARY code (unit, integration, funded tiers)
.env.example                          # Environment variable template

Read the full file on GitHub · 110 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. today Changed · +6 lines · +159 tokens per session 1002dd911afc
  2. 1mo ago Changed · +8 lines · +254 tokens per session 82c1eb5cca15
  3. 1mo ago Changed · +86 tokens per session 390efcb316d8
  4. 1mo ago First seen · 96 lines · 1,497 tokens per session scan A b47a0a2d5680

Subscribe to this mod's changes

sparkbtcbot CLAUDE.md is an instructions file published in the GitHub repository echennells/sparkbtcbot (5 stars, last pushed yesterday), licensed MIT. It adds 1,996 tokens to every session, about $0.0080 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-31.

Related

Other instructions, from other repositories