sphere-sdk: Instructions file for Claude Code

CLAUDE.md

sphere-sdk CLAUDE.md is an instructions file for Claude Code from unicity-sphere/sphere-sdk. It costs 24,182 tokens per session, scanned A, original, MIT.

A project instruction file for the Sphere SDK, a software library for integrating Sphere wallet services. It records the project’s current development rules, architecture guidance, build checks, and references for wallet and payment work.

In plain words
What is it for?
Use it when working on Sphere wallet integrations, provider changes, payment modules, specifications, branches, pull requests, and required tests.
Why use it?
It gives coding agents the project context and constraints they need before changing the SDK, reducing the risk of following outdated workflows or altering the wrong system.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

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

About the project

Sphere SDK is a TypeScript toolkit for managing Unicity wallets and enabling agents to exchange payments, requests, messages, and signed market intents. It is intended for applications and autonomous agents that need identities, wallets, and peer-to-peer economic interactions.

unicity-sphere/sphere-sdk · 5,388 stars · on GitHub · unicity.ai

Reuse

Borrowing it

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

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 sphere-sdk CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/unicity-sphere/sphere-sdk/claude-md"><img src="https://agentmods.dev/badge/instructions/unicity-sphere/sphere-sdk/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24,182 This file is loaded in full into every session.
When invoked 24,182 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.24182 $0.24182
Opus 5.5 $0.09673 $0.09673
Sonnet 5.5 $0.04836 $0.04836
Haiku 4.5 $0.02418 $0.02418

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

Security

Grade A, and why

sphere-sdk 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 18d 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.md · 1,259 lines

How it starts

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

CLAUDE.md - Sphere SDK Project Context

This file provides context for Claude Code when working with the Sphere SDK project.

⚡ wallet-api program — current work (read first)

This repo is part of the wallet-api program (process: ../wallet-api/docs/development-workflow.md).

  • Branch topology (updated 2026-07-31): all work branches from and PRs back to main — the feat/wallet-api-integration era ended when the integration branches merged (releases ship from main; wallet-api#119 records this in the process doc). Every PR links a GitHub issue (Closes #N, docs-only changes exempt); squash-merge after green CI (.github/workflows/ci.yml: verify:version + typecheck + typecheck:tests + lint + build + test:run on Node 22 and 24, plus test:mutation, sharded across 8 parallel jobs by MUTATION_SHARD=i/n and summed up in one test-mutation check).
  • The normative spec for the program's SDK work is ../wallet-api/docs/sdk-changes.md — Part E (recoverable engine), then S1–S7 (thin wallet, ports, wallet-api providers). It was adversarially verified; build it, don't redesign it. Spec-first: contract changes land in the spec in the same PR, before code. The payments vertical (P11 flip landed) is the ONLY money path — design record + build history: docs/PAYMENTS-V2-DESIGN.md (read it for the why before touching modules/payments-v2/ or impl/wallet-api-v2/; the code and docs/API.md are normative for the current API). Migration guide for consumers: docs/MIGRATION-PAYMENTS-V2.md.
  • Resume is status-agnostic (sdk-changes E.2): never key engine resume off a submit status — submit, always getInclusionProof, match-verify (OK = mine, TRANSACTION_HASH_MISMATCH = TransferConflictError). That stays the ONLY conflict signal under 3.x: a null inclusionProof means "not certified YET", and the time-dependent statuses the bump added — REQUEST_EXPIRED and REFERENCE_TIME_AFTER_ROUND on verify, REQUEST_EXPIRED and SERVICE_NOT_READY on submit — each report only that THIS attempt was not admitted, never that no earlier attempt certified, so none of them is a clean reject. The STATE_ID_EXISTS aggregator lag is OVER (M7 live e2e observed 2026-06-12: the gateway answers SUCCESS for duplicate AND conflicting submits — the status carries no conflict signal; see the dated OBSERVED note in ../wallet-api/docs/sdk-changes.md E.2); tolerant parsing shipped via state-transition-sdk-js#125 and stays.
  • Sphere sets no request deadline, ANYWHERE (#760): every mint / transfer / split burn / split mint leg omits expiresAt, so the Unicity Service assigns one from consensus time and does not record it. The reason is not determinism — a deadline persisted on the durable intent would rebuild byte-identically — it is (a) an untrusted browser clock, where one skewed wallet pinning a past deadline is a wallet-wide payment outage, and (b) unrecoverability across downtime longer than the window: every resume would rebuild an already-expired transaction and the intent would sit open forever with its sources reserved, and there is currently NO attempt budget on the certify/resume path at all. What makes the policy load-bearing rather than cosmetic: expiresAt is committed by the transaction HASH but is NOT part of the StateId, so two attempts that disagree about it address the SAME leaf with DIFFERENT hashes — and InclusionProofVerificationRule compares the hash BEFORE the certification data, so the disagreement surfaces as TRANSACTION_HASH_MISMATCH, i.e. as a foreign spend, which token-engine/certification-outcome.ts maps to TransferConflictError (abort + re-plan). A clock-derived deadline would therefore make every crash-resume abort an intent whose spend is already on chain. Pinned by tests/unit/token-engine/expires-at.test.ts, including a 24-hour clock jump between two attempts.
  • Ports rule (design §10 / covenant): the money ports are StoragePort and DeliveryPort (modules/payments-v2/ports.ts) — independent, swappable, contract-test-enforced (tests/unit/payments-v2/contracts/); the Sphere frontend is a view — no provider-specific logic outside implementations; custody (intoInventory) is a composition-time property, never a per-call flag.
  • Never weaken a test to make it pass; no .skip/.only. (#487, the old pre-existing-failure tracker, is closed: it covered tests of modules that have since been deleted.)
  • Releases: npm versions publish via publish.yml (workflow_dispatch, version input) — the workflow runs npm version itself, so package.json on a branch still reads the PREVIOUS version; never hand-edit the field. Publishing from main takes dist-tag latest, any other branch takes dev (line <next version>-dev.#). Consumers (wallet-api backend, sphere frontend) pin exact versions. The backend consumes ONLY the ./token-engine subpath (must stay browser/Nostr-free — keep token-engine/ clean).
  • The 3.x bump was a fleet-wide flag day (#760, shipped in 0.15.0). The forcing function is aggregator-go, whose main already carries CertificationDataVersion = 2 with a hard reject of version 1 — nothing can straddle the gateway cutover. wallet-api must bump in LOCKSTEP: both repos pin @unicitylabs/state-transition-sdk EXACTLY, so bumping sphere-sdk alone makes npm dedupe impossible and runs both wire realms live; they cross at ../wallet-api/src/validation/verifier.ts. A testnet + wallet-api backend reset accompanied that release.
  • Pinned base SDK: @unicitylabs/[email protected] (exact pin; bump only via PR). What 3.x is: every transaction now carries expiresAt — an exclusive request deadline in Unix seconds — and every inclusion proof carries the referenceTime of the round that certified it; the sparse-Merkle leaf value became H(transactionHash, referenceTime) instead of the bare transaction hash. The Token / MintTransaction / TransferTransaction / CertificationData wire versions all moved with it: nothing written by 2.x decodes, and nothing 2.x writes is accepted by the upgraded aggregator — in either direction, no exceptions. The lost-abort hang in waitInclusionProof that 2.0.3 fixed (state-transition-sdk-js#140/#141) is still fixed in 3.0.1: its poll loop checks aborted before subscribing, races each poll against the signal, and cancels the in-flight request. tests/unit/token-engine/proof-deadline.test.ts is the guard that it keeps doing so — do not delete it on a future bump.

Read the full file on GitHub · 1,259 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. 18d ago Changed · +8 lines · +204 tokens per session 9eeb1e3a6e8a
  2. 20d ago Changed · +14 lines · +351 tokens per session 8b349ecfa875
  3. 21d ago Changed · +1 lines · +28 tokens per session 833f01fa04c0
  4. 23d ago Changed · +112 lines · +2,572 tokens per session 64413ba591bc
  5. 1mo ago Changed · +11 lines · +264 tokens per session c2d0fa656d2c
  6. 1mo ago Changed · +74 tokens per session 9c5daff24598
  7. 1mo ago Changed · +18 lines · +598 tokens per session 897e6c39115f
  8. 1mo ago Changed · +94 lines · +2,387 tokens per session 16875c8b675e
  9. 1mo ago Changed · +21 tokens per session c0be642a9406
  10. 1mo ago First seen · 1,001 lines · 17,683 tokens per session scan A 1f370f1becc6

Subscribe to this mod's changes

sphere-sdk CLAUDE.md is an instructions file published in the GitHub repository unicity-sphere/sphere-sdk (5,388 stars, last pushed 11d ago), licensed MIT. It adds 24,182 tokens to every session, about $0.0967 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-30.

Related

sphere-sdk CLAUDE.md compared with instructions from other repositories

sphere-sdk CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sphere-sdk CLAUDE.mdunicity-sphere/sphere-sdkInstructions file5.4k11d agoMITA24,182Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode