DEV Community

Asklear Hank
Asklear Hank

Posted on

Your team's real engineering record is the AI sessions you delete every day

Your team's real engineering record isn't in your commit history. It's in the AI sessions everyone closes and forgets every day.

A commit says "refactor auth." It doesn't tell you which two approaches you tried, which one broke, which doc settled the call, or why you rejected the obvious path.

That "how we actually decided this" always got lost. It only ever lived in someone's head, never written down.

That changed. Your team writes code with Claude Code and Codex now, and all of those judgment calls are, for the first time, recorded in full. They're in the session. And then the tab closes and they're gone.

I've hit this myself more than once. I couldn't remember why a module was split the way it was, the commit and the PR said nothing, and I finally found the reasoning in one of my own sessions from months back. It only existed there, and it almost went with the tab.

What a session actually is

Worth being precise about, because it's the whole point.

An AI session isn't a chat log. It's a transcript of a problem being solved: what got tried, what broke, which docs it read, the judgment in every turn. It's also pinned to the exact git repo you were working in.

Put another way, a session is roughly all the context it took to do the thing, packed into one unit.

That's a step up from commits and PRs. A commit is a lossy summary a human wrote afterward. A session is a recording of the work as it happened. We've never had this before.

The catch: it lives in one person's local chat and dies when they close the tab. So your team is now producing the best engineering record it has ever had, and deleting it daily.

Why this matters if you run a team

Three concrete costs.

Someone leaves, and the "how" leaves with them. Their replacement inherits the code, not the reasoning nobody kept. Bus factor was never about the hands. It was about the head.

New hires can only read conclusions, not replay the process. A full session lets someone see how a thing was figured out, not just what it ended up looking like.

Decision archaeology has nowhere to dig. Six months later someone asks "why did we build it this way," and the answer is either in the original record or in a meeting nobody remembers. Right now it's the meeting.

And here's the part that matters most: keeping this record costs nobody any extra work.

Knowledge bases always failed for one reason. They asked the busiest person to find time to write docs. Not this time. The best record is a byproduct of people just doing their work. The only thing you have to do is stop deleting it.

The rest is an engineering problem: how to keep the team's sessions, pool them into one place, and make them searchable. Here's how. Trying it solo first takes about five minutes.

What you'll have by the end

  • A git repo that automatically collects your local AI sessions, redacted, stored as full transcripts
  • The ability to ask about the team's history in plain English from Claude Code, over MCP
  • A set of commands you can copy and run, working locally in about five minutes
  • A path from "trying it alone" to "the whole team shares it"
  • A clear sense of when it's worth it, when it isn't, and where the data lives

The tool is open source, Apache-2.0, called Klear-Team-Brain. Want to see the finished state first? The repo README has the same commands you're about to run.

What you need

Node 22+, and an MCP-capable editor or CLI. Claude Code, Codex, Cursor, Cline, Gemini CLI all work the same way.

You'll also want some existing Claude Code / Codex sessions to capture. If you've used either tool at all, they're already in ~/.claude and ~/.codex.

After that, just a terminal. No database, no Docker unless you want it, no cloud account.

Why pulling this record together by hand is miserable

Before reaching for a tool, picture doing it manually.

Your sessions live as JSONL files in ~/.claude and ~/.codex, one file per conversation. If you've ever opened one you know the state of it: raw tool calls, base64 images, huge pasted blobs, all mashed together.

To make any of it usable you'd pick out the relevant ones, scrub the secret you definitely pasted at some point (we've all done it), and squash each into something readable.

And that's just yours. For the team to benefit you'd gather everyone's, then build some way to search across all of it.

By hand, for a whole team, forever. Nobody does this. That's why the best record keeps rotting on individual machines.

I tried keeping just my own by hand once. Scrubbing the secrets I'd pasted out of each transcript was enough to make me quit.

The rest of this makes it automatic and the result something you query in plain language:

  • By hand: find sessions, scrub secrets, squash to readable, gather everyone's, build search, repeat forever
  • With this: a background collector captures and redacts; the result is a git repo your editor can already search; you ask in English

Let's build it.

1. Clone it, mint a local identity

We'll run it solo on your own machine first. It's the fastest way to see the result, and nothing leaves your laptop.

git clone https://github.com/Asklear/Klear-Team-Brain.git && cd Klear-Team-Brain
npm install
npm run quickstart
Enter fullscreen mode Exit fullscreen mode

quickstart is a one-time thing. It mints a local identity and token, points the client at localhost, and wires up MCP for you. What MCP is comes in step 4.

2. Start the truth store

The "truth store" is the git repo that holds your sessions. Start the server and leave it running:

npm run server   # serves at http://127.0.0.1:8787 β€” leave this terminal open
Enter fullscreen mode Exit fullscreen mode

That's the whole backend: one git repo, one Node process, a static frontend. No database, no queue, no vector store.

Queries run on git grep, so the server never calls an LLM, not once. The understanding happens in the agent inside your editor, not here.

To confirm it's up, open http://127.0.0.1:8787/. You'll get a dashboard. Empty for now.

3. Capture your sessions

In a second terminal (leave the server running in the first one), grab the AI sessions on your machine:

npm run sync -- --once
Enter fullscreen mode Exit fullscreen mode

This walks your ~/.claude / ~/.codex history, squashes each session (inline images stripped, oversized tool outputs truncated, signal not bytes), strips secrets and home-directory paths client-side before anything gets written, and commits each one into the truth store.

Drop the --once and run npm run sync and it stays resident, capturing new sessions as they settle.

Refresh the dashboard. Your sessions should be listed now.

4. What that MCP step actually connected

Back in step 1, quickstart quietly connected the truth store to Claude Code over MCP. Think of MCP as a USB-C port for AI apps: a standard way for an agent to plug into an external tool. Here the tool is your truth store.

Don't take my word for it. Check:

claude mcp list
Enter fullscreen mode Exit fullscreen mode

You should see team-brain listed and connected.

To wire up a different editor (Codex, Cursor, and so on), the MCP server is a plain stdio binary. Run brain mcp and it prints the exact command for your machine, which looks like:

# this is what quickstart registered; shown so you can add it to any other MCP client
claude mcp add team-brain --scope user -- node /absolute/path/to/Klear-Team-Brain/mcp/server.mjs
Enter fullscreen mode Exit fullscreen mode

Use the absolute path brain mcp gives you, and restart the editor after adding it.

5. Ask in plain English

This is the fun part. In Claude Code, just ask. No special syntax:

Where did I leave the auth refactor, and what was still unresolved?
Enter fullscreen mode Exit fullscreen mode

The agent treats the truth store as a read-only folder and uses a few Unix-style tools to dig through it:

Tool What it does
grep regex full-text search across sessions, via git grep
find find files by name or glob
read read any file by path
ls inspect structure: spaces, branches, session counts
sessions find sessions by person and work time
stats aggregate token/session/turn counts by day/person/repo
log the git activity timeline
read_github fetch live code state from GitHub/GitLab/Gitea on demand

So your one-line question becomes grep for "auth", read the sessions it hit, then synthesize.

The answer cites the specific sessions it drew from, the dead ends and judgment calls that never made it into a commit message included.

What's really changed is how the team works. Both of these normally mean finding the right person, hoping they remember, and taking half an hour of their day:

Who's been touching the ETL code this week?
How did we decide the billing schema, and what did we reject?
Enter fullscreen mode Exit fullscreen mode

Now they're a query.

What's happening under the hood, and why I trust it with team data

Worth being precise here, because it's the part that decides whether you'd hand it your team's work.

It's read-only. Every server-side query goes through git grep, git ls-files, git log, or a plain file read, via execFile, no shell, locked inside the truth-store directory. The tools can read. They can't write, and they can't run arbitrary commands.

The server never calls a model, not once. It just hands text to the agent in your editor, which does the reasoning. That's why it runs fine on a tiny VPS later. It isn't doing the heavy work.

The data is a git repo. You can cd into it and read everything with normal tools. No proprietary format, no lock-in. If you walk away tomorrow, you still have a clean, redacted record of your team's thinking.

What it doesn't do, and when to skip it

Some honesty.

It's not a chatbot and it's not a project manager. It aggregates the team's sessions, code, and docs and helps you understand them. It won't assign work, and it doesn't replace Slack.

If you work solo and you have a good memory, you probably don't need it. The value grows with team size and time, not on a one-person weekend project.

And it captures AI sessions, not your whole job. The reasoning you did in your head or settled in a meeting isn't in there. That said, the share you type to an AI keeps growing, which is the whole point.

On data, to be clear: only directories you explicitly allowlist get uploaded. Secrets are redacted client-side before anything leaves your machine. You can run brain viewer to see exactly what was captured per session and retract anything you don't want shared.

The whole thing is self-hosted, so when you take it to your team it lives on infrastructure only your circle can reach. If your team's sessions touch sensitive data, "read-only, self-hosted, redacted at the source" is the part that matters most.

From trying it alone to the whole team

The solo run above is the real thing, scoped to one person.

To turn it into the shared memory, you stand up the same server on one small VPS (low memory is fine), and each teammate points their client at it:

curl -fsSL https://your-server.example.com/get | bash   # installs the client + the `brain` command
brain join <YOUR_INVITE_TOKEN>                           # verify, pick workspaces, wire MCP, first sync
Enter fullscreen mode Exit fullscreen mode

After that the collector runs in the background and everyone's sessions flow in on their own. The people doing the work do nothing, and their reasoning still lands in the shared memory; the people who want to understand just ask.

Full server setup (TRUTH_DIR, roster, tokens, HTTPS, running as a service, Docker) is in the repo's DEPLOY.md.


I built Klear-Team-Brain because I was tired of my team's most valuable judgment calls getting deleted every day by a closing tab. It's open source and self-hosted. There's nothing to sign up for.

If this is your problem too, the repo is here: https://github.com/Asklear/Klear-Team-Brain. A star genuinely helps it reach the next team with the same problem. And if you try it and something's rough, an issue helps me more.

Top comments (0)