Starbase / 02 RecipeAgents

RecipeAgents / Recipes / Ops

Ops recipe

Summarize a contract PDF with Claude

A supplier or client sends a 20-page contract and you need to know what you're agreeing to. Drop the PDF in a Google Drive folder and Claude emails you a plain-English summary: price, term, renewal and notice period, how to get out, liability, and the clauses worth a second look, each with its clause number so you can check it.

InputContract PDF saved to a Google Drive folder
ToolsGoogle Drive, n8n (or Zapier or Make), Anthropic API (Claude Sonnet 5.5), Gmail
TimeSetup about 40 minutes (our estimate).
CostClaude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokens. Claude Haiku 5.5 costs $0.10/$0.50 for prompts up to 100k tokens, and $0.50/$2.50 above that (Anthropic pricing, read 2026-10-24). Anthropic's PDF docs put text at 1,500 to 3,000 tokens per page, plus image tokens, because each page is also sent as an image. Our arithmetic: a 20-page contract at 3,000 text tokens per page is 60,000 tokens, about $0.12 of input on Sonnet 5.5 before the page images, and a 2,000-token summary adds $0.02. New accounts get a small free credit; there is no ongoing free tier.

Download it

The n8n file has four nodes (Drive trigger, Drive download, Claude, Gmail) plus a read-me note. We check that its JSON structure is valid, but we haven't run every file in a live n8n instance, so test it with sample data before you switch it on. All 23 files, the logins each needs and how to fix common import errors are on our n8n templates page.

Steps

  1. Create an Anthropic API key in the Claude Console: Settings → API Keys → + Create Key. In n8n, add it as an Anthropic credential.
  2. Trigger: Google Drive Trigger on a folder such as contracts-to-read, event File Created.
  3. Google Drive → Download File, with the file ID from the trigger, so the PDF arrives as binary data.
  4. Anthropic node → Text → Message a Model, model claude-sonnet-5-5. Turn on Add Attachments, choose Binary File(s), field name data. Paste the prompt below. Under Options, turn on Include Merged Response and set Maximum Number of Tokens to 4000.
  5. Gmail → Send a message to yourself, with merged_response as the body and the file name in the subject.
  6. For the first few contracts, read the summary next to the PDF and check every quoted clause. It's a reading aid, not legal advice.

The prompt

You are helping someone who isn't a lawyer read a contract before signing. Read the attached PDF and write a plain-English summary under these headings:
Parties and what is being bought
Price and payment terms
Term, renewal and notice period
How either side can end it
Liability, indemnity and caps
Unusual or one-sided clauses
Questions to ask before signing
Under each heading, quote the key words and give the clause number, like (cl. 11.2). If the contract doesn't cover something, write 'Not stated'. Don't give legal advice and don't say whether to sign. Plain text, no tables.

Sample run

Example input (written for illustration)
A 14-page software services agreement (PDF) with monthly fees in clause 6 and auto-renewal in clause 11.2. Invented for illustration.
Example output (shows the format, not a real log)
Price and payment terms
€1,200 a month, invoiced monthly, payable within 30 days (cl. 6.1: "…within thirty (30) days of the invoice date").

Term, renewal and notice period
12 months from signature. Renews for another 12 months unless either side gives notice at least 90 days before the end date (cl. 11.2: "…shall automatically renew…").

Liability, indemnity and caps
Supplier's liability capped at fees paid in the previous 3 months (cl. 14.1).

Questions to ask before signing
- Can the notice period drop from 90 to 30 days?
- Is the 3-month liability cap negotiable?
SPONSOR SLOT · AVAILABLEFeature your product here

Where it breaks

  • Summary stops mid-sentence. n8n's Anthropic node sends a 1,024-token output cap unless you set Maximum Number of Tokens (n8n source, read 2026-10-24). A full summary can need more, and the answer just stops. Set 4,000 or more, and check that each email ends with the Questions section.
  • PDF too big or locked. Anthropic's limits are 32 MB per request and 600 pages (100 pages for models with a context window under 1M tokens). Password-protected or encrypted PDFs aren't supported. For long contracts, send the main agreement without the schedules.
  • Scanned contracts. Claude reads each page as an image as well as text, so a scanned PDF can still work. Handwritten changes and stamps are where misreads are most likely, so check every date and amount against the page.
  • Costs higher than older tutorials suggest. Anthropic says the tokenizer used by its newest models produces about 30% more tokens for the same text, so per-page token figures in older posts run low. Look at the token usage on the first few runs before you estimate a monthly bill.
  • Haiku's lower rate has a ceiling. Haiku 5.5's $0.10 input rate applies only to prompts up to 100k tokens. A 40-page contract at Anthropic's per-page estimate can pass that before the page images are even counted, and then the rate is $0.50.
  • It reads, it doesn't advise. The prompt asks for clause numbers and quotes so you can check every point. Use the summary to read faster and to prepare questions, not to decide whether to sign.
  • Confidential documents. Contracts often limit who you can share them with. Check the contract's confidentiality clause and Anthropic's commercial terms before sending client documents to any AI API.
  • Anything customer-facing or money-related. Keep a human approval step until you've watched a few dozen runs and trust it.

Use Gemini instead

  • Gemini in n8n: replace the Anthropic node with Google Gemini → Document → Analyze Document, input type binary, field data, and map the text it returns into the email. If you add Maximum Number of Tokens under its Options, n8n starts it at 300, which is short for a full summary, so raise it. Gemini 3.8 Flash costs $0.75 per million input tokens and $3.75 per million output tokens until Dec 31, 2026, then $1.50/$7.50 (Google pricing, last updated 2026-10-22, read 2026-10-24). It has a free tier, but Google uses free-tier content to improve its products, so use a project with billing linked for contracts.
  • Zapier and Make: Google Drive (New File in Folder in Zapier, Watch Files in a Folder in Make) → Anthropic (Claude): Send Message in Zapier or Anthropic Claude: Create a Prompt in Make → Gmail. Check that your Claude step accepts the PDF file itself. If it only takes text, add a PDF-to-text step first, and scanned pages will come through empty.

Tool names and pricing change often, so check each tool's current docs before you build. Times on this page are estimates, not measurements.

More ops recipes

All collections · Full inbox-triage walkthrough

New to building agents? Plan this one first with the free agent planner on PlainAgent, our sister site with plain-English guides. Not sure which AI model to use? See the writing and chat assistant ranking on TaskRank.

Newsletter

One small automation every Friday

Each Friday email has one recipe, the prompt for it, and the way it broke when we wrote it up. It's free, and every email has an unsubscribe link.