Context Gateway for AI Systems
One task.
A controlled path.
LeanCTX sits between AI and the systems it reads. It selects relevant context, applies supported controls, and records what the integration can observe.
The chapters below follow these three steps and the capabilities behind each. Access and policy checks apply throughout the supported flow.
Select
Find what the task needs. At the right depth.
LeanCTX turns a task into a focused search across the sources your workflow may access, then reads each match at the depth the question needs. Source references stay attached, so you can read deeper or inspect the evidence behind a match.
A coding workflowFor a code review: locate the checkout implementation and its tests, then read only the functions the change touches.
- 01
Decide
Define the task.
Set the question, available sources and context budget. Give the next read a clear purpose.
- 02
Retrieve
Find relevant sources.
Search the sources available to your workflow. Relevant matches become candidates for the next context.
- 03
Extract
Read the relevant detail.
Open the file structure, function or passage behind a match. Choose the read depth your question needs.
- 04
Compress
Reduce the noise.
Remove unnecessary detail from the prepared view. Use source references to read deeper when the task requires it.
Control
Your rules first. Then the model.
Your boundaries and enabled filters check supported operations before anything is delivered. Source access and content inspection answer different questions: may this source be read, and may this result be delivered? When execution runs through LeanCTX, the selected route must also pass the applicable policy and budget checks.
A coding workflowRestrict customer-data directories and inspect supported text results with enabled filters. Send the request through a permitted model route; any fallback must meet the same constraints.
- 05
Govern
Apply your rules.
Access boundaries and enabled filters check supported operations before delivery. These controls accompany the lifecycle rather than running only at this step.
- 06
Run
Execute through an allowed route.
Use prepared context in your own model call, or route supported execution through LeanCTX. In the governed path, the selected route must pass the applicable policy and budget checks.
Prove
Show what was delivered. And why.
LeanCTX records what the integration can observe: the context it delivered, the configured checks that affected delivery and the usage behind it. Evaluate the task itself separately: a completed model call is evidence of execution; task checks establish whether the work succeeded.
A coding workflowReview the proposed change and run its tests. Before you accept it, check which context the agent received and which filters applied.
- 07
Evaluate
Measure what changed.
Inspect delivered context, observed usage and the basis of any cost estimate. Evaluate the task outcome separately, including the cost of failed attempts and retries.
- 08
Replay
Revisit the context decision.
Use the source and recorded state still available to investigate a result. Context replay does not guarantee an identical model answer.
Integrations
Keep your tools. Control their context.
Add the Context Gateway to the workflow you already use. Connect through supported clients, MCP, hooks or the SDK, and check which reads and results the integration covers.
| Layer | Examples | Role |
|---|---|---|
| AI tools | Cursor · Claude Code · Codex · Copilot | Host-specific setup for supported tool calls. |
| Data sources | Files · GitHub · GitLab · Jira · MCP | Local reads or configured providers with their own credentials and permissions. |
| Models & frameworks | Your host + LeanCTX SDK | Prepared tool results for your model. The host owns the model call. |
Check host setup, adapter versions, source permissions and filter coverage together. These layers do not promise identical capabilities.
Your first workflow
Start with one real task.
Connect your tool, prepare context from a familiar project and compare the result with its source. Add execution controls and continuity as your workflow needs them.
Start with LeanCTX
Make your next task a better-informed one.
Bring your tools. Keep your model. Put deliberate context between them.
Local-first. Model-agnostic. Your context.