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.
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.
npx agentmods add instructions/unicity-sphere/sphere-sdk/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.svg" alt="Measured on agentmods" 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.14549 | $0.14549 |
| Opus 5 | $0.07275 | $0.07275 |
| Sonnet 5 | $0.02910 | $0.02910 |
| Haiku 4.5 | $0.01455 | $0.01455 |
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.
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— 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 (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 touchingmodules/payments-v2/orimpl/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 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/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. Known pre-existing flaky/failing tests are tracked in #487. - 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 is a fleet-wide flag day (#760, shipping as 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 accompanies the 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.
- today Changed · +18 lines · +380 tokens per session 5520287daa91
- 3d ago Changed · -1 lines · +15 tokens per session ce42b0d686c4
- 6d ago First seen · 852 lines · 14,154 tokens per session scan A e7c04c6a22f5
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.
Other instructions, from other repositories
Kalatori AGENTS.md
AGENTS.md instructions for Kalapaja/Kalatori, covering kalatori — ai agent guide, critical pitfalls, how we work, documentation policy and research policy.
Kalatori CLAUDE.md
Claude Code instructions for Kalapaja/Kalatori, a project described as: Kalatori daemon to handle chain-to-webstore interaction.
Get-Started-with-Web3 AGENTS.md
AGENTS.md instructions for beihaili/Get-Started-with-Web3, covering get started with web3 agent notes, 项目定位, ceo 运营目标, 常用命令 and ai-native 内容层.
ai AGENTS.md
AGENTS.md instructions for vercel/ai, covering agents.md, project overview, repository structure, key directories and core package dependencies.
ai CLAUDE.md
Claude Code instructions for vercel/ai, a project described as: The AI Toolkit for TypeScript. From the creators of Next.js, the AI SDK is a free open-source library for building AI-powered applications and agents.
OwnPilot AGENTS.md
Instructions for ownpilot/OwnPilot, covering ownpilot, architecture, key patterns, commands and tech stack.