> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloak.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code setup

> High-signal prompts to ship Cloak SDK apps quickly

Use this page as your copy/paste playbook for Claude Code. The prompts below
target the TypeScript SDK (`@cloak.dev/sdk`).

<Tip>
  For Rust integrations, start with [`/sdk/rust/llms.txt`](/sdk/rust/llms.txt) and
  [the Rust quickstart](/sdk/rust/quickstart) instead — the TS prompts and the
  `CLAUDE.md` template below assume `npx tsx` CLI shape and won't translate.
</Tip>

## Quick launch

<CardGroup cols={3}>
  <Card title="Use in Cursor" icon="arrow-pointer" href="/ai-tools/cursor#2-starter-prompt">
    Open the Cursor starter prompt.
  </Card>

  <Card title="Use in Claude Code" icon="message-bot" href="/ai-tools/claude-code#2-starter-prompt">
    Open the Claude starter prompt.
  </Card>

  <Card title="Use in Windsurf" icon="wind" href="/ai-tools/windsurf#2-starter-prompt">
    Open the Windsurf starter prompt.
  </Card>
</CardGroup>

## 1) Project context file

Create `CLAUDE.md` at your project root.

<Accordion title="View CLAUDE.md template">
  # SDK Project Context

  We use `@cloak.dev/sdk`.

  ## Required runtime assumptions

  * Program ID: `zh1eLd6rSphLejbFfJEneUwzHRfMKxgzrgkfwA6qRkW`
  * Circuit base URL: `https://cloak-circuits.s3.us-east-1.amazonaws.com/circuits/0.1.0`
  * UTXO API is primary (`transact`, `partialWithdraw`, `fullWithdraw`, `swapWithChange`)
  * Amounts are `bigint` in transaction logic

  ## Full SDK capability groups

  1. `CloakSDK` note API
  2. UTXO primitives + UTXO transaction API
  3. chain-note scanner/compliance APIs
  4. viewing key + metadata encryption APIs
  5. relay/proof/Merkle helpers
  6. 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, relay, and circuits. Do not expose these as user-facing config.
  * Enforce viewing-key registration before protocol actions.
  * 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/utxo-transactions`
  * `/sdk/wallet-integration`
</Accordion>

## 2) Starter prompt

Use this as your first message in Claude Code:

<Accordion title="Copy starter prompt">
  Implement this feature using the full `@cloak.dev/sdk` model.

  Before coding:

  1. 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)
  2. mark each row as `used` or `not used` and explain why.

  During implementation:

  * keep bigint-safe amount handling
  * include both keypair-bytes and wallet-adapter usage where relevant
  * add user-facing progress and error states
  * avoid secret leakage in logs

  After implementation:

  * run type checks and lint
  * provide changed files + rationale + verification summary
</Accordion>

## 3) Task prompts

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="Patch my existing app">
    Audit current code for SDK contract mismatches, patch all issues, and keep UI
    behavior stable unless broken.
  </Accordion>

  <Accordion title="History UX and scanner quality">
    Implement cache-first history, clear-cache+rescan controls, fee/net rendering, and robust scanner error handling.
  </Accordion>
</AccordionGroup>

## Related docs

* [AI Integration](/ai-tools/ai-integration)
* [LLM Index](/llms.txt)
* [LLM Full Export](/llms-full.txt)
* [LLM Reference](/sdk/llms.txt)
* [API Reference](/sdk/api-reference)
* [UTXO Transactions](/sdk/utxo-transactions)
