OpenReflex / TLDR

A coding agent should not pay the full exploration cost twice.

OpenReflex is local muscle memory for AI coding agents. It learns the structure of a project without blocking the developer, observes how work is actually completed, closes tasks against verification evidence, and gives later tasks a smaller, better starting context. The aim is not to replay an old trajectory. It is to reduce unnecessary rereading, retries, tool calls and context while preserving verified task completion.

The problem

Agents forget the project

New sessions often rediscover repository structure, reread the same files and reconstruct the same local context.

Success can still be wasteful

A task can finish correctly after avoidable searches, failed commands, oversized context and unnecessary retries.

Raw traces are not memory

Saving every transcript or replaying whole trajectories creates noise. OpenReflex keeps bounded, provenance-aware evidence instead.

The loop

Understand the project, retrieve only what matters, verify the outcome, then reinforce useful evidence.

REFLEXING→
READY→
RECALL→
WATCH→
VERIFY→
REMEMBER

Project Primer

Starts in a detached worker so Claude does not wait for repository understanding. It builds bounded project memory and refreshes stale facts without putting Git, SQLite or indexing work on the statusline path.

ReflexIndex

Combines structural project memory with execution evidence. Unknown outcomes do not train it. Repeated Stop/SessionEnd events cannot double-count an execution, and later explicit verification upgrades confidence rather than inventing a second run.

Outcome closure

If edited work has not been verified, OpenReflex can request one verification continuation. Unknown outcomes are shown as UNVERIFIED, failures as FAILED, and only known successful outcomes as COMPLETE. Regret is never shown for an unknown outcome.

Statusline + TUI

The Claude statusline reads cached state only and follows live PreToolUse activity. The optional TUI exposes lifecycle, project-memory health, versions, known outcomes, verified outcomes and the evidence OpenReflex has accumulated.

Work modes / 0.5.0

BUILD, INVESTIGATE and THINK are different jobs. OpenReflex stops treating them the same.

Coding tasks still get inspect-first, test-first and incremental paths. Investigation gets its own paths — source-first, cross-check, broad-then-deep — and reasoning gets reason-first, compare-options and evidence-first. Substantive zero-tool reasoning and investigation now count as real executions, and recommendations stay separate from observed paths so OpenReflex never claims a suggested path ran when it was not actually observed.

A /loop or scheduled or background task now shows WAITING instead of being finalised early, and resumes the same execution when the next matching scheduled iteration runs. The confusing numeric comparison language is gone: the runtime shows a plain Path check, either a better option backed by comparable completed tasks, or none proven.

Claude statusline
↺ OpenReflex v0.5.0 INVESTIGATE
project · READ README.md · 4 calls · 8.3k tokens
↺ OpenReflex v0.5.0 THINK
project · reasoning · 0 calls · 4.2k tokens
↺ OpenReflex v0.5.0 WAITING
project · 1 scheduled
completion
success · cross-check
7 calls · 18.2k model tokens · 2.5m
Path check · better option: none proven

Real model-token accounting

An opt-in local receiver on 127.0.0.1:4319 reads Claude Code's documented api_request OpenTelemetry data and stores input, output, cache-read and cache-creation token counts, model and main/subagent source, and estimated cost. Prompts, responses, thinking, tool arguments and raw API bodies are never collected.

Token samples, not a schema rewrite

Token samples live in their own table alongside the existing Experience Graph database, so a 0.4.x project upgrades without rewriting existing graph nodes. The status line and TUI show real model tokens when available, and legacy tool-output estimates stay labelled separately rather than being mixed in.

Runtime / 0.4.1

The line in Claude should say what OpenReflex is doing now.

OpenReflex tracks tool start and completion separately. The statusline can therefore show safe coarse activity such as READ, SEARCH, EDIT, TEST, LINT, BUILD, GIT, WEB, MCP or RUN while a task is active, instead of only showing a generic completed-call count.

Project-relative file targets may be shown, but raw shell commands are never echoed into the statusline. A new task resets previous call/activity state, and an active task moves from RECALL to WATCH rather than looking READY while Claude is still working.

Claude statusline
↺ OpenReflex v0.4.1 RECALL
3 related · inspect-first
↺ OpenReflex v0.4.1 WATCH
READ charts/app/values.yaml · 4 calls
↺ OpenReflex v0.4.1 VERIFY
LINT · 5 calls
completion
success → COMPLETE
failure → FAILED
unknown → UNVERIFIED

Reload-aware versions

Claude plugin, OpenReflex package and MCP runtime versions are tracked separately. Reloading plugins can therefore prove which plugin/MCP version became active instead of assuming the whole stack updated together.

Mismatch is visible

If Claude loads a newer plugin but the executable or MCP runtime is stale, the TUI reports VERSION MISMATCH. Matching package, plugin and MCP versions report ALIGNED.

Project Map / 0.4.0

Cold-start memory without turning the repository into a giant vector dump.

Project Map indexes tracked paths, file roles, languages, lightweight top-level symbol names, declared dependencies, Git hotspots and bounded co-change relationships. Nested Helm, Node, Python, Go and Rust manifests are indexed with project-relative provenance, which matters for monorepos and multi-chart repositories.

Source bodies are read transiently where needed for extraction but are not persisted in the structural map. Retrieval mixes path and symbol overlap with small structural signals and stronger observed execution support. Verified execution remains more authoritative than repository history.

task
↓
path + identifier match
↓
dependency + role signal
↓
hotspot + co-change prior
↓
observed execution support
↓
verified execution support
↓
bounded task context

Evidence hierarchy

OpenReflex separates what the repository suggests from what executions actually proved.

01

Repository structure

Paths, roles, manifests and project topology are structural priors.

02

Symbols + dependencies

Top-level symbol names and declared dependencies improve cold-start localisation.

03

Git history

Hotspots and bounded co-change relationships add a small structural signal.

04

Observed execution

Known task outcomes reinforce the files and paths that actually mattered.

05

Verified execution

Explicitly verified success is the strongest reusable evidence.

Privacy boundary

Local by default

Project memory lives in the existing per-project OpenReflex store on the developer machine. The workflow remains: install OpenReflex, start the coding agent, work normally.

Derived metadata, not a transcript archive

Project Map persists project-relative paths, roles, symbol names, dependency names, fingerprints and aggregate Git signals. It does not persist raw source bodies, diffs, command output or agent transcripts in the structural map. Plugin cache paths are not persisted by version diagnostics.

What exists in 0.5.0

Managed project memory

Non-blocking Project Primer, provenance-aware project facts, staleness handling, bounded retrieval and explicit separation between structural priors and execution evidence.

Verified execution memory

Outcome closure, verification-aware reinforcement, unknown-outcome non-training, idempotent evidence updates, Helm/Kubernetes verification and corrected reuse-rate semantics.

Indexed Project Map

Paths, symbols, nested manifests, dependencies, hotspots and co-change relationships feed compact cold-start context while the statusline and TUI stay cache-only on their render path.

Truthful runtime UI

Live operation state, accurate COMPLETE / FAILED / UNVERIFIED semantics, reload-aware package/plugin/MCP versions, ALIGNED or VERSION MISMATCH diagnostics, and per-task call/activity reset.

Work modes beyond coding

BUILD, INVESTIGATE and THINK paths, substantive zero-tool reasoning and investigation counted as real executions, and a plain Path check instead of numeric regret comparisons.

Real token accounting

Opt-in local Claude Code token accounting from documented OpenTelemetry data, stored in its own schema-v2 table so existing 0.4.x databases migrate without rewriting graph nodes.

The measurement that matters

Past work should measurably improve future work.

OpenReflex carries a deterministic cold-start CI benchmark for target-file localisation, target rank, nested-manifest evidence, structural-evidence labelling and injected-context size. It is intentionally model-free: passing it proves the Project Map retrieval contract, not causal token or time savings.

The next evidence layer is live-agent evaluation: compare exploration and search calls, tool calls, context tokens, elapsed time and verified completion on matched tasks. That is the standard required before claiming real efficiency gains.

OpenReflex is not trying to make an agent agree with its memory. It is trying to make useful prior evidence reduce the cost of the next correct execution.