CLEAR

CLEAR (Context Layering & Engineering for Agentic Resources) is a Claude Code plugin that gives coding agents memory across sessions. It pairs a self-maintaining, code-bound knowledge base, formalized as the CLEAR Knowledge Spec (CKS), with a structured plan → schedule → act → manage workflow, so the right context reaches the right agent at the right time and work stays on track from one session to the next.
Problem
Coding agents start every session cold. Whatever got decided last time, the patterns that were set, the dead ends already ruled out, none of it survives the context window closing. So the agent re-derives what it already knew, or worse, contradicts a decision made a week ago because nothing told it the decision existed. The usual patch is a memory file or a running notes doc, and it helps right up until it rots: the notes say one thing, the tracker says another, and the knowledge is stale because keeping it current is a separate chore nobody keeps up. The agent can reason fine. What it's missing is context that's bound to the work, kept current, and there the moment it matters.
Users & JTBD
Solo developers on multi-session projects who need real continuity instead of re-explaining context every morning. Knowledge-intensive builds where decisions, patterns, and lessons have to persist, stay fresh, and stay discoverable against the code they concern. And, practically, users on Claude Max and Enterprise plans, because capture runs on tool use and rewards a generous token budget.
The jobs they hire CLEAR to do:
| When... | I want to... | So I can... |
|---|---|---|
| I start a session after days away from the project | resume with everything I decided and where I stopped already loaded | keep building instead of re-briefing the agent from scratch |
| I'm about to change a file I haven't touched in weeks | see the decisions and patterns bound to that code surface on their own | avoid breaking a past decision I've forgotten I made |
| I make an architectural call or learn something the hard way | have it captured and tied to the code without stopping to write docs | keep my knowledge current without it becoming a second job |
| a decision I recorded earlier gets overtaken by a newer one | have the old one flagged as superseded rather than served as truth | trust the agent is never acting on stale guidance |
| I wrap up for the day | leave a clean handoff the next session reads on its own | start the next session continuous with this one, not cold |
Solution
Start with what actually breaks. Most attempts to give an agent memory store some notes and call it done. But storing notes is the easy part. Keeping them true as the code changes is the hard part, and it's the part everyone skips, because maintaining a knowledge base by hand is a second job on top of building the software. CLEAR's answer is a knowledge base that maintains itself.
It works like this. As you build, CLEAR captures the things worth remembering, the decisions made, the patterns that emerge, the lessons learned, the business rules, and writes each one as a typed markdown file bound to the code it concerns. It's diffable markdown living in your repo, with no database server and no Neo4j to run. Bound is the operative word. Touch that file again next week, or next month, and the decision attached to it surfaces on its own. You never went looking for it.
What makes it a living system rather than a folder of notes is what happens as the code moves on. Every piece of knowledge carries a lifecycle. A newer decision supersedes an older one, with the link recorded both ways so you can trace what replaced what. A rule that stops being true gets deprecated. When a superseded or deprecated concept would be served, CLEAR surfaces it as exactly that, so an agent is never handed stale guidance dressed up as current truth. And all of it happens as a byproduct of the work. You don't curate the knowledge base. Building the software curates it.
Driving that capture is an explicit development loop: plan → schedule → act → manage. A plan holds intent as phases and milestones. A workpackage is a trackable unit of work whose progress is computed from the real files that appear as you build. Act is ordinary building, where knowledge gets captured and bound as you go. Manage is the session handoff, a structured summary the next session reads on startup, so session N+1 continues from session N instead of starting cold. The loop is the engine. The self-maintaining knowledge base is what it produces.
Underneath, one decision holds the whole thing together: a single writer for every piece of state. The failure mode of naive memory systems is silent disagreement, the notes saying one thing and the tracker another, handing the agent a contradiction it can't see. CLEAR routes every state change through one authoritative writer, so the status view, the plan file, and the workpackage records can't drift apart. A shared context layer then assembles the right knowledge and state and hands it to the agent at the moments that matter, at session start, when a bound file comes into play, on each turn. The agent is served its context. It doesn't have to ask.
None of this is welded to Claude Code. The knowledge format, the state model, and the CLIs are harness-agnostic; Claude Code is the first adapter, not a requirement, and a port to Codex, Cursor, Aider, or Gemini CLI reimplements only the thin adapter shell.
There's one more thing, and it's where the story turns. That capture format has a name: CKS, the CLEAR Knowledge Spec. It's a standalone specification, seven first-class knowledge types, a status lifecycle, and a defined pattern for how knowledge is bound and served, hardened across eight schema revisions. CLEAR has been running it since 2025. Then, in June 2026, Google open-sourced the Open Knowledge Format, a v0.1 draft for markdown-native, typed, resource-bound knowledge. It described, as a draft, the model CLEAR had already been shipping as a working superset, lifecycle and all, for over a year. Two independent roads arriving at the same model is the kind of validation that says CLEAR was worth building, is worth using, and is worth taking further.
Outcome
CLEAR v1.0 is public, open-sourced under Apache-2.0, chosen over MIT for its explicit patent grant, and live on npm as @qball-inc/clear with an interactive walkthrough deck. It's a stable, state-correct lifecycle surface: a persistent, code-bound knowledge base plus plan, workpackage, and session management, held together by the single-writer model so every surface agrees. The public repo is a mirror of a private development repo, with issues and PRs pulled in and synced back so the two don't diverge.
The next major release is a ground-up rewrite. Today's core is a mix of bash and TypeScript CLIs; the rewrite collapses both into a single Rust binary, which makes execution dramatically faster and the install a single artifact. Past that, the roadmap is public and honest about being direction, not commitments: knowledge beyond code (people, places, organizations, and events as first-class primitives), selective hardening from OKF, verification-method and confidence on concepts, and harness adapters past Claude Code.
Highlights
- A knowledge base that maintains itself: decisions, patterns, and lessons captured as you build and kept fresh with no curation step
- CKS, the CLEAR Knowledge Spec: a formal schema for typed, code-bound knowledge as diffable markdown files, with no database server
- A full lifecycle (supersession, deprecation surfacing, pruning) so the agent is never handed stale guidance dressed up as current truth
- A plan → schedule → act → manage loop that drives capture; workpackage progress computed from the real files that appear as you build
- A single-writer state model, so the status view, plan, and workpackage records can't drift into disagreement
- A harness-agnostic core: Claude Code is the first adapter, portable to Codex, Cursor, Aider, and Gemini CLI
- Convergent validation: Google's OKF (June 2026) independently confirms the schema CLEAR has shipped as a superset since 2025
- Open-source (Apache-2.0), live on npm as @qball-inc/clear, v1.0; next release rewrites the core as a single Rust binary for speed