METAL for iPhone

Read AI news in the METAL app.

Download METAL and discover fresh AI stories every day.

Download on the App Store

For iPhone · Free download

Search for METAL AI Magazine in the App Store on your iPhone.

METAL

AI GlossaryㅈWords from the people who build

exit code

A numeric signal a program leaves behind when it finishes running, showing whether the job succeeded or where it got stuck

In plain words

An exit code is a single number that a program or script leaves behind when it finishes running, telling you whether the job wrapped up fine or ran into trouble along the way. Think of it like the stamp a delivery driver leaves after a drop-off: one stamp means delivered successfully, another means wrong address, another means the recipient refused it. Just by looking at the number, you can guess what happened behind the scenes.

These days, this number matters even more in tools where AI writes and runs code on its own. Instead of a person checking the screen every time, a system can look at the exit code a program leaves and automatically decide what to do next. If the number means success, it just moves on to the next step; if it means failure, it stops, retries, or alerts a person.

That said, the numbers themselves don't carry one fixed, universal meaning — the same number can be interpreted differently depending on the tool you're using. So it's worth knowing how each tool defines these numbers.

How it shows up in the news

The article introduces a table of exit codes left by Claude Code's checkpoint mechanism, distinguishing 0 as success, 1 as something that looks like an error but doesn't block execution, and 2 as something that blocks execution entirely. It's easy to assume that "anything nonzero means blocked," but the key point is that 1 and 2 look similarly like errors on the surface while behaving in completely different ways.

Try it yourself

Open a terminal and run one command that will succeed, followed by one command with an intentional typo. Right after each command, type echo $? to see the exit code number that run left behind. You'll typically see 0 after the successful command and a nonzero number after the failed one.

See also

Stories using this term

Browse every entry