Free learning / 55-minute terminal lab
Your first command: know what will run
Separate the terminal, shell, CLI and coding agent. Run a real local helper and inspect how arguments, folders and output channels change its result.
No account needed. Use your own copy for writing and keep the original as a reference.
Engineering lab library / Run locally
Understand the command before the agent.
Run one local helper in two folders. Read its actual report, diagnostic and exit code before deciding whether it answered the task.
Synthetic records. No provider key or model inference. Runs locally with the standard library.
Start here / Node.js 24 · Offline exercise
First command and working directory
Run five actual process cases and explain the report, diagnostics and exit code.
Node.js 24 · Standard library · No model or account
A colleague asks you to inspect one ticket from North workshop. You will use a small command-line program, then deliberately run it in the wrong folder. The point is to understand what the command actually did before accepting an agent's explanation or a green process result.
This original exercise takes about 40 minutes, plus an optional 15-minute executable-lookup extension for macOS/Linux. It uses Node.js 24 and fictional files. There is no model, provider account, package installation or customer service. The guided prediction workbench is in the protected Academy lesson. The visual explanation, runnable exercise and all instructions here are free.
1. Separate the window from the program
A terminal displays text and delivers your keystrokes. A shell interprets command lines and starts programs. Bash, zsh and PowerShell are shells, with differences in syntax. A command-line interface (CLI) is the operations and options a program accepts through text arguments.
Node.js is a runtime: it executes JavaScript outside the browser. Our .mjs file is the program it runs. A coding agent is a separate application that may use a model to propose commands and inspect results. An ordinary terminal command does not automatically involve an agent.
You type in the terminal
|
v
The shell interprets the command
|
v
Node.js runs the JavaScript helper
|
+--> stdout: the report
+--> stderr: the note or diagnostic
+--> exit code: the process resultThink of a function call with an operation and inputs. The analogy has a limit: a command also has a working directory, an environment and system permissions. Those details matter when an FDE works across customer systems.
UNDERSTAND THE SYSTEM
A successful process can answer the wrong task.
Compare five actual local child-process results. Each frame is a separate invocation over fictional files. The runner supplies argument strings directly with shell: false; no shell parser or coding agent ran. The task comparison and next steps are teaching interpretations of the retained outputs.
Watch one example, step by step.
Read the full worked example
- 01The intended folder
The helper reads North's fixture and returns one ticket, N-1. Its stderr note identifies training data. Exit 0 and the North report agree with the requested local task; they say nothing about a real customer system.
NORTH · RECORDED: North workshop · 1 ticket · exit 0
- 02The neighboring folder
Only the working directory changes. The same arguments read South's file, return S-1 and exit 0. The process succeeded; the North task remains unanswered. Check the intended folder before repeating inspect.
SOUTH · RECORDED: South workshop · 1 ticket · exit 0
- 03A missing file
The arguments are accepted, but missing.json cannot be read. Stdout is empty and the helper returns an input diagnostic with exit 2. This establishes a failed read, not an empty ticket list. Inspect the supplied path and working directory.
MISSING · RECORDED: Empty stdout · input diagnostic · exit 2
- 04An unknown option
The misspelled --limti option is rejected before any fixture is read. Its usage diagnostic and exit 2 identify a command-contract problem. Correct the option name; changing a data file would not repair this boundary.
OPTION · RECORDED: Empty stdout · usage diagnostic · exit 2
- 05A value outside the contract
--limit is recognized, but 0 is outside the helper's permitted range of 1–3. Validation refuses it before file reading. Preserve that distinction from a missing file; they share a code but fail at different stages.
LIMIT · RECORDED: Empty stdout · usage diagnostic · exit 2
Read the connections in plain English
- 01Launch request → CLI helper
Launch the selected executable with argument strings and an explicit working directory.
- 02CLI helper → Process result
Observe output channels and process termination without collapsing them into one success flag.
- 03Process result → Compare evidence
Use the actual report or refusal; an empty report is not evidence of an empty project.
- 04Requested task → Compare evidence
Check the result against the unchanged North task.
- 05Compare evidence → Command note
Keep the observation and the proposed next check distinct.
Check your understanding: Why can compare finish successfully while three recorded children exit 2?
The runner's job is to collect expected cases, including refusals. Its own status describes that collection, not the status of every child or completion of the North task. Inspect each child's channels and exit code, then compare its actual evidence with the requested work.
2. Prepare the small local workshop
Download First command · Node.js into a new folder. Open your terminal in that folder. Check your runtime and run the reproducible comparisons:
node --version
node fde-first-command.mjs test
node fde-first-command.mjs compare
node fde-first-command.mjs initUse Node.js 24. Eight checks exercise actual child processes, folder-dependent reads, argument handling, diagnostics, bounded input and preservation of an existing workshop. compare prints five cases from temporary synthetic files and removes only its own temporary directory.
init creates this new folder beside your download:
fde-first-command.mjs
cli-workshop/
north/
project brief.json → North workshop, tickets N-1 and N-2
south/
project brief.json → South workshop, tickets S-1 and S-2If cli-workshop already exists, init refuses to overwrite it. Keep your work and use a different parent folder if you need a fresh workshop. inspect reads its chosen file; it does not edit it. Installing Node itself may need internet access; the exercise uses the installed standard library and makes no network requests.
3. Read the command before pressing Enter
In Bash, zsh or PowerShell:
cd cli-workshop/north
node ../../fde-first-command.mjs inspect --file "project brief.json" --limit 1In Windows Command Prompt:
cd cli-workshop\north
node ..\..\fde-first-command.mjs inspect --file "project brief.json" --limit 1| Piece | What it does here |
|---|---|
node | Runs the JavaScript runtime |
../../fde-first-command.mjs | Names the script two folders above the current location |
inspect | Selects the helper's operation |
--file | Names an option |
"project brief.json" | Groups a filename with a space into one argument |
--limit 1 | Supplies an option and its value |
The grouping quotes are not part of the filename. The helper receives the filename as one string. Its --limit value also arrives as text; the helper checks that it is from 1 to 3 before converting it to a number.
The comparison runner passes argument arrays to a fixed Node executable with shell: false. It records actual process outputs, but it does not exercise a shell parser, PATH lookup or a coding agent. The displayed commands are the equivalent commands for a learner to type.
In an ordinary shell, PATH helps locate executable names such as node. Built-in commands such as cd may be handled by the shell itself. Use the installed shell's help for its exact rules. Do not treat every tool's flags as interchangeable.
The launch has more inputs than the visible line
| Input | This runner | Why an engineer records it |
|---|---|---|
| Executable | process.execPath, the current Node executable's absolute path | A name alone does not identify which installation ran |
| Arguments | Script path, inspect, then separate option/value strings | Grouping characters from a shell are not additional filename characters |
| Working directory | The selected North or South folder | Relative file paths start here, not beside the script |
| Environment | Parent environment, with NODE_OPTIONS cleared | Configuration can change a child without changing its arguments |
| Permissions | The process's available operating-system permissions | Launching does not create a sandbox or grant new permission |
Node's full process.argv starts with its executable and the script path. The helper parses the remaining strings. For direct argument arrays, supply "project brief.json" as a JavaScript string whose value is the filename; do not add literal quote characters inside that value. In a typed shell command, the quotes have a different job: they group the spaced filename. Bash double quotes still permit variable and command substitution. They are not a general way to neutralize arbitrary input.
An environment variable is a named string value available to a process. Record the relevant configuration names and a safe version or source reference; do not paste credentials or a full environment dump into a command note. These recordings do not vary the environment or test PATH lookup.
shell: false means this launch does not ask a shell to interpret a command string. It does not prevent the selected program from interpreting its own arguments, reading files or making other permitted changes. Likewise, cwd is a starting location, not directory confinement: this helper accepts an explicitly supplied path. Its small-file and schema checks are different from an authorization policy.
4. Follow the working directory
The current working directory is the folder from which relative file paths start. It is not necessarily the folder containing the script.
After the North command, move to the neighboring folder and repeat it. In Bash, zsh or PowerShell:
cd ../south
node ../../fde-first-command.mjs inspect --file "project brief.json" --limit 1In Windows Command Prompt:
cd ..\south
node ..\..\fde-first-command.mjs inspect --file "project brief.json" --limit 1The arguments are unchanged. The report now names South workshop because that is where the relative filename was read. Both runs can exit 0. Only the North result answers the original task.
Change --limit 1 to --limit 2 and predict the ticket count. Then change it to --limit 0: the helper should refuse that value. Change one input at a time so the observation has a clear cause.
5. Inspect three separate results
stdout, standard output, contains this helper's JSON report. stderr, standard error, contains its note or diagnostic. The exit code is a separate numeric result when the program finishes.
| Case | stdout | stderr | Exit code |
|---|---|---|---|
| North folder, ordinary arguments | North report | Training-fixture note | 0 |
| South folder, same arguments | South report | Training-fixture note | 0 |
| Missing filename | Empty | Input diagnostic | 2 |
Misspelled --limti | Empty | Usage diagnostic | 2 |
| Limit outside 1–3 | Empty | Usage diagnostic | 2 |
A terminal may show both channels together. Text on stderr does not necessarily mean failure: the ordinary run writes an explanatory note there. This program defines 0 as completion and 2 as refused arguments or input. Other programs define their own nonzero results.
Check status immediately after the command, using the syntax for your shell:
# Bash or zsh
echo $?# PowerShell: after a native executable such as node
$LASTEXITCODEREM Windows Command Prompt
echo %ERRORLEVEL%A later command can change the saved status. Do not type all three variants; choose the one for the shell you are using.
Try the refusal from either workshop folder:
node ../../fde-first-command.mjs inspect --file missing.json --limit 1Use ..\..\fde-first-command.mjs in Command Prompt. Expect an empty report, an input diagnostic and exit code 2. The helper limits input to 8 KiB and does not include supplied file contents or raw exception paths in diagnostics. Its JSON report is local output from the file you explicitly selected.
The failure stage matters even when the code is the same. --limti is an unknown option; --limit 0 is a recognized option with a refused value. Both stop before file reading. missing.json passes argument validation but fails at reading. No report is different from a report with no tickets. The compare runner can complete its own collection while correctly retaining three children with exit code 2.
A process can fail to launch, terminate by signal or provide no numeric status. The supplied runner rejects those incomplete observations instead of assigning a made-up exit code. Its timeout sends a termination signal; a synchronous launch can still wait for termination. The five retained cases do not exercise these states. Cancellation does not prove that earlier effects were undone, or even that every descendant process has stopped.
5a. Observe which executable runs
PATH supplies the directories searched for an executable name. cwd is the working directory. They answer different questions: which program runs, and where that program starts resolving relative paths. The five original comparisons used a fixed absolute Node path; now isolate executable lookup itself.
This optional extension requires macOS or Linux with /bin/sh and Node.js 24. The original helper and Windows instructions above remain usable on Windows; lookup reports unsupported there rather than manufacturing observations. Run this from the folder containing the downloaded file:
node fde-first-command.mjs lookupThe script creates a new temporary workshop. Two directories contain different executable files with the same harmless name, lockedin-training-lookup. Each prints one fixed JSON marker. All launches share the same arguments and working directory. Only the child environment gets these owned search directories; your shell configuration, installed commands and parent PATH are unchanged. The script removes its own workshop afterwards.
Predict each result before reading the report:
| Case | Supplied executable and search order | Observed marker | Child exit |
|---|---|---|---|
named-configured-order | Name; primary then alternate | primary | 0 |
named-reversed-order | Same name; alternate then primary | alternate | 0 |
absolute-primary | Primary file's absolute path; alternate still first | primary | 0 |
missing-command | Name; only an empty owned directory | None; launch error ENOENT | null |
The first two results differ even though the command name, arguments and folder are identical. Both directories contain executable files. The search order selects which one runs. The explicit path selects the primary file directly; it does not search PATH for that command. The report replaces actual temporary path prefixes with lookup-workshop labels so observations can be shared without machine-specific paths.
Inspect requestedCommand, searchOrder, args and cwd, then the actual stdout, stderr, parsed marker, exitCode, signal and error. In the last case, Node reports ENOENT and there is no child exit status. That is different from inspect starting successfully and returning exit 2 because its input file could not be read. Empty output does not mean success. In other programs ENOENT can describe a missing working directory, interpreter or file; this fixture deliberately controls those inputs to isolate lookup.
A direct launch can still run a script
Every launch uses shell: false. That prevents Node from treating the supplied command and arguments as a shell command line. The selected helper files are nevertheless scripts: their #!/bin/sh line chooses an interpreter, and its builtin printf emits the marker. No installed command is searched through your real PATH. Avoiding shell command-line interpretation does not guarantee the selected executable's identity, trustworthiness or permissions.
A fixed executable path helps select a particular file in this experiment. It does not prove who can replace that file, which version it contains or what its dependencies do. A marker printed by the program is an observation, not a signature or independent proof of software provenance. Carry the selection, version and permitted effects into the receiving team's command contract.
Change only the search order
Preserve the original. In a separate copy change:
const LOOKUP_ORDER = ["primary", "alternate"];to:
const LOOKUP_ORDER = ["alternate", "primary"];Run lookup in that copy and predict which results move. The first two named cases exchange markers. absolute-primary remains primary and missing-command still has no child exit. Keep both reports and explain why changing a program search path is different from moving between the North and South data folders. The diagram shows the original order; your changed copy produces its own results.
UNDERSTAND THE SYSTEM
One command name can launch different programs
Follow four real process launches from the optional Terminal 101 lookup experiment. The arguments and working directory stay fixed. This browser replays the supplied observations; run the download on macOS or Linux to collect your own. The helper scripts are disposable fictional programs.
Watch one example, step by step.
Read the full worked example
- 01Search primary first
The named command searches primary before alternate. Both contain a matching executable, but the primary helper runs and prints its marker. It exits 0. No data file or working directory changed.
NAMED COMMAND: primary · exit 0
- 02Reverse the search order
The same name, arguments and working directory now use alternate before primary. The alternate helper prints a different marker and exits 0. Both successful commands did what their launch inputs selected.
REVERSED PATH: alternate · exit 0
- 03Name the file explicitly
The runner supplies the primary helper's absolute path while alternate remains first in PATH. That command uses the specified file rather than searching for a name. The primary marker returns with exit 0. A fixed path alone does not establish who may replace the file or whether its code is trustworthy.
ABSOLUTE PATH: primary · exit 0
- 04Find no executable
The named command searches only an empty directory created by the lab. Node reports ENOENT, the marker is absent and status is null. This is a launch failure, unlike the original inspect helper starting and returning exit 2. In other contexts ENOENT can have other causes; this controlled fixture isolates command lookup.
LAUNCH ERROR: ENOENT · no child exit
Read the connections in plain English
- 01Requested command → Resolution rule
Interpret the requested name or explicit path with this invocation's environment.
- 02Resolution rule → Executable file
Observe which matching file can execute, or why none can be launched.
- 03Executable file → Observed result
Capture the actual output and termination state; a launch error is not an invented child exit.
Check your understanding: Does shell: false guarantee that the command name selects a trusted executable?
No. The two named launches both use shell: false but select different files when PATH order changes. Verify the intended executable, version and permissions in the receiving environment. The lab demonstrates selection and observed output, not software provenance or a sandbox.
6. Explain what a successful command does not prove
The South run is a successful process and an unsuccessful answer to the North task. Keep both facts. A model summarizing the output cannot change which folder the process used.
Before approving an agent's proposed command, identify the executable, working directory, arguments and expected effects. Afterwards inspect the actual report, diagnostic and process result. inspect reads the selected file; init creates a workshop; compare and test create and remove their own temporary fixtures. These operations establish no permission to run a command in a customer environment and measure no agent behavior.
Keep a short command note:
- What task was requested?
- Which program and operation ran, and in which folder?
- What arguments and effects were expected?
- What appeared on stdout and stderr, and what was the exit code?
- Did that observation answer the intended task?
For a transfer exercise, imagine an agent reports that tests passed but the command ran in a neighboring checkout. Preserve that output, identify the intended checkout and test command, and obtain evidence from the right place.
Design a command acceptance contract
This is an authored engineering exercise, not an additional recorded case. A coding agent proposes a test command in a repository. Write the receiving contract before accepting its result:
| Before launch | After launch |
|---|---|
| Requested task and exact intended checkout | Observed working directory and repository identity |
| Trusted executable and version, operation and argument strings | Actual launched program and arguments |
| Selected environment and permission boundary | Relevant configuration identity, without secret values |
| Permitted reads, writes and network effects | Observed effects, plus anything still unknown |
| Output limits and execution/cancellation policy | Separate stdout, stderr, numeric status or incomplete state |
| Evidence required to accept the task | Requirement covered, evidence retained, unresolved limitation |
Challenge your contract with three changes:
- Wrong checkout, green result. The process returned 0 from the neighboring repository. Keep that observation; it does not prove the intended change. Verify the requested checkout and rerun the relevant command there.
- Successful formatter, failed producer. Assume a synchronous Bash pipeline's producer exits 2 and its final formatter exits 0. Bash's default pipeline status is 0; with
pipefailit is 2.pipefailselects the rightmost nonzero status, not necessarily the first failure in time. Diagnose the individual commands as well. This describes Bash semantics, not every shell, and the supplied runner contains no such pipeline. - Timed-out write, unknown effect. A hypothetical deployment command reaches its timeout. The missing successful response does not prove that nothing changed. Inspect the target's state and establish replay safety before retrying. A termination request is not rollback. Our local helper does not deploy anything or demonstrate recovery of a remote operation.
For a short interview rehearsal, explain the five pieces of the launch without using the word “terminal” for all of them. Then diagnose one refusal from its actual stage, and defend the evidence you would need before accepting the task. If your explanation depends only on an exit code, revisit the South result.
Continue with repository orientation in the Claude Code course. It uses the existing offline ticket-triage project and a real failing test.
Primary references and further learning
Process and Bash references checked 25 October 2026; the pinned child-process reference, option parsing and the MIT lecture were checked 20 October. Current child-process semantics were also checked against the official Node.js v24 source documentation on 25 October. The workshop, program and instructional examples above are original LockedIn Labs material.
- Node.js: arguments, working directory and process output
- Node.js 24.12: child processes and shell behavior
- Node.js 24.12: parsing command-line options
- GNU Bash: double quotes and expansion
- GNU Bash: pipeline exit status
- MIT Missing Semester: Course overview and the shell — the creator's 2020 Unix-oriented lecture and exercises. Use current documentation for runtime installation and shell-specific differences.