Claude Code fix: A turn ends with Claude exited code 143

Claude Code exited with code 143

This is a shell convention rather than a Claude Code message. An exit status above 128 means the process was signalled, and 143 is the polite one.

Claude exited (code
Printed by Termdeck.

Diagnosis

What it actually is

143 is 128 plus 15, which is SIGTERM

The process was asked to stop and it stopped. Anything that ends a turn deliberately sends this: a stop button, a takeover releasing the session, a supervisor reaping children when its connection closes, a machine suspending, or a service restart.

137 is the same arithmetic with SIGKILL

That one is 128 plus 9, and it can be neither caught nor cleaned up after. It is either an escalation after a SIGTERM went ignored, or the kernel out-of-memory killer, and on a small machine the second is worth ruling out.

The code is the fallback, not the diagnosis

A turn that fails with a real error carries the error. An exit code is reported only when the process ended without saying anything, so this line means nothing more specific was available.

Check

Confirm it before you fix it

Run thisWhat a good answer looks like
dmesg -T | grep -i -m5 oomOn Linux, whether the kernel killed something for memory. It may need sudo. An out-of-memory kill is recorded here and nowhere the CLI can see it, which is what makes a 137 look mysterious.
echo $?Run straight after the command in the same shell, this prints its exit status. The same arithmetic applies to every process, not just this one.

Every command here has been run on a real machine. Termdeck answers the same questions for every machine you have connected, without opening a terminal on any of them.

Fix

Cheapest thing first

1. Treat 143 after a deliberate stop as normal

If you or anything else stopped the turn, whatever it had written is on disk and there is nothing to repair. This is the expected ending rather than a failure.

2. Watch memory if 137 repeats

A 137 on the same prompt twice is a memory ceiling rather than a bug in the turn. A smaller working set, or a machine with more room, is the fix.

3. Look above it for the real error

Where the code appears on a turn nobody stopped, the useful line is whatever came before it. The exit status is only the last thing that happened.

Not this

What will not help

Searching 143 as a Claude Code error code

It is not one. The number is the shell convention for a signalled process, so searching it as a product error returns answers about entirely unrelated software.

FAQ

A turn ends with Claude exited code 143, answered

Is exit code 143 a crash?

No. It means something asked the process to stop and it did. A crash usually carries a message of its own.

What is the difference between 143 and 137?

The signal. 143 is a request to terminate, which a process can act on. 137 is a kill it cannot refuse, often the out-of-memory killer.

Do I lose the work when a turn ends this way?

Whatever the turn already wrote to disk stays. What is lost is only what it had not finished.