Back to Blog
Tutorial

How to Use Claude AI for Document Automation

Claude is the AI legal teams trust with the contract, finance teams trust with the numbers, and writers trust with the voice. This guide shows how to use Claude — Haiku, Sonnet, or Opus — to draft, translate, and rewrite business documents while keeping every variable and every formatting detail intact.

May 2026·9 min read

The short answer

Claude — Anthropic's family of language models — is exceptionally good at long-form documents. The 200k-token context (1M for Opus) means an entire master service agreement plus three reference contracts fits in a single prompt. Instruction-following is precise enough that Claude will respect a "do not modify variables wrapped in curly braces" rule across 40 pages without slipping. And the writing voice tends toward measured and professional out of the box, which is exactly what most business documents need.

Wire Claude into a template system that owns the layout and the variable schema, and you get a workflow that drafts, translates and rewrites whole documents in seconds — without touching the formatting.

Why Claude fits document workflows

Three properties make Claude the natural choice for documents specifically:

  • Massive context — 200k tokens is roughly 500 pages of English; 1M with Opus is enough to feed a whole client engagement history. You can hand Claude the prior contract, the renewal terms, the email thread, and the new SOW in one prompt and ask it to reconcile.
  • Tight instruction-following — long lists of constraints ("never translate variables", "keep all clause numbers", "do not add a closing summary") are followed reliably. Sloppier models drift after the first page; Claude holds the line.
  • Honest uncertainty — when a fact is missing from the input, Claude is more likely to flag it ("the engagement length was not specified") than to invent a value. That is the difference between a usable contract and a hallucination liability.

The Claude model lineup, plainly

Anthropic ships three model tiers. All three are available via the Anthropic API, and all three are wired natively into GJSDocs.

Claude Haiku 4.5

The cheap, fast model. Use it for variable extraction (turn an email into a JSON object), single-paragraph rewrites, summary generation, and classification (is this paragraph a deliverable, a payment term, or boilerplate?). Cents-on-the-dollar economics for high-volume work.

Claude Sonnet 4.6

The default for serious document drafting. Strong enough to draft a full proposal or contract on the first pass, controllable enough to follow a 15-rule style guide, fast enough that bulk runs of dozens of documents stay snappy. Most teams settle on Sonnet for production document work.

Claude Opus 4.7

The most capable model — and the only one with a 1M-token context window. Reach for Opus when the document is long (50+ pages), the instructions are unusually detailed, or the input is a sprawling history that needs reconciling (an entire customer relationship, all prior contracts, every email). The cost is real; reserve it for the work that actually needs it.

GJSDocs lets you set a default and override per template, so the routine work runs on Sonnet and the long-form, high-stakes drafts route to Opus automatically.

Five practical use cases for Claude

1. Drafting a contract that respects every variable

The hardest part of contract drafting is keeping the right values in the right places — client name in three places, governing-law jurisdiction in two, fee total in five. Claude handles this when the variables are explicit in the prompt and the output is structured.

// Prompt — draft a service agreement, structured output

Draft a master service agreement using these variables:

{client.name} = "Northwind Logistics, Inc."

{client.signatory} = "Maria Chen, COO"

{contract.start} = "2026-06-01"

{contract.term} = "24 months"

{fee.total} = "$96,000"

{governing_law} = "Delaware"

Use these exact strings wherever the value appears.

Return JSON with one key per clause: scope, deliverables,

fees, term, ip, confidentiality, termination, governing_law.

2. Page-by-page translation of long documents

Claude is the best of the three frontier models for translation that has to preserve formatting, table structure, and embedded variables. Translate one page at a time, keep the structure fenced, and explicitly list the formatting rules.

// Prompt — translate one page, keep variables and tables

Translate this proposal page from English to German.

Rules:

- Every {variable} must remain in English, untranslated.

- Every heading level must be preserved.

- Every table cell must be preserved as a cell.

- Numbers, dates, and currency symbols stay in source form.

- Do not add commentary. Return only the translated page.

<page>{page_text}</page>

3. Rewriting a section without breaking the rest

Select a paragraph, ask Claude to rewrite it for a different audience or tighter length, and drop the result back in the template. Because the template owns the surrounding context — clause numbers, headings, signature lines — the rewrite is a true in-place edit, not a "regenerate the whole document and hope".

4. Reconciling history into one document

The killer use case for Opus. Hand it the prior contract, the email thread that negotiated the renewal, the meeting notes, and the new SOW. Ask: "Produce a single renewal contract reflecting the new terms agreed in the email thread, keeping every clause from the prior contract that was not explicitly changed." Opus's 1M context makes this possible in one prompt.

5. Variable extraction from messy inputs

Use Haiku for this: hand it a customer email, a deal-stage record from HubSpot, or a row of an Airtable view, and ask it to extract the variables required by the template. Cheap, fast, and reliable enough for production.

Where naked Claude output breaks

Even with the best instruction-following on the market, a chat-only workflow hits the same five walls every team eventually meets:

  • No template enforcement. Claude returns prose; the prose is good; but every clause number, font, header style, and signature block needs to land in the right place. Without a template, you spend the time you saved on copy-paste.
  • No variable verification. Claude is more honest about uncertainty than other models, but it is still possible to ship a document with a wrong client name buried on page 7. Variables tracked outside the prompt catch this; variables tracked inside the prompt sometimes do not.
  • No bulk path. One contract is a chat session. 200 contracts is a system. The system loops over a data source, calls Claude with the row context, fills the template, exports the PDF.
  • No format export. Claude returns text. Your customer needs PDF. Your CRM expects a hosted file URL. The export, branding, and storage live somewhere downstream.
  • No audit trail. For regulated industries — healthcare, finance, legal — every generated document needs to track which prompt and which input produced it. Chat history is not enough.

The structured-template approach

The pattern that scales:

Template (the layout and brand) → Variables (the named slots) → Claude (fills the slots from the prompt or the data row) → Render (PDF, DOCX, HTML).

In GJSDocs, the visual editor builds the template, the variable system enforces names and types, the AI assistant calls Claude (with your own Anthropic API key) to fill the variables, and the renderer produces the final document. The model selection — Haiku, Sonnet or Opus — is configurable per template, so cheap routine work routes to Haiku and high-stakes long-form work routes to Opus, all from the same template library.

When the API hits a rate limit or returns an error, GJSDocs falls back to the next model in the lineup automatically — Sonnet to Haiku, Opus to Sonnet — so a momentary capacity blip does not break a bulk run.

Setting it up — five steps

Step 1 — Get an Anthropic API key

Sign in to console.anthropic.com, create an API key, and copy it. Anthropic's free tier is generous enough to prototype without paying anything; production usage is pay-as-you-go.

Step 2 — Connect Claude to GJSDocs

Open Workspace → Integrations → Claude, paste the key, and pick a default model. The key is stored encrypted at rest, never sent to the browser. Full setup details on the dedicated Claude integration page.

Step 3 — Pick or import a template

Use the free template gallery, import an existing DOCX/PDF (see converting DOCX, PDF, and images into editable templates), or build from scratch. Mark dynamic content with named variables.

Step 4 — Write the prompt

In the AI assistant panel, write a prompt that targets the template's variables. Claude does best when the prompt explicitly lists the rules and the variable schema. Generate, review, edit any field that needs a human eye.

Step 5 — Generate, export, repeat

Hit Generate. The template renders. For bulk runs over a CRM export or a Sheet, switch to bulk mode — one Claude call per row, one document per row.

Tips and limits

  • Default to Sonnet 4.6. It is the right cost-to-quality point for almost every document workflow. Reach for Haiku only when you have profiled the cost; reach for Opus only when the input is genuinely long or the stakes are unusually high.
  • List rules explicitly in the prompt. Claude follows long instruction lists better than other models — exploit that. "Do not translate variables", "keep clause numbers", "stay within ±10% of original length" all work as plain rules.
  • Use JSON output for variable-filling prompts. Parsing JSON before rendering catches structure errors before they hit the PDF.
  • Keep an eye on Anthropic spending limits in the console. The cost step from Haiku to Sonnet to Opus is large — a misconfigured loop on Opus is real money.
  • For Opus 1M-context jobs, batch them. The cost per call is high enough that running them serially with retries is cheaper than running them in parallel and re-running on rate limits.
  • Run a 3-document spot-check before a 200-document bulk batch. Cheaper to fix the prompt now than re-render 200 PDFs.

From chat session to production pipeline

Claude is the engine. The pipeline around it — template, variables, integrations, renderer, audit trail — is the system. Once both are in place, the routine document work that used to fill calendars becomes a button-press, and the team time goes back to the work that actually requires a human.

The natural next step: connect Airtable or Google Sheets as the data source so Claude is filling variables from rows, not from copy-paste.

Generate your first document with Claude

Bring your own Anthropic API key, pick a template, write a prompt, and watch GJSDocs produce a polished PDF. Free trial — no credit card.

Start free