Copy-on-Write (CoW) is an optimization strategy where a duplicated resource—such as a memory page, file, or data structure—initially shares the original's underlying data. A true, physical copy is only created when either the original or the duplicate is modified. This lazy evaluation defers the cost of copying until absolutely necessary, conserving memory and CPU cycles. In agentic systems, CoW is critical for efficient state branching and memory versioning, allowing agents to fork their context or knowledge base without immediate overhead.
