Save products you love by clicking the heart icon.
Evidence-based testing practice from production codebases — property-based invariants, seeded fault injection, contract tests, benchmark-verified performance, and quality gates that are enforced, not aspirational.
Comprehensive DR testing and edge-specific patterns for k3s — failover validation, scheduled snapshots, multi-cluster recovery, and RPO/RTO planning.
You already know the Unix philosophy. Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface. Doug McIlroy gave us those rules in 1978, and they have aged better than almost anything else in computing.
But notice what the Unix philosophy does not say. It tells you how a tool should be shaped. It says nothing about how a tool should behave when the world is on fire. And that is the gap. A program can be perfectly Unix-shaped - small, composable, text-streaming - and still be an anxious, angry mess that panics the moment the network blinks.
The Stoic Unix Philosophy is the temperament layer. It borrows from Marcus Aurelius, Epictetus, and Seneca not as decoration, but as engineering discipline. It asks one question of every tool you build: when something outside your control goes wrong, what kind of program are you?
Spend a day in a terminal and you will see the anger everywhere. A curl to a flaky endpoint prints Could not resolve host in angry red, then retries, then prints it again, ten times, as if the DNS server could be shamed into compliance. npm install ends with a wall of deprecation warnings for packages you have never heard of. A backup script succeeds and still emits forty lines of INFO: chatter, because somewhere a developer thought the world needed to know that a file was opened.
This is not harmless. Anger has a cost. When every tool screams, the signal is buried under the noise, and the operator learns to ignore everything - including the one warning that meant something. The angry tool trains its user to stop listening. That is the opposite of robustness.
The ancient Stoics had a word for the disturbance of the calm mind: pathos. The angry Unix tool is a machine suffering pathos. The cure they prescribed was apatheia - not "apathy" in the modern sense of not caring, but tranquility: freedom from being tossed around by things outside your control.
Epictetus opened his Enchiridion with the single most useful sentence in all of philosophy: "Some things are within our power, while others are not." A program must learn this distinction, and learn it early.
Here is what a program controls:
Here is what a program does not control:
The Stoic Unix Philosophy says: be indifferent - that is, robust - to the second list, and rigorous about the first. A transient network error is not a catastrophe. It is weather. The stoic tool does not treat an unavoidable condition as a personal failure. It retries, it backs off, it degradhes gracefully, and it stays quiet about it.
You can see this in a single shell flag. Most Bash scripts begin with set -e, which means "exit immediately if any command fails." That is the anxious program: it dies at the first sign of a non-zero exit it did not personally anticipate, often mid-task, leaving half-written files and orphaned children behind. The stoic script reaches for set -uo pipefail instead - it still catches real breakage through the pipeline, but it does not collapse because a command it was tolerating returned non-zero. It treats each failure explicitly, at the boundary where it actually matters, and stays in control of its own exit.
Output is a scarce resource. Every line your tool prints is a line the operator must parse, store, scroll past, or ignore. The stoic tool spends that resource like a miser.
Three levels of speech, and most tools get them catastrophically wrong:
The sin is calling routine recovery a warning. A tool that, on startup, finds and prunes a stale lock from a previously killed run and prints WARNING: removing stale lock is like a janitor narrating every sweep of the broom. That is not a warning. That is the system doing its job. Demote it to DEBUG and let it sleep.
Rule of thumb: if the message describes something you already fixed, it is anger, not information. Delete it or hide it behind a debug flag.
Amor fati - love of fate - is the Stoic practice of accepting the world exactly as it is, not as you wish it were. For a program, this means premeditatio malorum: anticipate that things will go wrong, and build accordingly.
Processes will be killed mid-task. Disks will fill. Networks will partition. Power will fail. The stoic tool does not treat these as surprises; it treats them as Tuesday. It recovers gracefully, without complaint, and picks up where it left off.
This is why idempotency is a Stoic virtue. An operation that is safe to re-run after a crash is a tool that has accepted fate. It does not assume the world is friendly; it assumes the world is interruptible, and it arranges its affairs so that an interruption is merely an inconvenience. Re-running it produces the same result and leaves no duplicate mess. Idempotency is not a nice-to-have for distributed systems. It is the mechanical expression of amor fati.
The Stoic holds that virtue is sufficient for happiness - that a good person needs nothing external to be good. Translate that to tools and you get a clean directive: a program's worth is in doing its one job correctly and then returning.
It should not overreach. It should not, "while we're here," also reconfigure the system, also send a metric, also print a newsletter. It does the one thing it was asked to do, does it well, and exits. It does not linger. It does not daemonize when a one-shot would do. It does not pollute.
Which brings us to the Stoic's reminder of mortality: memento mori. Leave the world as you found it, or better. Kill your child processes on exit. Remove your temp files. Release your locks. A tool that spawns background work and walks away has abandoned its responsibilities - the engineering equivalent of leaving the stove on.
When something within your control genuinely fails, the stoic tool fails clearly and completely. One non-zero exit code. One true sentence about what went wrong. Nothing more.
This reframes Rob Pike's famous rule - "write programs that fail noisily and as soon as possible" - into its Stoic form: loud about what matters, silent about what doesn't. A real fault in your own logic deserves a clear, immediate, loud signal. An environmental condition you could not have prevented deserves calm handling, not a stack trace hurled at the user.
The distinction is the whole game. The Stoic separates your failure from the world's failure, and only the former is "loud." Dumping a 200-line stack trace on the operator for a DNS timeout is not honesty. It is panic. The honest tool says: "could not reach registry after 3 attempts (exit 1)." Then it stops.
To make this concrete, consider taskfleet - a standalone orchestrator that dispatches declarative LLM tasks to multiple providers in parallel, each in an isolated git worktree, verified against exact acceptance gates before merge. It is a real codebase, and it already embodies a surprising amount of the Stoic Unix Philosophy. Where it does, and where it could go further, is the most useful lesson of all.
What it gets right:
set -uo pipefail, deliberately not set -e. It does not die at the first unanticipated non-zero exit; it guards failures explicitly and keeps its own exit under its control.Where it used to get angry (and how it was fixed):
The one place taskfleet once got angry was its logging. Across the core libraries and the main loop there were well over a hundred tf_info / tf_warn / tf_error calls, all emitted unconditionally to stderr, with no log-level throttle. Routine recovery - "removing stale worktree," "killing N stale processes," "resetting task: pid is dead" - was logged at WARN level. That is anger by our definition: describing things the tool already fixed, at a level that implies operator intervention is needed.
We applied exactly the Stoic refactor:
TF_LOG_LEVEL gate (silent / error / warn / info / debug) with a default of warn, so steady-state stays quiet.DEBUG. WARN is now reserved for conditions the operator genuinely must notice - a dirty main worktree that got cleaned (work discarded), an unhealthy worker, out-of-scope edits, a blocked dependency.stdout for the status board only, emitted on explicit --status rather than as a side effect of running.None of that changed what taskfleet does. It changed how it behaves under adversity - which is the entire point. The codebase is the living example this essay is built on; you can read the discipline in lib/common.sh (tf_log) and docs/STOIC-LOGGING.md.
If you take nothing else, take this. Before you ship a tool, ask:
set -uo pipefail, not set -e? Stay in control of your own exit.The Unix philosophy gave us tools that fit together. The Stoic Unix Philosophy gives us tools we can live with - calm when the network fails, honest when they themselves err, undemanding of our constant attention.
In an age of distributed systems, flaky dependencies, and LLM agents that get killed mid-thought, the angry tool does not scale. It burns the operator's attention, buries the real signal, and falls over at the first thing it cannot control. The stoic tool does the opposite. It accepts the world, does its one job, speaks only the truth - and then, like a good guest, it leaves.
Build calm tools. The world will provide plenty of chaos on its own.