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.
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.
curl -O https://raw.githubusercontent.com/unicity-sphere/sphere-sdk/main/CLAUDE.mdgit clone --depth 1 https://github.com/unicity-sphere/sphere-sdkWrote 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.
[](https://agentmods.dev/instructions/unicity-sphere/sphere-sdk/claude-md)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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— thefeat/wallet-api-integrationera ended when the integration branches merged (releases ship frommain; 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, plustest:mutation, sharded across 8 parallel jobs byMUTATION_SHARD=i/nand summed up in onetest-mutationcheck). - 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 touchingmodules/payments-v2/orimpl/wallet-api-v2/; the code anddocs/API.mdare 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 nullinclusionProofmeans "not certified YET", and the time-dependent statuses the bump added —REQUEST_EXPIREDandREFERENCE_TIME_AFTER_ROUNDon verify,REQUEST_EXPIREDandSERVICE_NOT_READYon submit — each report only that THIS attempt was not admitted, never that no earlier attempt certified, so none of them is a clean reject. TheSTATE_ID_EXISTSaggregator lag is OVER (M7 live e2e observed 2026-06-12: the gateway answersSUCCESSfor duplicate AND conflicting submits — the status carries no conflict signal; see the dated OBSERVED note in../wallet-api/docs/sdk-changes.mdE.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:expiresAtis 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 — andInclusionProofVerificationRulecompares the hash BEFORE the certification data, so the disagreement surfaces asTRANSACTION_HASH_MISMATCH, i.e. as a foreign spend, whichtoken-engine/certification-outcome.tsmaps toTransferConflictError(abort + re-plan). A clock-derived deadline would therefore make every crash-resume abort an intent whose spend is already on chain. Pinned bytests/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
StoragePortandDeliveryPort(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 runsnpm versionitself, sopackage.jsonon a branch still reads the PREVIOUS version; never hand-edit the field. Publishing frommaintakes dist-taglatest, any other branch takesdev(line<next version>-dev.#). Consumers (wallet-api backend, sphere frontend) pin exact versions. The backend consumes ONLY the./token-enginesubpath (must stay browser/Nostr-free — keeptoken-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 carriesCertificationDataVersion = 2with a hard reject of version 1 — nothing can straddle the gateway cutover.wallet-apimust bump in LOCKSTEP: both repos pin@unicitylabs/state-transition-sdkEXACTLY, 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 carriesexpiresAt— an exclusive request deadline in Unix seconds — and every inclusion proof carries thereferenceTimeof 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 inwaitInclusionProofthat 2.0.3 fixed (state-transition-sdk-js#140/#141) is still fixed in 3.0.1: its poll loop checksabortedbefore subscribing, races each poll against the signal, and cancels the in-flight request.tests/unit/token-engine/proof-deadline.test.tsis the guard that it keeps doing so — do not delete it on a future bump.
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.
- 18d ago Changed · +8 lines · +204 tokens per session 9eeb1e3a6e8a
- 20d ago Changed · +14 lines · +351 tokens per session 8b349ecfa875
- 21d ago Changed · +1 lines · +28 tokens per session 833f01fa04c0
- 23d ago Changed · +112 lines · +2,572 tokens per session 64413ba591bc
- 1mo ago Changed · +11 lines · +264 tokens per session c2d0fa656d2c
- 1mo ago Changed · +74 tokens per session 9c5daff24598
- 1mo ago Changed · +18 lines · +598 tokens per session 897e6c39115f
- 1mo ago Changed · +94 lines · +2,387 tokens per session 16875c8b675e
- 1mo ago Changed · +21 tokens per session c0be642a9406
- 1mo ago First seen · 1,001 lines · 17,683 tokens per session scan A 1f370f1becc6
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.
sphere-sdk CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| sphere-sdk CLAUDE.mdunicity-sphere/sphere-sdk | Instructions file | 5.4k | 11d ago | MIT | A | 24,182 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |