Exit code
A number that a script returns at the end to say how it went: 0 means “everything is fine”, 2 means (in hooks) “stop the action”.
How it appears in the course
The script answers with a number (the exit code): 0 means “everything is fine”, 2 means “stop”.
Every program returns a number when it finishes. That’s the exit code. It’s the program’s way of saying “everything is fine” or “stop”.
If the file name contains one of them, it writes a message on stderr (>&2) and exits with exit 2. That means “stop”. Claude gets the message and understands why it isn’t allowed.
Where you learn it
In module 07 · Hooks: automatic actions, in the Claude Code for Beginners course.
Related terms
Learn Claude Code from zero, in plain English
12 modules with 1–2 minute lessons, which you can also do on your phone. The first two modules are free.