Tortuga
Subscribe
Building Apps

Claude Code Truncation: Our Open-Source Fix

Claude Code silently truncates MCP outputs past ten lines. Here's the fix we built, why markdown tables are the answer, and why we're giving it away.

By Josh GrenonUpdated October 30, 2026

How we fixed Claude's truncation problem: a craftsman's hands driving a caulking iron into a ship's hull seam

The first time I noticed the problem, I assumed I’d done something wrong.

I was building the Quartermaster MCP (the part that lets the tool live inside Claude Code and respond to commands from the terminal). I ran a query. Claude returned the data. And then it just… stopped. Cut off mid-table, somewhere around line twelve, with no indication that anything was missing. The output looked complete. It wasn’t.

I ran it again. Same result. Tried a different query. Same place, same cut. It wasn’t my code. It was Claude truncating long outputs at what appeared to be an arbitrary line count.

This is a known problem. Claude, Cursor, most of the AI-native IDEs: they all have some variation of it. When a tool returns more than roughly ten lines of output, the display layer starts making decisions about what to show. Sometimes it collapses the rest. Sometimes it just doesn’t render it. The model sees the full response; the developer doesn’t. For a productivity tool where the whole point is surfacing information in the terminal, this is a real problem.

What we tried first

The instinct was to fight the formatting. If tables weren’t rendering, maybe something else would. We tried ASCII art. Pipe characters. Progress bars built from dashes and brackets. The classic three-dot vertical progress bar looked right in theory (clean, familiar, universally understood), but Claude Code’s output panel just doesn’t render it. You get the raw characters instead of anything resembling a UI element. None of it held up across environments. A layout that looked clean in Claude would break in Cursor. Something that rendered in one IDE became noise in another.

The issue was that we were treating formatting as decoration when it’s actually infrastructure. The output format isn’t separate from the tool. It’s part of how the tool communicates. Getting it wrong means the tool fails, even if the underlying logic is perfect.

The fix that actually worked

Markdown table syntax. That was it.

Not because it’s elegant. Because it’s a format these environments already know how to parse. Bold, headers, rows: the standard stuff. When the IDE sees a markdown table, it renders it as structured content instead of raw text, and the truncation behavior changes. We’re not sure it’s a deliberate design decision on the IDE side or a happy accident, but the result is consistent: outputs that used to cut off at line ten or eleven now display fully.

The output format isn’t separate from the tool. It’s part of how the tool communicates.

We also added what we’re calling AI hints: two layers of metadata that signal to the model how to handle the output. The first is a hidden markdown comment embedded in every response: it tells the AI client to render the content as-is, not summarize or paraphrase it or wrap it in a code block. The second operates at the server level, embedded in the MCP server constructor so it persists across every tool call, telling Claude to always render results verbatim instead of summarizing. Formatting alone solves the truncation problem. The hints solve the interpretation problem: the tendency for the model to collapse a table into a sentence or restate what the tool just said in its own words. Both problems look the same to the developer: you asked for data and got something else.

Once we had something that worked reliably, we extracted it into a standalone library: mcp-fmt. The idea is simple: when you’re building an MCP, you import this and apply consistent styling to all your outputs. No more trial-and-error per IDE, no more format-it-yourself every time. We tested across Claude and Cursor. It holds up.

Why we’re open sourcing it

We can’t monetize a formatting library. That’s just honest. Nobody is going to pay a subscription for a table formatter.

But that’s not the whole calculation. We’re building at the edge of what AI-native tooling looks like: what it means for a tool to live inside an IDE, respond in the terminal, feel like a real interface rather than a text dump. That’s genuinely new territory, and working through it means building a lot of infrastructure that doesn’t have a direct revenue model.

The Supabase comparison is one I keep coming back to. Their open-source database layer isn’t the thing they charge for, but it’s the thing that makes everyone know who they are and trust what they ship. Giving away the layer that creates distribution and credibility isn’t charity. It’s strategy.

For us, there’s a practical version of that. Every MCP developer who uses this library is someone who now has a consistent experience with how Tortuga thinks about terminal interfaces. When they see “Tortuga MCP format” in their IDE, that’s a signal about quality and about who built it. The initial audience is anyone building MCP tooling: a small but fast-growing group right now, mostly engineers who’ve already hit this exact problem and assumed it was their fault.

The thing that still bugs me

The truncation problem shouldn’t exist. These are professional tools built for developers, and they silently drop output without warning. The model sees the full response. The developer doesn’t. That’s a failure mode that looks like normal behavior, which is the worst kind.

I don’t think the fix we built is the permanent answer. It’s a workaround for a gap that the IDEs should close themselves. We built this specifically for Claude Code. That’s where we work, and that’s where the problem was costing us time. But it turns out the pattern is wider than that. OpenAI Codex has an open issue requesting token-based limits instead of arbitrary line counts, Grafana’s MCP server has a reported bug for silently dropping log results with no indication data was omitted, and Claude Code has its own tracked issue where responses get cut to roughly 700 characters. The markdown table approach holds up across Claude and Cursor. It may well work in other environments too, though we haven’t tested everything. What I do think is that this pattern (building in the open to fill gaps the incumbents haven’t addressed yet) is the right posture for a small team right now. You can’t wait for the platform to fix it. You build the fix and you share it, and the sharing is part of the point.

The next few MCPs we ship will use the same library. So will whatever comes after that. Eventually, if we do this right, the terminal stops feeling like a place where information goes to get truncated, and starts feeling like a real interface. That’s the bet we’re making.

Frequently asked questions

Why does Claude Code cut off MCP tool output?

Two different limits cause it. The terminal display can collapse long plain-text tool output after about ten lines, so you see only part of the result while Claude still receives all of it. Separately, Claude Code caps MCP tool results at 25,000 tokens by default to protect the context window. The display problem needs better formatting. The token cap needs a setting change or smaller results.

What is the MCP output token limit in Claude Code?

Claude Code shows a warning when any MCP tool output passes 10,000 tokens, and the default maximum is 25,000 tokens. A successful text result over the maximum is saved to a file in the session's tool-results directory, and Claude gets the file path in place of the full text. Text results longer than 50,000 characters are saved to a file the same way, whatever their token count. Claude Code docs on MCP output limits

How do I raise MAX_MCP_OUTPUT_TOKENS?

Set it in your shell before you start Claude Code, for example export MAX_MCP_OUTPUT_TOKENS=50000 and then run claude. The 10,000-token warning threshold stays fixed, and the variable does not change the 50,000 character threshold for text results. If you build the MCP server, a tool can set _meta["anthropic/maxResultSizeChars"] in its tools/list entry to raise its own text limit, up to 500,000 characters.

Will raising the token limit fix output that stops after ten lines?

No. The token limit controls how much of a result Claude gets inline. The ten-line cutoff is how the terminal displays long plain-text output. What fixed it for us was returning markdown tables, which Claude Code renders as structured content and shows in full.

What is mcp-fmt?

mcp-fmt is Tortuga's free, open-source (MIT) TypeScript library for formatting MCP tool results as markdown that Claude Code's terminal renders: tables, lists, headers, key-value tables and status badges. Install it with npm install mcp-fmt. We tested the output in Claude Code and Cursor. mcp-fmt on GitHub

Is this only a Claude Code problem?

No. OpenAI Codex has a GitHub issue asking for token-based output limits instead of line counts, and Grafana's MCP server has a bug report about dropping log results without saying data was left out. The markdown table approach holds up in Claude Code and Cursor. We have not tested every environment.

Share this article

Related articles

Good enough design when building with AI

March 01, 2026

Good enough design when building with AI

You've been letting go of your designs your entire career. The difference now is you can finally own what ships.

You Need Influence, Not Influencers

March 02, 2026

You Need Influence, Not Influencers

We built an AI actor that hit 1M views in a month, then we built the tool that makes them.

Subscribe. Stay sharp. Ship more.

A weekly newsletter on AI tools, shipping, and traction, plus every new open source skill and project we release. No pitch, no paywall.

Subscribe free