sphere-sdk CLAUDE.md

sphere-sdk CLAUDE.md is an instructions file for Claude Code from unicity-sphere/sphere-sdk. It costs 14,549 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.

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,398 stars · on GitHub · unicity.ai

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/unicity-sphere/sphere-sdk/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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 14,549 This file is loaded in full into every session.
When invoked 14,549 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.1 $0.14549 $0.14549
Opus 5 $0.07275 $0.07275
Sonnet 5 $0.02910 $0.02910
Haiku 4.5 $0.01455 $0.01455

Measured today against content hash 5520287daa91, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 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 · 869 lines

How it starts

The opening of the file, as written. The whole thing — 869 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/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 (typecheck + lint + build + unit tests + typecheck:tests).
  • 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 + build tracker: docs/PAYMENTS-V2-DESIGN.md (read it before touching modules/payments-v2/ or impl/wallet-api-v2/). 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/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. Known pre-existing flaky/failing tests are tracked in #487.
  • 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 is a fleet-wide flag day (#760, shipping as 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 accompanies the 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 · 869 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 · +18 lines · +380 tokens per session 5520287daa91
  2. 3d ago Changed · -1 lines · +15 tokens per session ce42b0d686c4
  3. 6d ago First seen · 852 lines · 14,154 tokens per session scan A e7c04c6a22f5

Subscribe to this mod's changes

sphere-sdk CLAUDE.md is an instructions file published in the GitHub repository unicity-sphere/sphere-sdk (5,398 stars, last pushed yesterday), licensed MIT. It adds 14,549 tokens to every session, about $0.0727 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-08-30.