CLAUDE.md template below use the Cloak SDK (@cloak.dev/sdk).
Quick launch
Use in Cursor
Open the Cursor starter prompt.
Use in Claude Code
Open the Claude starter prompt.
Use in Windsurf
Open the Windsurf starter prompt.
1) Project context file
CreateCLAUDE.md at your project root.
View CLAUDE.md template
View CLAUDE.md template
SDK Project Context
We use@cloak.dev/sdk.Required runtime assumptions
- Program ID:
zh1eLd6rSphLejbFfJEneUwzHRfMKxgzrgkfwA6qRkW - Circuit base URL:
https://storage.googleapis.com/cloak-circuits/circuits/0.2.0(ceremony bundle, and the SDK default; use the exportedDEFAULT_CIRCUITS_URLconstant orresolveCircuitsBase()instead of hardcoding the string, and never use0.1.0: the program no longer accepts those artifacts) - UTXO API is primary (
transact,partialWithdraw,fullWithdraw,swapWithChange) - Amounts are
bigintin transaction logic
Full SDK capability groups
- Note API free functions (
generateNoteFromWallet,parseNote,serializeNote,exportNote) - UTXO primitives + UTXO transaction API
- chain-note scanner/compliance APIs
- viewing key + metadata encryption APIs
- relay/proof/Merkle helpers
- fees/errors/network/wallet/storage utilities
Guardrails
- Never log secrets (private keys, viewing keys (
nk), raw note payloads, seed material). - Transaction signatures are public and can be logged for support/debugging.
- Use SDK defaults for program and circuits. Do not expose those as user-facing config. The relay has no SDK default: pass
relayUrlexplicitly on every call. The SDK reads no environment variable for it; if the value should be configurable, readCLOAK_RELAY_URLin your own code and pass it asrelayUrl. OmittingrelayUrlthrowsViewing key registration is mandatory: relayUrl is required.before any network call, deposits included. - Never pass
relayUrl: ""to “skip the relay”. Under the defaultenforceViewingKeyRegistrationit throws the same error as omitting it, and it only signals caller-signed direct submission whenenforceViewingKeyRegistration: falseis set as well, which submits a send or withdrawal under the user’s own key and publicly links it. - In browser code, authenticate the sender with
signMessage+walletPublicKeyin the transact options. Never emitdepositorKeypairin browser send or withdraw code. - Never substitute the authenticated sender with an ephemeral or service key. That key is the one screened, so it must be the end user’s own wallet key.
- Never tell the user they must use a particular RPC provider. The RPC endpoint is the app owner’s choice.
- Viewing-key registration is enforced inside the SDK transaction flows (
transact,transfer,partialWithdraw,fullWithdraw,swapWithChange); do not add an app-level registration step and do not disable it. Call the exportedregisterViewingKeyonly for standalone compliance or history scanning. - Keep privacy history cache-first, then explicit rescan.
- Rely on SDK stale-root retries by default; add extra app-level retry/backoff only when explicitly required.
Required references
/llms.txt/llms-full.txt/sdk/llms.txt/sdk/api-reference/sdk/request-authentication/sdk/utxo-transactions/sdk/wallet-integration
2) Starter prompt
Use this as your first message in Claude Code:Copy starter prompt
Copy starter prompt
Implement this feature using the full
@cloak.dev/sdk model.Before coding:- output a capability matrix with these rows:
- Note API
- UTXO API
- Scanner/compliance
- Viewing keys + metadata encryption
- Relay/proof/Merkle helpers
- Utility modules (fees/errors/network/wallet/storage)
- mark each row as
usedornot usedand explain why.
- keep bigint-safe amount handling
- include both keypair-bytes and wallet-adapter usage where relevant, following
/sdk/request-authenticationfor the wallet-adapter path - add user-facing progress and error states
- avoid secret leakage in logs
- run type checks and lint
- provide changed files + rationale + verification summary
3) Task prompts
Build full integration layer
Build full integration layer
Build a production-ready integration module covering deposit, send, withdraw, swap, compliance history, and CSV export.Return complete file patches and commands to run.
Patch my existing app
Patch my existing app
Audit current code for SDK contract mismatches, patch all issues, and keep UI
behavior stable unless broken.
History UX and scanner quality
History UX and scanner quality
Implement cache-first history, clear-cache+rescan controls, fee/net rendering, and robust scanner error handling.