Skip to content

Open source, MIT licensed, runs on your machine

Muscle memory for AI coding agents.

OpenReflex learns from every task your coding agent finishes. When a similar task starts, it hands the agent what worked before: the approach, the files that mattered, and how the last error was fixed. It notices failure loops while they happen, and it keeps everything on your machine.

$pipx install openreflex

Evaluating the approach?

You are in the Researcher view: how OpenReflex learns, and where it fits among related work.

claude code, with openreflex hooks

Every task leaves a trace your agent can use

OpenReflex listens to your agent's lifecycle hooks. It never reads your files or transcripts; it learns from what the agent did and how it turned out.

  1. 1Before a task

    It hands over what worked

    OpenReflex finds similar past tasks and gives your agent a short briefing: an approach to try, the files that were changed last time, and lessons from earlier attempts. If there is nothing relevant yet, it stays silent.

    [OpenReflex] debug task, 2 similar past tasks, 2 succeeded
    Suggested path: test-first
    Likely relevant files: src/auth/session.py
    Lesson: token expiry failures were fixed in session.py
  2. 2During a task

    It steps in when the agent is stuck

    Repeated failing commands, identical retries, stalled progress and runaway context each raise one specific alert with a different path to try. It speaks up once, not on every tool call.

    OpenReflex: 3 consecutive tool failures.
    Stop retrying the same fix: re-read the error
    and question the assumption behind it.
    Alternative path: inspect-first
  3. 3After a task

    It keeps the lesson

    When the task ends, OpenReflex works out whether it succeeded from the checks that actually ran, compares the path taken with the alternatives, and saves what it learned for next time.

    outcome: success (tests passed after the last edit)
    path taken: test-first
    lesson: changes landed in src/auth/session.py
    lesson: expiry failure resolved by an edit

Connect your agent

Pick your agent. OpenReflex needs Python 3.11 or newer, and nothing is recorded until you enable a project.

  1. 1

    Install the OpenReflex CLI

    $pipx install openreflex
  2. 2

    Add the plugin marketplace

    $claude plugin marketplace add vishnu-77/openreflex
  3. 3

    Install the plugin

    $claude plugin install openreflex@openreflex
  4. 4

    Enable it in each project you want it to learn from

    $openreflex approve

Full setup guide for Claude Code
Check the setup any time with openreflex doctor. Claude Code is verified in live sessions; the other integrations follow each agent's documented hook protocol.

Private by design

OpenReflex is a local SQLite database on your machine. There is no account, no server and no telemetry, and capture stays off until you enable a project.

What it keeps

  • Tool names and a coarse category, such as read, edit or test
  • A fingerprint of each call's arguments, so repeats can be spotted
  • File paths inside the project
  • Whether a call passed or failed, and a short masked error line
  • Your prompt as the task description, with keys and tokens redacted

What it never keeps

  • The contents of your files
  • The commands your agent ran
  • Tool output and logs
  • Conversation transcripts
  • Anything outside the project folder

Stop capture with openreflex revoke, delete a project's data with openreflex forget --yes, or turn it off everywhere with OPENREFLEX_DISABLE=1.

What's shipped

OpenReflex 0.1 is available today. Here is what you get.

On PyPI
Install with pipx, uv or pip. The package is called openreflex.
View on PyPI
Works with four agents
Claude Code, Codex, Cursor and OpenCode, through lifecycle hooks and an MCP server with seven tools.
Read the setup guide
Verified in real Claude Code sessions
An end-to-end suite drives headless Claude Code and checks that context and alerts actually reach the model.
See the test harness
Tested on Linux, macOS and Windows
Every change runs the full suite on Python 3.11, 3.12 and 3.13, plus a clean install of the built package.
View CI
Runs locally
One SQLite file per project, no background service, and hooks that never block your agent.
How data is handled
MIT licensed
Open source and free to use, modify and ship.
Read the license

Execution memory, not conversation memory

OpenReflex treats every task an agent runs as evidence about what works in this codebase. It keeps that evidence as a small graph and turns the verified parts into reflexes the next task can use.

1

It remembers how work went, not what was said

Most agent memory keeps conversation content and summaries. OpenReflex keeps execution: the path an agent took, whether it worked, and the edit that finally resolved an error. That is the part of experience that makes the next attempt shorter.

2

It learns without a model

Every lesson is derived deterministically from lifecycle-hook metadata: tool categories, project-relative paths, pass or fail, and masked error lines. Capturing and learning costs no tokens, and nothing is sent to a model or a server.

3

It only trusts verified outcomes

A task counts as a success only when a test, lint or build passes after the last edit. When nothing verifies the result, the outcome stays unknown and no lesson or regret is drawn from it, so guesses never harden into advice.

4

It chooses between approaches

Before a task, OpenReflex scores candidate strategies (inspect-first, test-first, incremental) on likely success, effort, context cost, risk and reversibility. Afterwards it compares the path taken with the best alternative, which it calls Execution Regret.

5

One memory for every agent in a project

Claude Code, Codex, Cursor and OpenCode all write to the same local Experience Graph. A fix learned in one agent's session is offered to the next agent that meets the same problem.

See one reflex form, step by step, in the graph explorer below.

Open the graph explorer

Watch one reflex form

This is the Experience Graph for a real bug fix, using the same node types and relations the engine stores. Step through it, or select any node to see exactly what OpenReflex keeps.

Hooks record the task and each tool call. The same test run fails three times, a loop alert fires, and an edit to dates.py fixes it.

Where OpenReflex fits

OpenReflex builds on a lot of good work in agent memory and self-improvement. The difference is what it learns from and where that learning happens.

claude-mem[1]

Open-source plugin

Captures what a coding agent does in its sessions and injects relevant context into future sessions. Works with Claude Code, Codex, OpenCode and others.

Compresses captured sessions with an LLM; stores them locally with vector search, with optional cloud sync.

OpenReflex: Learns without a model and never stores session content, only tool metadata, verified outcomes and the fixes that worked.

Mem0 for Claude Code[2]

Plugin

Remembers project knowledge and personal preferences across coding sessions.

Hooks save messages, answers, changed files and test results; Mem0's backend extracts and classifies memories.

OpenReflex: Keeps everything on your machine and records how tasks went rather than what was said.

ReasoningBank[3]

Research, 2025

Distils reusable reasoning strategies from an agent's successful and failed experiences; evaluated on web browsing and software engineering benchmarks.

The agent judges its own trajectories with an LLM-as-a-judge, then retrieves distilled memories for new tasks.

OpenReflex: Judges success by checks that actually passed, and runs as a plugin inside everyday coding agents.

Agent Workflow Memory[4]

Research, 2024

Induces commonly reused workflows from past experience and provides them to guide later actions; evaluated on web navigation.

A language model induces workflows from past trajectories.

OpenReflex: Learns per project from live coding-agent hooks, without a model in the loop.

Agentic Context Engineering[5]

Research, 2025

Treats context as an evolving playbook that accumulates and refines strategies.

Generation, reflection and curation, adapting from natural execution feedback.

OpenReflex: Keeps a structured graph of paths and outcomes and scores alternative strategies, without an LLM curator.

Reflexion[6]

Research, 2023

Agents reflect verbally on task feedback and keep the reflections in an episodic memory buffer for later trials.

Self-reflection text written by the model itself.

OpenReflex: Lessons persist across sessions and agents in a project, and come from verified outcomes rather than self-reflection.

OpenHands Stuck Detector[7]

Agent framework feature

Flags repeating action-observation or action-error cycles, monologues and alternating patterns, and can halt the run.

Pattern checks over a single conversation's event history.

OpenReflex: Works across four agents through their hooks, and an alert can point to a fix learned in an earlier task.

Sources

  1. 1.claude-mem (GitHub)
  2. 2.Mem0 for Claude Code (docs)
  3. 3.ReasoningBank (arXiv 2509.25140)
  4. 4.Agent Workflow Memory (arXiv 2409.07429)
  5. 5.Agentic Context Engineering (arXiv 2510.04618)
  6. 6.Reflexion (arXiv 2303.11366)
  7. 7.OpenHands Stuck Detector (docs)

Descriptions of other projects are summarised from their public documentation and papers as of September 2026. Spotted something out of date? Open an issue on GitHub.