# `ExAthena.Agents.Sidechain`
[🔗](https://github.com/udin-io/ex_athena/blob/v0.7.1/lib/ex_athena/agents/sidechain.ex#L1)

Writes a subagent's transcript to disk so it doesn't bloat the
parent's context.

Path: `<cwd>/.exathena/sessions/<parent_session_id>/sidechains/<subagent_id>.jsonl`.

Each line is a single JSON object: prompt, opts (subset), result
text + termination metadata. The parent only ever sees the final
text via `Result.text`; the full transcript persists here.

PR5 replaces this inline writer with the `ExAthena.Sessions.Store`
behaviour and the JSONL store implementation. Until then, this
bare-bones writer keeps PR4 self-contained.

# `write`

```elixir
@spec write(map()) :: :ok
```

Persist a subagent's full transcript. `result` is whatever
`ExAthena.Loop.run/2` returned (`{:ok, %Result{}}` or
`{:error, term}`).

Returns `:ok`. Errors are silently logged; sidechain writes are
best-effort.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
