Skip to content
Use case · Coding agents

A coding agent that remembers your codebase across sessions.

Isolated cores give every repo or client its own brain — conventions, decisions, and gotchas that survive when the session closes.

What it is

A coding agent with a separate, persistent brain per repository — the conventions, architectural decisions, and gotchas that normally evaporate when a session ends.

Why it matters

Coding agents start every session from a blank slate. They re-learn your conventions, re-discover the same architectural decisions, and forget why a workaround exists — then confidently undo it. Context windows reset; institutional memory never forms.

Before · After

What changes with a memory layer.

Without Khwan
  • Context

    Starts every session from a blank slate.

  • Conventions

    Re-learns your style and structure each session.

  • Decisions

    Undoes workarounds it forgot the reason for.

  • Model

    Locked to one vendor's context window.

With Khwan
  • Context

    Resumes from what it worked out last time.

  • Conventions

    Per-repo memory holds conventions, with no crossover.

  • Decisions

    Traceability records why each change was made.

  • Model

    Bring any model — Claude Code included.

How it works

The same loop — three calls, your model in the middle.

1Khwan

prepare

Builds the brief — memory + written identity + coherence gate. No LLM call.

2You

your model

You call your own model — your provider, your key. Khwan never touches it.

3Khwan

record

Persists the turn and learns from it — so the next prepare is sharper.

Every run compounds. The brief gets tighter, cost drops, and answers sharpen — the memory that thinks, not just recalls.

A separate brain per repo

Isolated cores mean each repository or client project gets its own memory and identity — selected with a single line. Conventions never bleed from one codebase into another.

Claude Code is the model

In a Claude Code session, Claude itself is the 'your model' step — no key to wire. Khwan slots in as the memory, so Claude remembers across sessions, projects, and people. (One-line connector coming soon.)

Decisions that stick

Traceability records why a change was made, with its source. The next session resumes from what was worked out — not from zero — and the coherence gate keeps it aligned to the project's written conventions.

What you get

Outcomes, not orchestration.

  • No more re-explaining conventions every session
  • Per-repo isolation — no crossover between clients
  • An auditable trace of why the agent did what it did
  • Works with the model you already have

Developers building agents, dev-tool teams, and anyone pairing with Claude Code across many repos.

The whole integration — three calls

agent.ts
import { Khwan } from "@khwan/client";
 
const kw = new Khwan({ apiKey: process.env.KHWAN_API_KEY });
 
// 1 — Khwan builds the context (memory + coherence). No LLM call.
const turn = await kw.prepare(input);
 
// 2 — You call your own model. Your provider, your key.
const answer = await yourModel(turn.messages);
 
// 3 — Hand it back. Khwan persists + learns; next prepare is sharper.
await kw.record(turn, answer);

Start free — feel the compounding before you pay for it.