explaingit

tree-trace/treetrace

Analysis updated 2026-05-18

31JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A local CLI that captures how you correct an AI coding agent during a session and turns those corrections into regression tests, lessons, and memory for the next session.

Mindmap

mindmap
  root((TreeTrace))
    Capture
      Session Tree
      Corrections
      Abandoned Paths
    Outputs
      Failure Log
      Eval Cases
      Lessons File
      Agent Memory
    Security Focus
      Auth Changes
      Leaked Secrets
      Skipped Tests
    Design
      Local Only
      Rule-based
      MCP Server

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Turn corrections you gave an AI coding agent into reusable regression test cases for CI.

USE CASE 2

Flag moments where an agent touched authentication code, leaked a secret, or skipped a test, and record the fix.

USE CASE 3

Give the next AI agent session a compact memory file summarizing past constraints and decisions.

USE CASE 4

Generate a human-readable report and prompt tree showing how a session was steered.

What is it built with?

JavaScriptNode.jsMCP

How does it compare?

tree-trace/treetraceforgetmeai/freedeepseekapimattpocock/boilersuit
Stars313131
LanguageJavaScriptJavaScriptJavaScript
Last pushed2018-10-26
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires Node.js 18 or newer, runs entirely locally with zero runtime dependencies and no uploads.

Apache 2.0 license: use freely for any purpose, including commercial use, with patent protection, as long as you keep the copyright notice.

In plain English

When you work with an AI coding agent, you spend time steering it: correcting a wrong assumption, pulling it back from a risky approach, repeating a constraint it ignored, or redirecting it after it went down a dead end. That steering information disappears at the end of the session. TreeTrace captures it locally and converts it into regression tests, failure records, and a memory pack the next agent can read before it starts. You run npx treetrace inside your project directory. It finds Claude Code session files automatically, or you can point it at any conversation file with a flag. It builds a tree of the session: which paths were accepted, which were abandoned, where corrections happened, and what the correction said. From that tree it produces several output files. The failure log records moments where the agent did something problematic and what fixed it. The eval file contains model-agnostic test cases that a CI system or eval harness can check against. The lessons file summarizes what went wrong. The agent memory file is a compact document the next agent can read so it starts the session already aware of past constraints and decisions. Security tracking is a specific focus. The tool watches for moments when an agent touched authentication code, printed a secret, loosened access control, skipped a test, or introduced a potential injection point. When it finds one of those patterns and a human correction follows, it records the pair as a regression eval so the same mistake can be caught in future sessions. All analysis is done locally using rule-based heuristics, not an AI model. There is no judge, no API call, and no upload. Secrets found in the output are flagged and must be resolved before any files are written. The tool has zero runtime dependencies and works on Node.js 18 or newer. An MCP server is included so AI coding tools can query the stored memory and eval data during a session without leaving the tool.

Copy-paste prompts

Prompt 1
Run npx treetrace in my project to analyze my last Claude Code session and generate a failure log and lessons file.
Prompt 2
Explain how to build a tool that parses AI coding assistant transcripts into a tree of accepted and abandoned paths.
Prompt 3
Show me how to detect when an agent touches authentication code or prints a secret using rule-based heuristics, not an LLM.
Prompt 4
How do I write local, model-agnostic regression eval cases from real corrections a human made to an AI agent?
Prompt 5
Show me how to build an MCP server that lets an AI coding tool query stored session memory during a live session.

Frequently asked questions

What is treetrace?

A local CLI that captures how you correct an AI coding agent during a session and turns those corrections into regression tests, lessons, and memory for the next session.

What language is treetrace written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js, MCP.

What license does treetrace use?

Apache 2.0 license: use freely for any purpose, including commercial use, with patent protection, as long as you keep the copyright notice.

How hard is treetrace to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is treetrace for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.