# `ADK.Agent.Clone`
[🔗](https://github.com/zeroasterisk/adk-elixir/blob/main/lib/adk/agent/clone.ex#L1)

Clone utility for ADK agent structs.

Mirrors Python ADK's `BaseAgent.clone()`:
- Deep copies sub_agents recursively
- Shallow copies list fields (new list, same element references)
- Resets parent_agent to nil on the cloned root
- Wires parent_agent on cloned sub_agents to point at the new clone
- Validates update keys exist on the struct
- Disallows updating `parent_agent` directly

# `clone`

```elixir
@spec clone(
  struct(),
  map() | nil
) :: struct()
```

Clone an agent with optional field overrides.

---

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