kairn

Public beta

kairn

Context runtime for coding agents.

Kairn sits between retrieval and the agent, governing what context enters the working session so coding agents waste fewer tokens and stay focused longer.

$npm install -g usekairn@beta

Local-first. Index and session memory stay on your machine.

Less waste. Repeated and irrelevant context gets filtered before the agent sees it.

Agent-ready. Works through Codex session hooks or local MCP.

What it does

Kairn turns repo context into a control layer.

Retrieval can surface possible files and snippets. Kairn decides what belongs in the active coding session.

01

Find the source files the agent should start with.

02

Keep repeated context out of long sessions.

03

Ask for missing evidence instead of guessing.

04

Govern working context instead of blindly appending retrieval results.

05

Work through Codex session hooks or local MCP.

Why it matters

Less waste. More memory. Better source focus.

Lower token waste

Repeated and irrelevant repo context gets filtered before it reaches the agent.

Longer working memory

Kairn remembers established source context across a session, so the agent does not restart discovery every turn.

Better source focus

Kairn routes the files that matter without turning every prompt into a repo dump.

More work from the same budget

In token-limited workflows, lower token use gives you more equivalent agent work from the same spend.

Local-first privacy

The repo index and session ledger stay on your machine. Beta telemetry is opt-in and aggregate-only.

Beyond retrieval

Retrieval finds candidates. Kairn governs context.

RAG can surface relevant files, chunks, and tool results. But relevance is not the same as readiness. Kairn decides what reaches the model now, what should be compressed, what should wait, and when more evidence is needed before spending tokens.

01

Retrieval finds candidates

Files, snippets, tests, diffs, and prior turns that might be relevant.

02

Kairn governs context

It decides what reaches the model, what shrinks, what waits, and when evidence is missing.

03

Agent gets focused context

Enough source to act, less stale or repeated material.

Not a bigger search result. A better governed prompt surface.

Evidence snapshot

Lower token use, quality-gated.

View evidence

Evidence sets

8+

headline sets plus latest check

Median reduction

42.7%

clean rows shown

Official tasks passed

20/25

Kairn across official campaigns

Endurance suites

4

long-session evidence

01

Click endurance

29k

saved

42.7%

less token use

91k baseline to 62k with Kairn.

02

Node SemVer endurance

11k

saved

16.4%

less token use

70k baseline to 58k with Kairn.

03

OpenLibrary SWE-Pro

12k

saved

54.2%

less token use

22k baseline to 10k with Kairn.

The savings shown here only count when the task still passes. Separate evaluator rows also show Kairn improving outcomes when better source focus matters.

Beta paths

Bring it to the agent you already use.

Codex CLI

The most-tested public beta path for terminal workflows.

MCP

The portable path for editors, extensions, and agent UIs.

Telemetry

Optional aggregate feedback that helps improve routing without uploading code.

Privacy

Local-first by design.

Your source, prompts, diffs, filenames, repo names, branch names, and raw outputs stay local by default. Beta telemetry is opt-in and aggregate-only.

Public beta

Install Kairn for your next repo session.

Install Kairn