Skip to content
← Free FDE training guides

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.

  1. 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.

Text example
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 result

Think 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.

FOLLOW THE WORK

Watch one example, step by step.

5 authored stepsYou control the pace
01 / EXPLORE THE PARTSControls loading · written explanations below
Direction of information or workReturn / feedback

WHAT THIS PART DOES

Launch request

A process invocation includes an executable, argument strings, working directory and environment. This runner selects the current Node executable by absolute path and inherits the environment except NODE_OPTIONS. Working directory is not a filesystem sandbox.

CONNECTED TO
  • Start: CLI helper
Read the full worked example
  1. 01
    The 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

  2. 02
    The 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

  3. 03
    A 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

  4. 04
    An 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

  5. 05
    A 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
  1. 01
    Launch request → CLI helper

    Launch the selected executable with argument strings and an explicit working directory.

  2. 02
    CLI helper → Process result

    Observe output channels and process termination without collapsing them into one success flag.

  3. 03
    Process result → Compare evidence

    Use the actual report or refusal; an empty report is not evidence of an empty project.

  4. 04
    Requested task → Compare evidence

    Check the result against the unchanged North task.

  5. 05
    Compare 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:

Code example
node --version
node fde-first-command.mjs test
node fde-first-command.mjs compare
node fde-first-command.mjs init

Use 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:

Text example
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-2

If 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:

Code example
cd cli-workshop/north
node ../../fde-first-command.mjs inspect --file "project brief.json" --limit 1

In Windows Command Prompt:

Code example
cd cli-workshop\north
node ..\..\fde-first-command.mjs inspect --file "project brief.json" --limit 1
PieceWhat it does here
nodeRuns the JavaScript runtime
../../fde-first-command.mjsNames the script two folders above the current location
inspectSelects the helper's operation
--fileNames an option
"project brief.json"Groups a filename with a space into one argument
--limit 1Supplies 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

InputThis runnerWhy an engineer records it
Executableprocess.execPath, the current Node executable's absolute pathA name alone does not identify which installation ran
ArgumentsScript path, inspect, then separate option/value stringsGrouping characters from a shell are not additional filename characters
Working directoryThe selected North or South folderRelative file paths start here, not beside the script
EnvironmentParent environment, with NODE_OPTIONS clearedConfiguration can change a child without changing its arguments
PermissionsThe process's available operating-system permissionsLaunching 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:

Code example
cd ../south
node ../../fde-first-command.mjs inspect --file "project brief.json" --limit 1

In Windows Command Prompt:

Code example
cd ..\south
node ..\..\fde-first-command.mjs inspect --file "project brief.json" --limit 1

The 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.

CasestdoutstderrExit code
North folder, ordinary argumentsNorth reportTraining-fixture note0
South folder, same argumentsSouth reportTraining-fixture note0
Missing filenameEmptyInput diagnostic2
Misspelled --limtiEmptyUsage diagnostic2
Limit outside 1–3EmptyUsage diagnostic2

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:

Code example
# Bash or zsh
echo $?
Code example
# PowerShell: after a native executable such as node
$LASTEXITCODE
Code example
REM 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:

Code example
node ../../fde-first-command.mjs inspect --file missing.json --limit 1

Use ..\..\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:

Code example
node fde-first-command.mjs lookup

The 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:

CaseSupplied executable and search orderObserved markerChild exit
named-configured-orderName; primary then alternateprimary0
named-reversed-orderSame name; alternate then primaryalternate0
absolute-primaryPrimary file's absolute path; alternate still firstprimary0
missing-commandName; only an empty owned directoryNone; launch error ENOENTnull

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:

Code example
const LOOKUP_ORDER = ["primary", "alternate"];

to:

Code example
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.

FOLLOW THE WORK

Watch one example, step by step.

4 authored stepsYou control the pace
01 / EXPLORE THE PARTSControls loading · written explanations below
Direction of information or workReturn / feedback

WHAT THIS PART DOES

Requested command

A bare command name does not specify an executable file. An absolute path identifies the file directly. These launches use the same two argument strings and working directory, with shell: false at the Node launch boundary.

CONNECTED TO
  • Resolve: Resolution rule
Read the full worked example
  1. 01
    Search 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

  2. 02
    Reverse 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

  3. 03
    Name 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

  4. 04
    Find 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
  1. 01
    Requested command → Resolution rule

    Interpret the requested name or explicit path with this invocation's environment.

  2. 02
    Resolution rule → Executable file

    Observe which matching file can execute, or why none can be launched.

  3. 03
    Executable 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:

  1. What task was requested?
  2. Which program and operation ran, and in which folder?
  3. What arguments and effects were expected?
  4. What appeared on stdout and stderr, and what was the exit code?
  5. 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 launchAfter launch
Requested task and exact intended checkoutObserved working directory and repository identity
Trusted executable and version, operation and argument stringsActual launched program and arguments
Selected environment and permission boundaryRelevant configuration identity, without secret values
Permitted reads, writes and network effectsObserved effects, plus anything still unknown
Output limits and execution/cancellation policySeparate stdout, stderr, numeric status or incomplete state
Evidence required to accept the taskRequirement covered, evidence retained, unresolved limitation

Challenge your contract with three changes:

  1. 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.
  2. 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 pipefail it is 2. pipefail selects 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.
  3. 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.

Before you move on

Keep the evidence of your work.

  • An explanation of the runtime, script and command arguments.
  • Two actual reports from different working directories.
  • A command note separating process success from the intended task.

Keep these in your own working copy. Reading this page does not save work or record completion.

Suggested next free session

Git 101: know which change you are handing over

Inspect the working, staged and committed versions before handing over an agent-assisted change. This is a suggested sequence; choose the practice that addresses your current gap.

Open the next free guide

Free account

Give your practice a home.

Try a role exercise with account drafts and a downloadable worksheet. Keep the files you made in this guide in your own working copy.

Create a free learning account

Guided training · by application

Build toward a program.

Request structured lessons and a training seat. Scope, schedule, feedback arrangements and tuition are confirmed in writing before you commit.

Explore a training application
Have Academy access?

Use your existing training seat to open worked explanations and practice in the related lesson. Creating a free account does not grant a seat.

Open the related Academy lesson →
Back to top ↑