Skip to content
Coding agent · Claude Code

Add e-signatures with Claude Code

You have Claude Code open in your repo and a signup form that needs a terms checkbox with a real record behind it. Paste one prompt: Claude Code wires the form you already have, and Esign Comply gives it the rules and keeps the independent record.

Free plan: 10 live signatures a month and a full test mode. No card required.

One prompt, from paste to record
  1. 01
    Put a test key in your server environmentYou
  2. 02
    Paste one prompt into Claude CodeYou
  3. 03
    Claude Code wires your form and your serverYou
  4. 04
    Acceptance reported from the user's browserEsign Comply
  5. 05
    Sealed record, receipt and timestampEsign Comply
  6. 06
    Server confirms, then creates the accountYou
Copy-paste prompt

The prompt to paste into Claude Code

Open Claude Code in your repository and paste this as your message. It builds a signup clickwrap: your Terms of Service and Privacy Notice, accepted with your own checkbox and your own button.

What the prompt tells Claude Code
  • Read setup.md, auth.md and llms.txt before writing anything.
  • Create the session on your server with the secret key, and send only the client token to the browser.
  • Attach the browser SDK to your own checkbox and button. No widget, no iframe.
  • Confirm the record on your server before the account exists.
  • Never invent an API method, and stop and ask when something conflicts.
Generate the prompt for your regions
Prompt for Claude Code
You are adding an Esign Comply acceptance ceremony to this repository's signup form: the user accepts our Terms of Service and Privacy Notice before the account exists. Esign Comply is the independent record keeper. This application renders every screen.

Before you edit anything, read these and follow them exactly:
- https://esigncomply.com/setup.md
- https://esigncomply.com/auth.md
- https://esigncomply.com/llms.txt

Then show me a short plan and wait for my go-ahead.

Build
1. A server route that creates the session with the secret key from ESIGNCOMPLY_API_KEY and returns only the client token and the pinned document version IDs to the browser.
2. The existing signup form, with @esigncomply/browser attached to its own checkbox and its own submit button. The checkbox starts unchecked. complete() runs from the user's real click.
3. A server confirmation that reads the record with the secret key before the account is created, and refuses a made-up record ID.

Rules
- Do not invent API methods, packages or legal wording. If the docs do not cover something, stop and ask.
- If a step conflicts with existing code, stop and ask.
- Never print a key, and never put it in a client component.

Run commands in the shell and show their output, ending with npx esigncomply check --url http://localhost:3000/signup. Keep these rules as a section of CLAUDE.md.
5 steps

How to run it in Claude Code

Claude Code is Anthropic's AI coding agent. This is the whole run, from a new Esign Comply account to your first test record.

  1. 01
    Create a free account and a test keySign up, then choose Create test key in the dashboard. The key starts with esc_test_ and is shown once. You create the account and accept the terms once. No card. After that Claude Code can do the rest: create keys, register documents, build the flow, verify the domain, go live.
  2. 02
    Put the key where your server reads itAdd ESIGNCOMPLY_API_KEY=esc_test_us_... to .env.local, listed in .gitignore. Claude Code needs the variable to be set. It never needs to see the value, and the prompt tells it never to print a key.
  3. 03
    Paste the prompt into Claude CodeIt reads the three docs pages, shows you a short plan and waits for your go-ahead. Then it writes the session route, attaches the SDK to your form and adds the server confirmation.
  4. 04
    Let it run the checkThe prompt ends with npx esigncomply check --url http://localhost:3000/signup. Claude Code runs it in the shell, shows the output and fixes every finding marked block.
  5. 05
    Tick the box yourselfOpen /signup, tick the checkbox and click Create account. The rules stay in a section of CLAUDE.md, so the next session follows them without the prompt.
The 60-second result

What you have 60 seconds after Claude Code finishes

Approve the plan, let Claude Code finish, then sign up once on localhost. One minute later you have three files in the diff and one sealed test record.

  1. 01

    The server route that creates the session

    e.g. app/api/ceremony/route.ts

    It holds the secret key, pins the current version of each document and hands the browser a short-lived client token.

  2. 02

    Your signup form, with the SDK attached

    e.g. app/signup/signup-form.tsx

    Your markup and your styles. The SDK renders nothing: it watches your links, your checkbox and your button, and reports what the user did.

  3. 03

    The server confirmation

    e.g. app/api/signup/confirm/route.ts

    The record ID came from the browser, so the server reads the record with the secret key before the account exists.

// app/api/ceremony/route.ts
import { esc } from "@/lib/esigncomply";

export async function POST(request: Request) {
  const { signerId, email, attempt } = await request.json();

  const { data: session, error } = await esc.sessions.create(
    {
      profile: "prof_signup_4f1a",
      signer: {
        external_id: signerId,
        email,
        class: "consumer",
        country: "US",
      },
      documents: [
        { document: "doc_8Hq2", version: "current" }, // Terms of Service
        { document: "doc_Pv71", version: "current" }, // Privacy Notice
      ],
      context: {
        url: "http://localhost:3000/signup",
        locale: "en-US",
        purpose: "account_signup",
      },
    },
    { idempotencyKey: `signup-${signerId}-${attempt}` },
  );
  if (error) return Response.json({ error: error.code }, { status: 502 });

  // Save signerId and the pinned version IDs in server-owned state.
  return Response.json({
    clientToken: session.client_token,
    documents: session.documents,
  });
}

The example is a Next.js repository. In another stack, Claude Code writes the same three parts under that stack's file names.

The record that appears

One sealed test record, kept by Esign Comply

Recordrec_Z4m8
simple · L1
RecordedWritten durably, receipt signed with ES256
TimestampedExternal RFC 3161 token over the record hash
AnchoredPublic anchor pending
Checkbox changed by a trusted user eventobserved
Terms of Service, version dv_3kT9observed
Server time 2026-11-21T15:03:20.291Zobserved
Signer email dana@example.orgasserted
record_hash sha256:5be7…example record

Your first test record opens in the dashboard with what was observed, what was asserted, and the conformance findings. It is sealed like a live record, on a separate test ledger, and its evidence report is watermarked TEST.

What Claude Code gets right with the rules, and wrong without them

Claude Code follows the instructions it is given, and "add a terms checkbox" is not many instructions. The prompt hands it the measurable ones, and the check reports on each.

CR-01block

Affirmative assent control

Without the rules

The checkbox ships already ticked, or a handler ticks it for the user to save a click.

With the prompt

The box renders unchecked and only a real user event changes it. The SDK records its state at load, and the check reports a pre-checked box or a scripted click at block level.

CR-02block

Notice text names every document

Without the rules

One generic line, "By signing up, you agree to our terms", with no document titles and no links.

With the prompt

The notice carries the registered title of every document in the session, each one linked, inside the same container as the checkbox and the button.

CR-04block

Notice and control in the same viewport

Without the rules

The agreement line sits in the footer or under a long form, below the fold on a phone.

With the prompt

The notice sits directly above the button in the same container. The SDK records both positions at the signing act, and the check runs your page at 390 by 844.

CR-07warn

Single primary action control

Without the rules

Email signup and two social sign-in buttons in one form, all styled as the main action under one notice.

With the prompt

One primary button inside the assent container. Social sign-in gets its own container, its own notice and its own session.

CR-08block

Document links resolve to the registered version

Without the rules

A link to /terms that serves whatever is in the repo today, or the legal text pasted into a component.

With the prompt

Every link serves the registered version by its ID, and the record pins that version by SHA-256 hash. Document text is never copied into your code.

Each row is a real conformance rule with its ID and its default level. Esign Comply runs 28 of them over your test records, and every finding names the rule, the measurement and the fix.

Go further with Claude Code

Once the rules are in CLAUDE.md, every later session starts with them. Ask Claude Code for the next flow in the same repo.

A whole product

Build your own signing app

Upload a document, email each signer a link to your own application and collect the signatures there. There are 7 build guides, each with the steps and the code.

Build your own DocuSign
Your stack

Stack guides

The same integration written out for your framework and your host, with working code for the server, the browser and the confirmation.

Browse the stack guides
Live demos

Use cases

NDAs, contractor agreements, consent forms, order forms and terms updates. Each page has a live demo you can sign in test mode.

See the use cases
Prompt generator

The exact rules for your regions

Pick your use case, regions, signer types and stack. You get one prompt to paste into Claude Code, with your own document and profile IDs and the rule packs you selected.

Generate a prompt

Questions about Claude Code and e-signatures

Can Claude Code add e-signatures to an existing app?

Yes. Claude Code works in the repository you already have, so it attaches the Esign Comply browser SDK to your existing signup form instead of generating a new one. The prompt on this page has it read the setup runbook, show you a plan, then build the session route, the form wiring and the server confirmation.

Does Claude Code need to see my Esign Comply API key?

No. It needs the key to be in the environment as ESIGNCOMPLY_API_KEY, for example in .env.local. The prompt tells Claude Code never to print a key, and the credential rules at esigncomply.com/auth.md tell it to check that the variable is set without showing its value.

Read the quickstart

Where do the rules go so the next Claude Code session follows them?

In a section of CLAUDE.md. The prompt asks for that, and a prompt generated in the Esign Comply dashboard downloads as a marked CLAUDE.md section. When you generate again, the new section replaces the old one and the rest of the file is left alone.

Generate a prompt

Does Claude Code run the conformance check itself?

Yes, the prompt tells it to. It ends with npx esigncomply check --url http://localhost:3000/signup, run in the shell with the output shown. Claude Code fixes the findings marked block and lists the ones marked warn for you to read.

Read the conformance rules

What does Esign Comply do that Claude Code cannot write for me?

It keeps the record. Claude Code can write a table and a timestamp, and that row stays yours to edit. Esign Comply receives the acceptance from the user's browser, seals it with keys you do not hold, has an outside authority timestamp it (RFC 3161) and returns a signed receipt to store next to your own row.

Why a third party keeps the record

Give Claude Code the rules. Leave the record to us.

Free plan: 10 live signatures a month and a full test mode. No card required.

Claude Code is a trademark of its owner. Esign Comply is not affiliated with it.

Working with an AI tool? This page is also available as Markdown: /build/claude-code.md