When using the browser, what Anthropic calls Claude.ai, the memory is stored on your account on their servers.
Claude code stores memory locally on the device, similar to how a developer stores notes.
Data retention is about storing your raw conversation data.
Capabilities and Privacy settings are used to manage memory and data retention.