Persist Environment Facts

Facts about the environment — directory layout, versions, credentials, topology — belong in files the agent can re-read, not floating in context that disappears on reset.

What it is

Every agent run begins with a context window that knows nothing. Facts that were discovered in a previous session — the repository structure, the installed tool versions, the API endpoint, the cluster topology, which ports are open, where the config lives — must be re-discovered or re-stated every time unless they have been written down. Persisting environment facts is the practice of capturing this discovery work in structured files that any session can read as its first act: a WORKSPACE.md describing directory layout and conventions, an env.yaml capturing tool versions and cluster state, a .env or secrets file with endpoint addresses. These files are the agent's memory of the world it is operating in. Without them, every session re-discovers what the last session already knew, paying in tokens and latency for information that is stable across runs. With them, the agent begins from a grounded, accurate model of its environment rather than a blank slate.

When to reach for it

When NOT to

Exemplars

Related