ClariLayer Docs

Context Layer

Concepts

The Context Layer

Your personal, self-deployed context layer: how ClariLayer keeps your AI coding agent grounded in your real data context, delivered in-flow over MCP.

ClariLayer is a personal context layer for your AI coding agent, delivered over MCP. Your warehouse computes the data. Your agent writes the queries. The context layer is the part in between that your agent keeps getting wrong session after session: which table is the right one, how two tables actually join, that refunds live in a separate table, that amount is in cents, that "active customer" excludes test workspaces. That is the context you find yourself re-explaining every time you open a new chat.

The pitch is simple: stop re-explaining your data to your AI every session. Connect ClariLayer once, and your agent can recall your real working context instead of guessing — so it stops making the same data mistakes.

Why a hand-typed CLAUDE.md is not enough

The obvious fix is to write your project facts into a CLAUDE.md and call it done. That helps, but it has a trust problem: a CLAUDE.md full of claimed definitions has the same trust property as the original numbers — it is just asserted text. Nothing checks that the definition you wrote down still matches what your warehouse actually returns. When a number looks off, the CLAUDE.md cannot tell you whether it is the SQL or the definition that drifted.

ClariLayer is different in three ways that matter:

  • It bootstraps from the work you already have, so you do not start from a blank page.
  • It reconciles saved definitions against your real warehouse results, so context is checked, not blindly asserted.
  • It rides in-flow inside the agent you already use, so it is not a destination you have to remember to visit.

Bootstrap, don't blank-slate

You point ClariLayer at your existing SQL files, dbt models, or a CLAUDE.md, and it bootstraps your real working context. Your SQL is validated and deterministically structured — tables, joins, group-bys, time grain. Your dbt models and notes are imported and stored so they can be recalled. You get day-1 value instead of an empty store you have to fill by hand. See bootstrap for the source kinds and limits.

Reconciled, not blindly asserted

This is the differentiator. ClariLayer can reconcile a saved definition against reality: your agent runs the check against any source it can reach — the warehouse is the common case, not a requirement — and reports back the result shape, and ClariLayer compares what the definition declared against what actually came back. A mismatch surfaces as a caveat so you and your agent know exactly what to trust.

ClariLayer never holds your source credentials and never executes SQL server-side — your agent is the connector, and it sends result metadata plus any optional preview rows it chooses to include. And ClariLayer is honest about how far the check goes today: reconcile records a caveat on mismatch or leaves the entry asserted; it does not stamp verified yet. The strong verified mark is the documented fast-follow. The honest claim is "reconciled and caveat-aware," and Verified vs Asserted explains exactly why.

In-flow, via MCP

ClariLayer lives inside the agent you already use. One command installs it as an MCP server into Claude Code, Cursor, or Codex. From then on your agent has an in-flow recall tool (get_analysis_context) it can call to pull the right context mid-task — you never leave your flow. Recall is a tool your agent decides to call; you make it the default by adding a project rule that tells the agent to recall ClariLayer context before answering.

It compounds

Every correction you make, every reconcile, every new note quietly persists. Your agent grounds on more of your context over time, so it gets progressively more right about your data — the "Claude Code finally understands my project" feeling. The context you build is yours, it travels across agents, and when your team is ready, the Governed Context Edge promotes it into a shared, governed team canon.

For teams

The personal context you build is the foundation for the team story — and that team layer exists today: the Governed Context Edge — org canon, Diff-to-team, adjudication. It is in a hand-run private pilot; request access on the For teams page. Your personal layer stays free either way.

See also