↺ OpenReflex · 82
4 experiences · test-first 71%
~23 calls · ~18k tokens · +186 context tokens
Visible once when a substantial task begins.
Open source, MIT licensed, runs on your machine
AI coding agents often solve the task, but not efficiently: they search the same code again, reread files, retry failed commands and keep going after the evidence is in. OpenReflex learns how each task gets done, recommends a more efficient path for the next one, and tells the agent when to continue, pivot or stop. Everything stays on your machine.
pipx install openreflexEvaluating the approach?
You are in the Researcher view: how OpenReflex learns, and where it fits among related work.
OpenReflex runs alongside Claude Code, Codex, Cursor and OpenCode through plugins, lifecycle hooks and MCP. Install it once and keep working normally. It never reads your files or transcripts; it learns from what the agent did and how it turned out.
1Before a task
OpenReflex finds similar past tasks and compares candidate approaches by expected success, time, tool calls, context cost, risk and uncertainty. Your agent gets the best path, a budget, the files that mattered 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 (success~95%, ~14 tool calls)
Alternatives: inspect-first (dominated by test-first)
Budget: ~31 tool calls, ~20 min, ~30k tokens
Likely relevant files: src/auth/session.py2During a task
Repeated failures, excessive exploration, context growth and stalled progress are caught as they happen. OpenReflex then weighs whether more work on the current path is still worth it, and recommends continuing, pivoting to another approach, or stopping to check in with you. It speaks up once, not on every tool call.
OpenReflex: 15 calls over 5 min without a successful edit or check (only read).
Recommendation: pivot to test-first (success estimate ~24% on inspect-first, ~95% for test-first, budget 52% used)3After a task
When the task ends, OpenReflex works out whether it succeeded from the checks that actually ran, compares the chosen route with plausible alternatives, and feeds both into the next recommendation.
outcome: success (test passed after the last edit)
path taken: test-first
regret: 0.0 against inspect-first
lesson: "AssertionError: expired token accepted" was resolved by an edit in src/auth/session.pyThe goal is simple: help your agents reach the same or better results with fewer unnecessary tool calls, less context, less time and less repeated work.
Pick your agent. OpenReflex needs Python 3.11 or newer, and nothing is recorded until you enable a project.
Install the OpenReflex CLI
pipx install openreflexAdd the plugin marketplace
claude plugin marketplace add vishnu-77/openreflexInstall the plugin
claude plugin install openreflex@openreflexEnable it in each project you want it to learn from
openreflex approveFull setup guide for Claude Code
Check the setup any time with openreflex doctor. Claude Code and Codex are verified in live sessions; Cursor and OpenCode follow each agent's documented hook protocol.
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.
Stop capture with openreflex revoke, delete a project's data with openreflex forget --yes, or turn it off everywhere with OPENREFLEX_DISABLE=1.
OpenReflex is MIT licensed and available on PyPI. Here’s what ships in the current release.
OpenReflex studies whether evidence from prior executions can help coding agents use computation more deliberately during a task. This page documents only research ideas that are already represented in public releases.
Research question
Can verified execution experience improve how a coding agent chooses a path, spends its budget and responds when progress deteriorates?
Claim boundary
Public claims are limited to behaviour and evidence present in tagged OpenReflex releases. Unreleased methods, experiments and research directions are intentionally not described here.
Retrieve comparable verified executions from the project-local Experience Graph.
Estimate candidate execution paths under success, cost, risk, uncertainty and reversibility constraints.
Observe execution progress and estimate whether continuing, pivoting or stopping has higher expected utility.
Persist verified outcomes and estimated execution regret to update later path priors.
The developer-facing idea remains simple: useful execution memory should make the agent feel more effective. The researcher view exists to document what has been released, how it is measured and where its claims sit relative to prior work.
OpenReflex does not claim novelty for agent memory, budget awareness or runtime control in isolation. The public research position is restricted to the combination and evidence already present in released versions.
Related work
Historical coding trajectories can already be abstracted into reusable plans through STAIR[1]. Budget-aware agents can adapt planning under resource constraints through BATS[2]. Runtime controllers for coding agents are evaluated by LoopArena[3], while learned harness control has also been formalised with a frozen executor[4]. Evidence-conditioned execution systems such as ECLoop further show that runtime intervention is an active research area[5].
Released position
OpenReflex currently combines project-local execution experience, multi-objective path selection, execution budgets, runtime continue / pivot / stop recommendations, and observable decision evidence. These are treated as an experimental system design rather than as individually novel primitives.
Selected references
OpenReflex separates what the coding agent needs to know from what the developer needs to see. Routine guidance stays in the agent context; only the start, a consequential policy change, and completion become compact user-facing recaps.
Execution recap · v0.3
Plan → observe → intervene → learn.
↺ OpenReflex · 82
4 experiences · test-first 71%
~23 calls · ~18k tokens · +186 context tokens
Visible once when a substantial task begins.
↺ OpenReflex · 64 ↓18
11/23 calls · 2 failures · confidence 71→52%
inspect-first now leads · recommendation → pivot
Visible only when the execution policy materially changes its recommendation.
↺ OpenReflex · COMPLETE
success · test-first
18 calls · 14.2k tokens · 6.4m
regret 0.05 vs inspect-first
Closes the visible loop with realised path, observed cost and comparison route. Reusable lessons are stored immediately after completion.
| Mode | Claude receives | Developer sees | Used for |
|---|---|---|---|
| Ambient | additionalContext | Silent | Retrieved experience, likely files, normal execution guidance |
| Recap | additionalContext | systemMessage | Task start and completion |
| Intervention | additionalContext | systemMessage | Pivot, stop, budget pressure, failure loop or material degradation |
This section is retrospective by design. It records the research-relevant behaviour that is already public, shipped and inspectable. New entries are added only when a release makes the corresponding evidence available.
The released instrumentation was hardened so malformed or context-poor activity does not contaminate the explanation surface.
The public interface was tightened so research-facing concepts have explicit meanings and stored experience remains user-removable.
Execution recommendations became inspectable rather than opaque, separating recommendation strength from estimated task success.
OpenReflex moved from retrieval alone toward execution optimisation by treating agent work as a constrained multi-objective process.
This is not a forward roadmap. Ongoing research, unreleased implementation details and future experiments remain private until they are ready to be introduced with a public release and supporting evidence.
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.
Three published studies shaped how OpenReflex works. Each is quoted from the paper itself, next to what OpenReflex takes from it and where it goes its own way.
“…we find that failed trajectories are consistently longer and exhibit higher variance than successful ones, with failure patterns differing significantly between agents.”
Majgaonkar, Fei, Li, Sarro and Ye (2025). Understanding Code Agent Behaviour: An Empirical Study of Success and Failure Trajectories arXiv:2511.00197, abstract.
In the paper's own measurements (Section 4.2), failed trajectories took between 12.6% and 82.5% more steps than successful ones, depending on the agent (OpenHands, SWE-agent or Prometheus) and the SWE-Bench split.
What OpenReflex takes from it
OpenReflex watches the shape of a run while it happens: identical calls repeated, failures in a row, long stretches without a successful edit or check, and work past the task's budget. When none of those appear, it stays silent.
“…with the majority of agentic failures stemming from flawed reasoning and cognitive deadlocks.”
Liu, Liu, Li, Tan, Zhu, Lian and Zhang (2025). An Empirical Study on Failures in Automated Issue Solving arXiv:2509.13941, abstract.
The authors respond with a second, supervisory agent that provides strategic oversight and course-correction for the agent doing the work.
What OpenReflex takes from it
OpenReflex also corrects course from outside the agent, but without a second model. Its recommendation to continue, pivot or stop is computed from lifecycle-hook signals and verified outcomes, and it is advice the agent can weigh, never a block on its tools.
“We propose Reflexion, a novel framework to reinforce language agents not by updating weights, but instead through linguistic feedback.”
Shinn, Cassano, Berman, Gopinath, Narasimhan and Yao (2023). Reflexion: Language Agents with Verbal Reinforcement Learning arXiv:2303.11366, abstract.
What OpenReflex takes from it
OpenReflex likewise works through text placed in the agent's context rather than through training. It differs in where that text comes from: Reflexion agents write their own reflections and reuse them on later trials, while OpenReflex derives its context deterministically from hook metadata and checks that actually passed, and keeps it across sessions and across agents.
OpenReflex is an independent open-source project. It is not affiliated with the authors of these papers, uses none of their code, and is not an implementation of Reflexion; its name comes from reflexes, the learned responses it builds up for a project. Numbers quoted here describe the papers' own experiments, not OpenReflex.
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.
| Work | What it does | How it learns or detects | How OpenReflex differs |
|---|---|---|---|
| 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. | 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. | 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. | Judges success by checks that actually passed, weighs execution cost as well as success when choosing a path, and runs 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. | 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. | Keeps a structured graph of paths and outcomes, picks among Pareto-efficient strategies within a budget and records regret, 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. | 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. | Works across four agents through their hooks, weighs whether more work is worth it (continue, pivot or stop), and can point to a fix learned in an earlier task. |
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.
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.
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, weighs execution cost as well as success when choosing a path, and runs inside everyday coding agents.
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.
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, picks among Pareto-efficient strategies within a budget and records regret, without an LLM curator.
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.
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, weighs whether more work is worth it (continue, pivot or stop), and can point to a fix learned in an earlier task.
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.