spark CLAUDE.md

spark CLAUDE.md is an instructions file for coding agents from buildonspark/spark. It costs 1,821 tokens per session, scanned A, original, Apache-2.0.

Development instructions for Spark, a Bitcoin Layer 2 project with Go, JavaScript, TypeScript, Rust, and protocol definitions. It describes the repository structure, setup, and code-quality conventions.

In plain words
What is it for?
Use it when working on Spark’s backend, SDKs, signing code, token layer, or protocol files.
Why use it?
It gives contributors the project context and required standards before they build or modify different parts of the codebase.

Instructions file

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 instructions/buildonspark/spark/claude-md
Clone the repo
git clone --depth 1 https://github.com/buildonspark/spark

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/buildonspark/spark/claude-md.svg)](https://agentmods.dev/instructions/buildonspark/spark/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/buildonspark/spark/claude-md"><img src="https://agentmods.dev/badge/instructions/buildonspark/spark/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,821 This file is loaded in full into every session.
When invoked 1,821 The same file — it is already loaded in full.
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.01821 $0.01821
Opus 5 $0.00911 $0.00911
Sonnet 5 $0.00364 $0.00364
Haiku 4.5 $0.00182 $0.00182

Measured yesterday against content hash 5d9bf52f45f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spark 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 yesterday.

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 · 163 lines

How it starts

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

Spark Repository

Spark is a Bitcoin Layer 2 protocol enabling instant, low-cost Bitcoin transactions using FROST threshold signatures. For deep protocol and architecture context, see .claude/CLAUDE.md.

Setup

mise trust && mise install
lefthook install  # git hooks (optional)

Components

  • spark/ - Go backend (Signing Operators) - see spark/CLAUDE.md
  • sdks/js/ - JavaScript/TypeScript SDK - see sdks/js/packages/spark-sdk/CLAUDE.md
  • signer/ - Rust FROST signing implementation
  • lrc20.dev/ - BTKN token layer (Rust)
  • protos/ - Protocol buffer definitions

Code Quality Guidelines

Comments

Be judicious with comments. Prefer clear naming and well-structured functions over explanatory comments.

Avoid redundant comments:

// Bad - comment just repeats the code
// Verify operator signatures
verifyOperatorSignatures(sigs)

// Good - no comment needed, function name is clear
verifyOperatorSignatures(sigs)

When comments ARE useful:

  • Non-obvious "why" explanations (e.g., race conditions, protocol requirements)
  • Public API documentation
  • Security-critical sections
  • References to external specs or papers

Comment quality guidelines:

  • Explain "why", not "what" - the code shows what happens; comments explain reasoning
  • Comments must be self-contained - never reference "the old implementation" since future readers won't have that context
  • Only add non-obvious information - // Save to database before db.Save() wastes space
  • Don't comment out code - delete it; git remembers
  • A Jira ticket belongs in a comment as TODO(SP-XXXX), or appended as a citation to a comment that already reads on its own - never as a bare "See SP-1234" standing in for the reason

Logging (Go)

We use Zap (go.uber.org/zap) for all logging, replacing log/slog from the standard library. Zap has two logger types:

  • SugaredLogger — default for logs with dynamic values. Use printf-style formatting via logger.Sugar().
  • Logger — use only when attaching approved, searchable attributes.

Read the full file on GitHub · 163 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. yesterday First seen · 163 lines · 1,821 tokens per session scan A 5d9bf52f45f1

Subscribe to this mod's changes

spark CLAUDE.md is an instructions file published in the GitHub repository buildonspark/spark (110 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,821 tokens to every session, about $0.0091 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.