Reading 08 of 8

Working in the Terminal

A coding agent uses ordinary files, shell commands, Git, dependencies, tests, and deployment tools. Reading that loop helps you supervise it safely.

The terminal is a text interface to a shell, the program that parses commands and starts other programs. Bash is common on Linux and servers; modern macOS uses zsh as its default login shell, though users can change it. 1

Begin by knowing the working directory. pwd prints it; ls lists entries; cd moves to another directory. Relative paths start from where you are. Before approving a command that edits or deletes files, check both the path and the current directory.

Shell syntax has consequences. Wildcards are expanded by the shell before a command runs. Quote a pattern when the receiving tool should interpret it: find . -name '*.png'. Quote paths containing spaces. Read a command containing sudo, recursive deletion, redirects, or downloaded scripts before running it.

Git records selected changes when they are committed. git status shows modified, staged, and untracked files; git diff shows content changes; a commit captures a chosen snapshot. Git does not automatically record ignored files, uncommitted work, shell side effects, sent messages, database changes, or deployments.

A branch is a name pointing to a line of commits, not a full duplicate of the project. Use a separate clone or worktree when two tasks need isolated working directories. Fetch downloads remote history without integrating it; pull normally fetches and then merges or rebases according to configuration.

Git makes code changes inspectable when they are captured well. It does not make every agent action recorded or reversible.

Projects depend on packages and environment configuration. A lockfile improves repeatability, but operating system, CPU architecture, environment variables, install flags, registries, and build scripts can still differ. Containers reduce some variation without making every machine identical.

Before code is accepted, run the checks the repository actually defines: formatting, linting, type checks, unit tests, integration tests, and a build where relevant. A passing suite is evidence for the behavior it covers, not proof that the change is bug-free or secure.

CI/CD is often oversimplified. Continuous integration builds and tests changes. Continuous delivery keeps a release ready; continuous deployment automatically releases qualifying changes. A team may require manual approval after tests pass, and a deployment can still fail after CI succeeds.

Supervising a coding agent is therefore a sequence: confirm its working boundary; inspect commands; review the diff; run relevant checks; keep secrets and production credentials out of reach; and approve release separately. The terminal is not magic—it is an audit surface, if you pause to read it.

Evidence

Sources

  1. 1
    Change the default shell in Terminal on Mac

    Apple Support · Documentation · checked 2026-07-13