# diff_snapshots

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/workspace_diagnostics/diff_snapshots)

Compare a persisted snapshot against the current one.

Fields present in the snapshots are compared with values; fields named in
`changed_names` (e.g. fingerprint-only or path-valued fields detected by a
fingerprint comparison) are reported as changed without values.

## Signature

```python
diff_snapshots(
    bound: WorkspaceSnapshot | None,
    current: WorkspaceSnapshot,
    *,
    changed_names: Sequence[str] | None = None,
) -> tuple[FieldChange, ...]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `bound` | `WorkspaceSnapshot \| None` | Yes | The snapshot persisted with the binding, or `None` for a legacy binding that predates snapshots. |
| `current` | `WorkspaceSnapshot` | Yes | The snapshot built from the current resolved policy. |
| `changed_names` | `Sequence[str] \| None` | No | Field names known to differ that snapshots do not carry values for. (default: `None`) |

## Returns

`tuple[FieldChange, ...]`

Sorted drift entries, values included only where both sides are known.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/workspace_diagnostics.py#L326)