By the end of this lesson you will read and set environment variables, know where tools like Claude Code look for settings, and fix the "command not found" error yourself.
You need: a terminal (lesson 2) · Time: 8 minutes
An environment variable is a named setting that your terminal hands to every program it starts. It is a
NAMEwith avalue, likeHOME = /home/asha.Think of the notice board at a chai stall: "Today's milk supplier: Sharma Dairy". Every worker who comes in reads the board instead of asking. Programs do the same: instead of asking you each time, they read the environment.
You'll meet three kinds:
- System ones that are always there: your home folder, your user name, and
PATH(the list of folders where programs live; more below). - Tool settings: a coding agent may read its server address and key from variables. For example, the Claude Code guide uses
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENto point Claude Code at AllModelAPI. - Project settings: your app reads its secrets from variables, usually loaded from a
.envfile (Keep secrets secret).
Why?When an install guide says "set this variable" or the AI says "the key is undefined", it is talking about this notice board. Once you know where it is, these messages make sense.
- System ones that are always there: your home folder, your user name, and
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- Read a variable
- Set one for this window only
- Make it permanent
- PATH and "command not found"
- Recap