Uncut vs Claude Code: Fail a Cut-Off Answer?

2026-11-07
Brian

Subscribe
JOIN OUR NEWSLETTER
Be the first to know. Get fresh AI/Tech updates instantly, no spam, unsubscribe anytime

I told a small program to answer me. The stand-in model I pointed it at stopped halfway through the sentence. The program printed nothing, then quit with an error. That program is uncut. Uncut vs Claude Code is the split this page is about: a scripted agent built to stop, versus the terminal session that folds older turns so the next turn can still happen. Use uncut when a half answer inside a build job is worse than a failed job. Use Claude Code when you are still in the loop and you want the work to go on.

Short answer: Uncut vs Claude Code comes down to fail-on-cut-off versus summarize-and-continue. Uncut is a one-shot command that exits 3 when the model stops mid-answer and prints nothing. Claude Code is a session that folds older turns so the next turn can still happen. Checked against the uncut binary against a local chat server I control, November 2026.

What Uncut Actually Does

Mind map of Uncut vs Claude Code: exit 3, no partial answer, CC summarizes, four tools, CI exit codes, shell not fenced

Uncut is one file you run from the terminal. It sends your prompt to a model, may call one of four tools, and then exits.

A model here is the program that writes the next reply. Uncut does not contain a model. You point it at one. The file I ran was 6,394,018 bytes, one program, no extra runtime beside it. It speaks the same chat API that a lot of model servers already speak, including a model running on your own machine.

The four tools are the whole toolbox:

ToolWhat it is allowed to do
read_fileRead one text file, the whole file, and only if the path stays inside the folder
write_fileWrite a whole file, and create parent folders if it must
replaceChange one exact string, and fail if that string appears zero times or more than once
run_commandRun a shell command and return the exit code plus everything the command printed

There is no chat window. The last reply goes to standard output, which is the text a script can capture. If you pass -json, you also get one JSON object per line: the user text, the model reply, tool results, and errors. That stream is for a program that wants to watch the run, not for a person reading a transcript at the end of the day.

Uncut vs Claude Code: Cut-Off or Continue

Use uncut when a cut-off answer must fail the job. Use Claude Code when you want a long session to summarize and carry on.

Uncut flowchart: prompt to model; full answer exits 0, cut-off exits 3, tool call loops back

They are not two sizes of the same app. Claude Code is a session: you type, it calls tools, it can ask before a risky command, and when the conversation no longer fits it folds older turns into a shorter note so the next turn can still happen. The loop itself, including that summary step, is the thing walked through in how Claude Code works, lesson by lesson. Uncut is a command. Each turn sends the whole conversation again. It does not fold anything. If the model hits its output limit, the run is a failure.

I did the uncut side against a small local chat server I control, so I could force a cut, a file read, a bad edit, and a shell command. That server is not a real model. It only let me see what the harness does. The harness is the wrapper: it calls the model, runs the tool, and decides whether the run succeeded. I am not claiming a timed bake-off against Claude Code.

QuestionuncutClaude Code
The model stops mid-answerPrints nothing. Exit code 3Summarizes older turns and carries on
How you start itOne command, then it exitsA session you sit in, or a headless flag
File toolsFour tools. Paths must stay in the folderA larger set, with permission rules
ShellRuns as you. Not fencedCan ask first. A fence is something you turn on
Bill on a long runEvery turn resends the whole conversationA summary can keep the run from growing forever
Broken session logRefuses to startA session you can usually keep

The other direction, shrinking what the model is allowed to read so the bill drops, is a different job. RTK and Caveman cut pieces of the text on purpose. Uncut refuses that cut. If the bill is the problem, uncut will not help you. It will make a long run more expensive, because nothing is thrown away.

If the job is less about a chat session and more about a typed command that leaves a file you can open later, that split is closer to accessibility tree vs CLI wrapper than to a longer Claude Code afternoon.

How Do I Run Uncut?

Download the build for your machine from the project releases, mark that file executable, set the model, and pass the prompt as an argument.

The releases page is on the project itself: Balanov/uncut. Pick the file that matches your system. On the machine I used, this was enough to prove the file runs:

chmod +x uncut
./uncut -version

A real run needs a model name. If I left the name unset, uncut printed its help text and exited with code 2. It never called a model. The three settings are environment variables, which are values the program reads from the shell around it:

export UNCUT_BASE_URL="http://127.0.0.1:8080/v1"
export UNCUT_MODEL="the-model-id-your-server-expects"
export UNCUT_API_KEY="a-key-if-that-server-asks-for-one"
./uncut -cwd . "explain this folder in one paragraph"

UNCUT_BASE_URL is the server. The default is the public OpenAI chat address. UNCUT_MODEL is required. UNCUT_API_KEY is sent as a bearer token when you set it. I pointed the default address with a model name and no key. The server answered HTTP 401, and uncut exited with code 1. A local server that does not check a key can run with the key unset. I used one.

Flags I actually needed:

  • -cwd sets the folder for file tools and for the shell. It defaults to wherever you started.
  • -no-agents skips AGENTS.md. Without that flag, uncut pastes that file into the instructions it sends.
  • -max-steps caps how many model calls happen. The default is 32. I set it to 1 and the run stopped with exit code 4 and this line: uncut: maximum model steps reached (1); increase --max-steps to continue
  • -json writes the event stream.
  • -session keeps an append-only log so a later command can continue.
  • -max-tokens tells the server the output limit. Leave it alone unless you are testing the cut on purpose.
  • -request-timeout defaults to 10 minutes per call.

A script shape that matches the tool:

git diff | ./uncut -cwd . -no-agents "Review this diff. Do not edit files."

The text before the pipe becomes part of what the model sees. The sentence after is your prompt. If you already write the expected outcome before the agent runs, that habit is closer to whether spec-driven development is worth it than to hoping a half review still looks finished.

Why Uncut Stops on a Cut-Off Answer

It printed nothing and exited with code 3, because the model stopped mid-answer and uncut will not treat a half reply as success.

I forced that case. The local server returned a reply marked finish_reason=length, which means the model hit its output limit and the rest of the sentence was never produced. The reply text was a sentence I planted so I would notice if it leaked. In normal mode the standard output was empty. Standard error was one line:

The exit code was 3. A build script that checks the exit code will fail the job. That is the point. A half review that looks finished is how a bad change gets merged.

-json is the exception to “printed nothing.” The event stream included the cut sentence as an assistant event, then an error event with the same words, and the process still exited 3. If your script prints that stream into the job log, a person can still read the half sentence. The process did not succeed. If you need the log to contain no partial answer at all, do not pass -json, and do not scrape standard error into the place where a success message would go.

The same strictness shows up on edits. I asked for a replace of the word cat in a file that contained cat twice. The file stayed cat and cat. The tool result was:

Zero matches fail the same way. The model can try a tighter string on a later turn. It cannot “mostly” edit the file.

A file read did the quiet thing. note.txt held hello from the file plus a newline. The tool result sent that whole text back, newline included. The following reply was The first word is hello. and the process exited 0. Nothing in that read was shortened.

Does Uncut Sandbox Shell Commands?

No. A file path that leaves the folder is rejected. A shell command is not, and it runs as the same user as uncut.

I asked for a read of ../etc/passwd. The tool result was:

The file was not opened. That fence is real, and it is only on the file tools.

Then I asked for a shell command, id plus a size check of /etc/hostname. The tool result came back with exit code 0. It included uid=0(root) because that process was running as root, and it included 14 /etc/hostname. The command was allowed to look outside the project folder. On your machine it will run as you. Anything you can read or delete, the command can too. There is no approval prompt.

So the safe place for uncut is a machine, or a container, that can be thrown away. A container is a separate little system with its own view of the disk. The cage around a coding agent is a different product, and uncut will not turn that cage on for you. If the job is a diff review, say so in the prompt, and still assume a confused model can run run_command. Another headless tool has the same class of surprise: a one-shot prompt can run without the question you expected.

AGENTS.md is sent unless you opt out. I put one line in that file, RULE: never write the word banana. The next request included it under the heading Project instructions (AGENTS.md). That is useful when the rule is yours. It is a leak when the folder belongs to someone else and that file holds paths, keys, or private notes. For a CI job on a repo you do not fully trust, pass -no-agents, or read the file yourself before the run.

When Should I Skip Uncut?

Do not use uncut for a long session you plan to steer by hand, and do not use it on a laptop where a shell command could touch files you care about.

Claude Code fits the first case. You want permission prompts, a summary so the afternoon can continue, and tools beyond read, write, replace, and a shell. Uncut will stop at 32 model calls unless you raise -max-steps, and each of those calls pays for the entire history again.

Skip it, too, when the answer must be short on purpose. Uncut will not trim a giant file it just read. The next turn sends that giant file again. That is honest, and it will blow a small model’s context window, the amount of text the model can hold at once. A window that is too small ends the same way as a cut answer: the run fails, instead of quietly forgetting the middle of the file.

Uncut vs Claude Code in a Build Job

Yes, if a non-zero exit should fail the job, and if the job runs somewhere a shell command cannot hurt the rest of the machine.

Check the exit code, not the presence of text. Code 0 means the model finished an answer. Code 3 means the answer was cut and must not be trusted. Code 4 means it ran out of steps. Code 2 means the command itself was wrong, such as a missing model name. Code 1 is everything else I hit: a refused server, a bad session file, a network problem.

Keep -json off if the only text on standard output must be a finished answer. With -json, the cut sentence is still in the stream, then an error event, then exit 3. Do not search the log for a cheerful sentence and call the job green. A half sentence can contain the words you hoped to see.

Put the prompt in the job, pass -cwd as the checkout, and pass -no-agents unless you have read that file. Cap -max-steps lower than 32 while you are still learning what the model does.

I would use uncut for a review that must not invent the missing half of a thought, inside a container I can delete. I would leave Claude Code open when I am still at the keyboard and a summary is a kindness, not a lie.

Common questions about Uncut and Claude Code

How do I resume an uncut session?

Pass -session with a log file. If any line in that file is broken, uncut refuses to start.

The log is append-only. Each record is one JSON object on its own line. I fed it a file whose first line was the words not json. Uncut exited 1 and printed:

It did not skip the bad line and continue. A half-written log from a killed job will not be patched up in secret. Delete that log or fix the line, then start again. A clean log is how a second command continues the first: same -session path, a new prompt.

Does uncut need an API key?

Only if the server you point at demands one. With no key and the default public address, I got HTTP 401 and exit code 1.

A model on your own machine often wants a base URL and a model name, and no key. Set UNCUT_BASE_URL and UNCUT_MODEL. Leave UNCUT_API_KEY unset. If that local server is not running, the run fails the same way any other network error fails: exit 1, and the error text on standard error. It does not fall back to a built-in model, because there is not one.

Is uncut a smaller Claude Code?

No. Claude Code is a session that can summarize and carry on. Uncut is a command that fails a cut-off answer on purpose. Pick the one that matches whether a half reply is allowed to look finished.

JOIN OUR NEWSLETTER
Be the first to know. Get fresh AI/Tech updates instantly, no spam, unsubscribe anytime

1 comment

Leave a comment