Copy-on-write (COW) is a resource management technique in which a requested copy of data initially shares the original rather than duplicating it, and only the portion that is actually modified gets copied at the moment of the write. Because reads incur no copying cost, large data sets can be cloned almost instantly while saving memory and storage.
It is widely used in operating system process forking, virtual memory, snapshots in file systems such as ZFS and Btrfs, and storage cloning features. In databases, it enables branches or sandboxes of production data to be created without physical copying, and it serves as a foundation for isolated environments in which AI coding agents test code against real data.