# How It Works
> Source: https://legalcode.md/how-it-works | [HTML version](https://legalcode.md/how-it-works)

## Platforms fragment your data.

Every legal AI platform requires you to upload documents, create accounts, and trust a new vendor with sensitive client data. Each one becomes another silo.

None of them talk to each other. None of them talk to your existing tools. And every one of them retains your data on their servers under their terms.

For a profession built on privilege and confidentiality, this architecture is fundamentally broken.

## Run your own agent. Connect resources to it.

01. **Choose your agent** -- Claude Code, ChatGPT, Cursor, Windsurf, Codex - any MCP-compatible tool. Your agent runs on your machine, under your control. No new accounts, no data uploads.

02. **Connect the law** -- One command - npx legalcode --start - connects your agent to primary legal sources and custom-built skills via MCP. The server runs locally. Your queries are never logged.

03. **Work with confidence** -- Research statutes. Review contracts. Generate DPIAs. Your agent reasons with the law using primary sources and proven methodologies. Documents never leave your device.

## Safety & Privacy

Privacy by architecture, not by policy.

- **Zero data retention** -- Legalcode never stores your documents, queries, or results. The MCP server processes requests in memory and discards them. There is no database of your activity.
- **Local execution** -- Your agent runs on your device. Documents are read locally, analyzed locally, and results stay local. Nothing is uploaded to Legalcode servers.
- **Privilege preserved** -- Attorney-client privilege depends on controlling who sees what. By keeping data on your device and never logging queries, the privilege chain remains unbroken.

---
*Legalcode -- legalcode.md*
