Index Ai Academy
Glossary · Phase 7 · Software engineering

Exit code

Also written: exit codes, exit status

The number a program hands back when it ends: 0 for success, anything else for a kind of failure.

A referee's whistle tells everyone what happened without a speech. Every program that ends hands back a number, its exit code. 0 means success and anything else means failure. Shells, scripts and CI read it: tasks done 9 && echo ok prints "ok" only if the command succeeded. Agents read it too, to learn whether a tool call worked.

Try it now

Follow these rules and your tool works with every other command-line program.

Learn it properly

Capstone: a command-line app · Design, build and test a complete program with a database. About 45 minutes.

Create a free account See what's in the lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write