A matter folder is a heavy thing to hand an AI agent: master agreements, amendments, scanned exhibits, email exports and transcripts, often hundreds of pages. Every page is read as tokens, the session fills up, and the usage limit arrives in the middle of a review. Tokenade reduces those documents to compact text on your own computer before the agent reads them, so a review fits in fewer tokens.
This page is for lawyers, in-house counsel and legal ops teams who already work with an AI agent that runs on their computer: Claude Code (including the Code tab of Claude Desktop), Codex, Cursor and similar. Sources below were read on 2026-10-15.
What you deal with every day
Two things weigh on legal work with AI agents: the size of the documents and the duty of confidentiality. Both are well documented.
Case files are long, and pages are expensive
Anthropic's documentation says a PDF page "typically uses 1,500–3,000 tokens per page depending on content density", with an image of each page billed on top (Claude PDF support, read 2026-10-15). A data room or a set of exhibits multiplies that by hundreds of pages.
Lawyers who use Claude Code tend to work exactly this way. A guide for the profession recommends keeping the tool "scoped to a copy of the specific matter folder" (Claude for Lawyers, 2026-09-09). The agent then reads the whole folder, file after file.
The limit is shared, and it runs out mid-review
The same guide notes that Pro and Max plans come with "usage limits shared across Claude and Claude Code". Anthropic lists "file attachment size" and "current conversation length" among what uses up those limits (Usage limit best practices, updated 2026-09-22). A long contract review in Claude Code leaves less room for everything else that week.
Confidentiality is the first question, not the last
Agents change how lawyers think about client data. As one commentary in Legaltech News puts it: "Privilege and confidentiality obligations run through the attorney's conduct. AI agents disrupt that model" (law.com, 2026-10-12).
Anthropic has published its own article for legal teams on privilege, confidentiality and configuration (Claude Help Center, 2026-08-26). It ends by saying that whether a configuration meets your obligations "is a question for your own counsel". Any tool you add to the chain should make that question simpler, not harder.
What Tokenade changes for legal work
Tokenade sits between your AI agent and the files and tools it uses. It changes what the model receives, not your documents.
- Contracts and exhibits become text. When the agent opens a
.pdf,.docx,.rtfor Outlook.msgfile, Tokenade returns the extracted text instead of page images and file internals. Scanned exhibits go through OCR whentesseractis installed. - Ask for the clauses you need.
tokenade read msa.pdf --prompt "termination notice period, governing law, liability cap"returns only the passages that answer, each under its own heading, in one call (how it works). - Recordings, transcribed locally. A hearing or interview recording can be transcribed on your computer with
whisper, then read as text. - No paying twice for the same file. When the agent re-reads a contract it already saw, Tokenade spots the repeat.
- Connector results get folded. Long results from MCP connectors, for example a contract management system, are folded, and the full output stays on your computer.
On our public benchmark, Tokenade makes long agent sessions 39% cheaper. A due diligence review is a long session by nature.
What stays on your computer, and what does not
Compaction is local: the content is reduced on your computer before it is sent to your AI provider. Your documents, prompts and file names do not pass through Tokenade's servers. Tokenade sends one small usage row per compaction (token counts, which compactor ran, which agent) to meter your plan. Every field is listed in What Tokenade sends and stores.
Be precise about what this means for client data:
- Less text reaches your provider, but it is still client text. The compacted content goes to your AI provider, as it would without Tokenade. Your firm's assessment of that provider still applies.
- Credentials are masked. Tokenade masks credentials it recognises, such as API keys, tokens and private keys.
- Client names are not removed. Tokenade does not hide names of people or companies, case details or the substance of a document. Emails, phone numbers and IP addresses are masked only if you turn on
TOKENADE_REDACT_PII=1.
Tokenade makes no compliance claim on your behalf. It is one local tool in your chain, and it keeps your documents off its own servers.
Setting it up
You need an AI agent that runs on your computer. Claude Code, the Code tab of Claude Desktop, Codex and Cursor all work, and legal plugins you use inside Claude Code keep working. Claude Cowork is not supported, and in the Claude Desktop chat only MCP results are optimised (compatibility).
- Install the command line tool:
npm install -g @tokenade/cli. - Run
tokenade install. It finds your agents and connects to each one. - Run
tokenade loginto link the computer to your account (7-day free trial), then open a matter folder as usual and checktokenade gain.
Full instructions are in Install Tokenade. The price is on the pricing page.
FAQ
Does Tokenade remove client names before the text is sent?
No. Tokenade masks credentials such as API keys and tokens, and can mask emails, phone numbers and IP addresses if you enable it. It does not remove names, case details or document content. If your policy requires that, it has to be handled before the files reach the agent.
Do my documents go through Tokenade's servers?
No. Compaction runs on your computer, and only usage counts are sent to meter your plan. The text your agent works with goes to your AI provider, as it would without Tokenade.
Does it work in Claude Cowork or with Claude for Legal?
Not in Cowork, which runs in an isolated environment that local tools cannot reach. Legal plugins and skills that you run inside Claude Code are covered, because Tokenade works through Claude Code itself.
Will the agent miss a clause because the document was compacted?
Extraction keeps the wording of the document; it does not rewrite it. If a very long result is folded, the agent can get the full text back from your computer. With --prompt, only the matching passages come back, so ask for every point you need in the same call.
For other roles that work mostly with documents, see the document work overview.
Other roles in this field
Cut your AI agent's token bill.
Ranked #1 on the Token-Harness Optimizer Leaderboard. Zero config.
Tokenade cuts the token bill of AI agents: one install, zero config, and it trims what your agent sends to the model.