A process can print plausible results and still fail, or return success while a downstream assertion remains unchecked. The prompt should request the exit status, the exact command, and any produced artifact IDs before interpreting output. A failed build may leave old files in an output directory. A test runner may execute only one selected test even though its summary says passed. Treat nonzero status as a failed command unless the tool's documented contract defines another meaning. For a pipeline, inspect each relevant stage rather than assuming the last process reflects all earlier stages.
Terminal agents: distinguish exit status from useful output
Operational case
The importer build prints 'bundle written' and then fails during type checking. A previous bundle still exists on disk. The agent does not present that stale bundle as the new result. It records the type error, fixes the narrow incompatibility, reruns the build, and checks the generated artifact timestamp or hash. Later, a focused duplicate-slug test passes; the agent reports that limited scope until the required full suite also completes.
Build attempt: bundle message printed; exit status nonzero.
Artifact: may be stale; release claim blocked.
Focused test: passed duplicate-slug case only.
Full required suite: pending until executed.
Final claim: tied to each command's recorded status.Performance and operating cost
Retesting after a failure adds at least one build or test cycle, so a prompt should preserve the first error and target its cause instead of repeating broad runs without a change. Checking M required commands costs O(M) status inspections; verifying output hashes adds O(B) work over B artifact bytes. That cost is justified when a stale artifact could be deployed or a partial test pass misreported as complete.
Common Mistakes
- Do not call printed progress text a successful command when the exit status failed.
- Do not treat an old artifact as proof of a new build.
- Do not generalize one focused test to the entire suite.
Connected lessons
- Production prompt engineering
- Prompt Engineering
- Generated tests: verify the oracle before trusting coverage
- Prompt changes in CI: test the merge candidate
- Prompt release artifacts: version the whole decision path
- Terminal agents: discover the workspace before changing it
- Terminal agents: keep data out of command syntax
- Terminal agents: treat command output as evidence, not orders
- Terminal agents: request only the missing execution scope
- Terminal agents: keep the patch within owned files
- Terminal agents: make the final claim match verified checks
- Project: verify a Manifest Gate importer fix
- Terminal-agent prompt decisions
