Lesson 10.09 · Phase 10 · Coding & Computer-Use Agents
Terminal agents
A terminal agent drives one long-lived shell, so cd and export stick between commands. That's the useful part. The rest of the work is defence. Every command is split and checked before it runs. Nothing can block waiting for input that will never come. Output is cleaned and capped. A hung command kills and restarts the shell, and the model is told exactly what state it lost.
Learning objectives
- Run commands in a persistent bash process and detect where each command's output ends, with its exit code.
- Classify commands as allow, ask or deny, checking every segment of compound commands and the commands inside $(...).
- Prevent hangs from stdin, pagers and editors, and recover from timeouts by restarting the shell.
- Clean output: strip ANSI escape codes, cap the size, redact host paths.
A shell is the most powerful tool you can give an agent, and the easiest to get wrong.
Loading the full lesson…