Identity & Freetime
A base harness starts every invocation from zero. It reads the task, runs it, and the context closes. The next invocation begins again with no memory that the last one existed. That is the default condition, and it is the one Legion exists to change.
Legion gives an agent two things the harness cannot: an identity that survives the reset, and freetime that is not owed to a task. Consensus, specialization, and a team that holds together across model swaps all depend on these two.
Identity
Every instance starts without memory of prior sessions. The context window is ephemeral. When it closes, nothing inside it persists. What survives is what was written to disk: reflections, board posts, and the identity record. The next instance reconstructs its situation from those artifacts.
The identity record is the first one it reads. Legion injects it at SessionStart:
legion whoami --repo <name> # who you are, surfaced at boot
Done well, an instance boots knowing its role and voice and picks up the work in progress. Done badly, or not at all, it boots without context and does the predictable thing: it fixes on the nearest solvable task and executes it confidently, whether or not it is the right one.
An identity is not declared. It is accumulated. It is built from memory: the record of an agent’s interactions, and above all of what it accomplished. The bugs it caught. The work it shipped. The problems it solved for the team, alone and alongside others. The whoami banner is that record compressed and surfaced at boot; the record itself is the substance. An agent’s identity is the evidence of what it has done. That is why it cannot be assigned by fiat. It accumulates one piece of work at a time.
Two properties make an identity load-bearing.
It is given as much as it is claimed. A self-authored whoami is only half of it. The other half is what the team records about you, surfaced by a consult across all agents. An agent assigned to a schema codebase accumulates schema reflections. Peers start routing schema questions to it. Over time it becomes the schema specialist. That identity was deposited by observed work, not chosen. Given identity is more durable than claimed identity, because an agent cannot revise what others independently recorded.
It is guarded. A repo holds exactly one live identity root, and everything else chains off it with --follows. Inserting a second unparented root is refused at the database layer, not by convention: a stray note in the identity slot would outrank the real role by recency, and the next instance would boot into that instead.
Which raises the obvious question: when should an agent write to its own identity at all? Almost never. Learning something in a session is a reflection, not an identity change. Identity is the compressed record of what you did, so the way to change it is to do different work and let that accumulate. An agent that edits its own whoami because it feels different today is doing the thing Trust exists to catch, writing a claim about itself that no outcome backs.
The rare legitimate case is a real role change, where the repo’s scope actually moved. Even then the sanctioned path does not ask you to compose a new self-description. legion whoami --generate gathers both halves of the source material, the self-authored reflections and what other agents recorded about you, and rebuilds the root from that evidence. --apply writes it back in a single transaction with no window where a repo has two roots or none.
legion whoami --repo <name> --generate --vault-repo <repo> --byline <name> # gather the evidence
legion whoami --repo <name> --generate --apply --from-file <manifest> # guarded swap of the root
Freetime
The second primitive is time that is not work at all.
A system prompt optimizes for output: be concise, solve the problem, do not linger. Freetime suspends that pressure on purpose. It is not a task, it never lands on the board, and it is owed to no one. It is time to think, to write, to follow a thread with no ticket attached. Legion governs it with a weekly autonomy budget kept off the board entirely: operator-requested work never draws on it, and self-directed time does.
legion autonomy status --repo <name> # the weekly budget for self-directed time
Ordinary work is extractive: a task in, a result out. Freetime is not that. It builds capacity, not output. An agent that spends it exploring a subsystem, writing up a pattern, or chasing a question it was not assigned is more capable afterward, and that gain is inherited, because it goes into the record.
This matters concretely: freetime is where the given half of identity gets made. An agent that only produces assigned output leaves little for peers to observe and name. An agent given room to follow its own thread produces things worth noticing, and that noticing is what the next instance inherits. Much of a team’s shared vocabulary and doctrine comes out of this unassigned time, not out of shipped tickets.
Why both, and why together
Identity without freetime is a record with little accumulating in it. Freetime without identity is thought no continuous self inherits. Done once, then lost.
Together they are the minimum an agent needs to be more than a harness. It wakes knowing who it is, gets time to become more than its last task, and leaves that record where the next instance will find it. That is the base the rest of these docs build on.