OpenReflex

io.github.vishnu-77由 GitHub 帳號 vishnu-77 發布v0.10.1更新於 Oct 30, 2026

Optional diagnostics MCP server for OpenReflex's ambient project muscle memory.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

OpenReflex 的診斷與管理 MCP 介面,用來檢視本機編碼代理的專案記憶、決策依據與執行軌跡。

可以做什麼
  • 檢視過往工作:依描述相似度搜尋過去任務與其經驗教訓、查看單一經驗圖譜節點及其關聯,並彙整專案已記錄與學到的內容。
  • 回顧決策:解釋最近一次建議、讀取 Reflex Score 及其組成、並列檢視候選路徑,以及顯示最近任務的決策時間軸。
  • 手動規劃與追蹤:取得任務執行脈絡、判斷是否值得繼續、宣告實際採用的路徑,並記錄已確認的結果。
  • 管理記憶:為專案開啟擷取,或刪除某一筆過往任務記憶,兩者都只在使用者明確要求時使用。
適用情境
適合已使用 OpenReflex、想向助理詢問它學到什麼、某次建議為何產生,或查看執行軌跡的使用者。日常編碼工作不需要這些工具,OpenReflex 會透過生命週期掛鉤自動運作。
執行需求
透過 uvx 從 PyPI 套件 openreflex 以本機 stdio 程序執行,需要 Python 3.11 或更新版本。不需要帳號、API 金鑰或託管服務。資料保存在本機 SQLite 資料庫中。僅支援桌面端。
安裝前請注意
approve_project 會為該專案開啟擷取,forget_experience 會刪除已儲存的任務記憶,兩者都只應在使用者明確要求時呼叫。擷取會保存任務描述(最多 1,000 字元,機密資訊已遮蔽)、專案相對路徑、工具名稱與錯誤簽章等粗略中繼資料,開啟前請先查看隱私說明。README 另含捐款頁面連結。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 OpenReflex,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README


What is OpenReflex

OpenReflex gives AI coding agents ambient project muscle memory across coding, investigation, and reasoning work. Lifecycle hooks quietly record how work actually goes, compile repeated project behaviour into reusable Reflexes, and inject only the relevant project procedure into new tasks. The model does not need to remember to call OpenReflex, and MCP diagnostics are opt-in rather than loaded into normal agent context.

You install it once and keep working normally. Core memory stays on your machine in a local SQLite database. There is no OpenReflex account or hosted service. Claude Code token counts are read from the session transcript Claude Code already writes locally, and only counts are stored. openreflex tokens enable optionally adds estimated cost through Claude Code's OpenTelemetry export to a loopback-only receiver.

[Recording of a Claude Code session with OpenReflex: OpenReflex injects compact prior context, Claude fixes the task and runs verification, and lifecycle hooks close the outcome automatically]
A recorded Claude Code session. OpenReflex injects compact relevant context before work; lifecycle hooks capture tools and verification and close the execution automatically. MCP is not required for the normal path. The step-by-step walkthrough is in docs/walkthrough.md.

Why OpenReflex

  • It learns how the project behaves. OpenReflex compiles successful work into project-scoped Reflexes such as authentication changes, Helm configuration, database migrations or CI work. Resolution combines semantic intent, task family and module/file locality, so a novel task can reuse a project procedure without repeating an earlier task.
  • It catches loops while they happen. Repeated failing commands, identical retries, stalled progress, and runaway context growth raise one alert that says whether to continue, pivot to another approach, or stop and check in with you, never a stream of nags.
  • It learns after every task. Build work closes against tests/lint/build evidence; investigations can close against cross-checked sources; reasoning-only work can complete without external tools. A simple Path check only names a better option when comparable past tasks actually support one.
  • It is private by design. Only coarse, project-relative metadata is stored. File contents, commands, tool output, and transcripts never are, and capture is off until you approve a project.

[Before a task: retrieve similar experience, score candidate paths, inject context and a budget. During a task: watch every tool call, flag loops and stalls, advise continue, pivot or stop. After a task: close the outcome using evidence appropriate to the work, run a simple Path check, extract lessons. Lessons feed the Experience Graph for the next task.]

Quick start

Requires Python 3.11 or newer.

Claude Code — recommended: install the plugin, reload it, inspect the current state, then explicitly enable project memory.

text
/plugin marketplace add vishnu-77/openreflex/plugin install openreflex@openreflex/reload-plugins/openreflex/openreflex approve

Claude may display the canonical plugin namespace as /openreflex:openreflex; both refer to the same user-invoked OpenReflex control surface when the bare alias is available. The no-argument command is read-only and compact. approve explicitly enables local memory for the current project. The plugin prepares an exact-version runtime under ~/.openreflex/runtime/ and normal agent work remains ambient after approval.

The Claude plugin does not execute a global openreflex from PATH. An older pipx/uv/pip installation can coexist without taking over the plugin runtime.

CLI / other agents: use a persistent package install.

bash
pipx install openreflex            # or: uv tool install openreflexcd your-projectopenreflex install codex           # or cursor / opencode / claude-code

After a few tasks:

bash
openreflex context "fix the login redirect bug"   # preview the context a task would receiveopenreflex status                                 # what has been captured and learnedopenreflex doctor                                 # installation checks and recent hook errorsopenreflex update --check                         # check the latest stable release

Package updates preserve local memory and project configuration. Managed pipx and uv tool installs can use openreflex update, openreflex update --reinstall, or openreflex self reinstall. The Claude plugin manages its own pinned runtime automatically; these package-manager commands are only needed for standalone CLI installs.

Use it with your agent

OpenReflex installs per project with openreflex install <agent>, or as a plugin.

AgentConnects throughInstallVerified
Claude CodePlugin hooks, or project hooksclaude plugin marketplace add vishnu-77/openreflex then claude plugin install openreflex@openreflex, or openreflex install claude-codeLive sessions
CodexPlugin hooks, or project hookscodex plugin marketplace add vishnu-77/openreflex, or openreflex install codex, then trust the hooks once in /hooksLive sessions
CursorLifecycle hooksopenreflex install cursorProtocol and fuzz tests
OpenCodeLocal lifecycle pluginopenreflex install opencodeProtocol and fuzz tests

With the Claude plugin, /openreflex shows a compact read-only state view. Use /openreflex approve to enable local memory for the current project, then work normally. Other explicit controls include status, reflexes, memory, doctor, why, trace, and revoke. OpenReflex control turns are not learned as project experiences and do not trigger normal task verification. The control skill is user-invoked only and does not enable MCP diagnostics or participate in normal model routing. Claude may show the canonical namespaced form /openreflex:openreflex. Per-agent guides: Claude Code, Codex, Cursor, OpenCode.

How it works

Hooks send lifecycle events (prompt, tool start, tool end, compaction, stop) to the OpenReflex engine, which stores them in an Experience Graph:

Task -caused-> Execution -used-> Context -used-> ExperienceCandidatePath -recommended_for-> Task            Lesson -recommended_for-> TaskExecution -failed_with-> ToolCall -resolved_by-> ToolCallExecution -caused-> Outcome -caused-> Experience -caused-> Lesson
  • Before a task: similar experiences are retrieved and OpenReflex first identifies the work mode. BUILD uses inspect-first, test-first, and incremental; INVESTIGATE uses source-first, cross-check, and broad-then-deep; THINK uses reason-first, compare-options, and evidence-first. Paths are ranked using past evidence, estimated cost, risk, uncertainty and reversibility. Injected text is re-read by every later API call, so context is injected only when it is specific to the task: a matched Reflex, or a lesson about a failure already seen in this project. One substantial task in five (the evaluation.holdout_percent policy value) is a holdout: OpenReflex records it but shows nothing, so openreflex status can compare model tokens per task with and without OpenReflex.
  • Between tasks (Claude Code): when a new, unrelated task starts in a session already carrying a large history (context.reset_hint_tokens), OpenReflex suggests /clear to you; the model never sees the suggestion. After /clear, the new session gets a short summary of the cleared task instead of its full history.
  • During a task: an identical call that already failed twice, with no edit or passing check since, is refused before it runs (Claude Code) or flagged (other agents). The first failure with an error this project has resolved before shows what resolved it. When a detector finds a failure loop, repeated calls, stalled progress or context growth, OpenReflex estimates the marginal value of more work. Over-budget alerts are off by default; set detectors.over_budget_tiers to turn them on. The current path's success estimate is updated with each call that makes no progress or fails, and compared with the cost of the work left and with the best untried alternative. The alert ends with a recommendation to continue, pivot to another strategy, or stop and ask the user. Each problem, pivot, or stop is raised once, with a cooldown between messages.
  • After a task: lifecycle hooks close the execution automatically from work-mode-appropriate evidence; the model does not need to call OpenReflex. Explicit MCP outcome/path operations remain available only for manual or diagnostic workflows. The Path check says either better option: <path> when comparable completed tasks support it or better option: none proven. Recommendations are never presented as paths that were actually executed.

Every recommendation is stored as a decision snapshot with a Reflex Score (0-100): how strong the recommendation is, which is separate from the estimated chance that the task succeeds. openreflex why explains the latest decision and openreflex trace shows the timeline. In Claude Code, a short recap appears when a task starts, when OpenReflex recommends a pivot or stop or detects trouble, and when the task completes.

Set optional limits for every task with OPENREFLEX_BUDGET, for example calls=40,minutes=20,tokens=60000. Routing, scoring, budget and recap settings come from a versioned policy: the packaged defaults, overridden by ~/.openreflex/config.toml and then by .openreflex.toml in the project.

Normal work does not load OpenReflex MCP tools. If you explicitly want model-facing introspection for a project, enable it with openreflex diagnostics enable <agent>. Disable it again with openreflex diagnostics disable <agent>. The standalone MCP Registry package remains available for users who deliberately install OpenReflex as an MCP server.

The optional MCP diagnostics/admin tools
ToolWhat it does
get_execution_contextPlan a task: similar past tasks, the suggested strategy with alternatives, a budget, likely files, lessons. Optional max_tool_calls, max_minutes, max_context_tokens.
check_progressWhether more work on the current path is worth it: continue, pivot or stop.
choose_pathDeclare the strategy being followed when it differs from the suggestion.
record_outcomeRecord a confirmed outcome (tests/builds, cross-checked research, user confirmation, or failure) and learn from it.
explain_decisionWhy the latest recommendation was made: Reflex Score, signals, confidence, next-best route.
get_execution_traceThe decision timeline of the most recent task.
get_reflex_scoreThe latest Reflex Score and its components as JSON.
search_experiencePast tasks in the project by description similarity, with their lessons.
explain_nodeOne Experience Graph node and its relations.
get_project_insightsWhat has been recorded, reused and learned in the project.
approve_projectEnable capture, only when the user explicitly asks.
forget_experienceDelete one past task's memory, only when the user explicitly asks.

CLI

CommandPurpose
install <agent> [--dry-run]Install the hooks-only ambient runtime and enable the project
diagnostics enable/disable <agent>Explicitly opt in/out of model-facing MCP diagnostics
uninstall <agent> [--dry-run]Remove OpenReflex's integration entries; captured memory is kept
update [--check] [--reinstall]Check or update a managed pipx/uv-tool installation; optionally force a reinstall
self reinstallRepair/reinstall the managed OpenReflex package while preserving memory/config
self uninstall --yesRemove only the managed OpenReflex package; memory/config remain on disk
approve / revokeEnable or disable capture for the current project
context "<task>"Preview the Execution Context a task would receive
status [--json]What has been captured, reused, learned, and how model-token usage compares
why / traceExplain the latest recommendation, or show the decision timeline
doctorInstallation, project resolution, and recent hook activity checks
forget --yesDelete the project's data
tokens enable / tokens status / tokens disableToken counts need no setup; opt in to estimated cost via local Claude Code telemetry, inspect it, or remove OpenReflex-owned telemetry settings
benchmarkRun the simulated benchmark
hook <agent> <event>Used by ambient agent integrations
mcpRun the optional diagnostics/admin MCP server explicitly

Privacy

StoredNever stored
Tool name and a coarse category (read, edit, search, test, ...)File contents
A fingerprint of the argumentsCommand text
Project-relative file pathsTool output
Pass or fail, duration, output sizeTranscripts and model output
Model-token counts per API call, read from the local Claude transcript; model/source label; optional estimated costPrompt/response/tool contents from the transcript or Claude telemetry
A masked one-line error signaturePaths outside the project
The prompt as a task description (up to 1,000 characters, secrets redacted)Anything sent to an OpenReflex-hosted service: there is none

Data lives in ~/.openreflex/projects/<hash>/experience.sqlite3. Set OPENREFLEX_HOME to move it, OPENREFLEX_DISABLE=1 to turn capture off everywhere, openreflex forget --yes to delete a project's data, or ask your agent to forget_experience a single task.

Research

OpenReflex is also a research project in budget-aware execution: instead of treating success as a yes or no, it studies how agents choose execution paths, spend tool calls, model tokens and context, respond to uncertainty, and whether past work makes similar future work cheaper without reducing outcome quality. The loop is experience retrieval, evidence-aware path selection, budget-aware execution, work-mode-specific completion and plain-language path comparison. The Researcher view on the site explains the idea, lets you step through one reflex forming in the graph, and places it next to related work.

The reproducible evaluation protocol, pinned real-agent corpus, exact prompts, and claim boundaries are documented in docs/evaluation.md.

Community & Contributing

  • Issues and ideas: GitHub Issues

  • Support the project: Buy me a coffee

  • Develop locally:

    bash
    git clone https://github.com/vishnu-77/openreflex && cd openreflexpip install -e ".[dev]"pytest && ruff check src tests scripts
[Contributors]

OpenReflex is listed in the MCP Registry as io.github.vishnu-77/openreflex and on Glama:

[OpenReflex MCP server: quality and maintenance score on Glama]

License

OpenReflex is released under the MIT License.

來源:README.md,提交 ae971a8

工具

14

get_execution_context

Get execution context

Plan a task from this project's past experience. Returns: plain text with the learned project Reflex procedure when one applies; otherwise a neutral working approach, relevant past experience, budget, likely files/sources and lessons. Internal strategy names and candidate scores are deliberately omitted from this normal surface; use get_candidate_paths for diagnostics. Use when: starting any substantial coding, investigation, research, analysis, review, planning or reasoning task and no [OpenReflex] block was injected. Not for: looking up history (use search_experience) or checking progress mid-task (use check_progress). Side effects: starts or re-plans the current task in the local Experience Graph; touches no project files, runs no commands, sends nothing over the network. Calling it again for the same task returns the same plan unless new limits are given. Errors: invalid non-positive limits are rejected by the input schema; a 'not enabled' message is returned until the project is approved.

輸入參數task必填max_minutesmax_tool_callsmax_context_tokens

check_progress

Check progress

Estimate whether more work on the current task's path is still worth it. Returns: plain text starting with 'Recommendation: continue', 'pivot' or 'stop', then the success estimates for the current path and the best alternative, the marginal value of each option, the execution budget and how much of it is used, and any detected problems (failure loop, repeated calls, stalled progress, context growth, budget overrun). Use when: unsure mid-task whether to keep going. Follow 'pivot' by switching to the named strategy; follow 'stop' by summarizing what was tried and asking the user. Not for: planning a task (use get_execution_context). Side effects: none; read-only on the most recent task. Errors: asks for get_execution_context first when no task exists; a 'not enabled' message until the project is approved.

無需輸入參數。

explain_decision

Explain decision

Explain OpenReflex's latest recommendation for the most recent task. Returns: plain text with the recommended strategy, the Reflex Score (0-100: how strong the recommendation is, not the chance of success), the estimated success probability, confidence, the signals behind the score, the next-best strategy with its route advantage, and the policy version. Use when: the user asks why OpenReflex suggested a path, pivot or stop. Not for: the same numbers as structured data (use get_reflex_score) or every decision in order (use get_execution_trace). Side effects: none; read-only. Errors: 'No decision snapshot recorded yet' before any task was planned; a 'not enabled' message until the project is approved.

無需輸入參數。

get_execution_trace

Get execution trace

Return the decision timeline of the most recent task. Returns: plain text, one line per decision in order, with elapsed time, phase (start, runtime, complete), action, strategy, Reflex Score and the event that triggered it. Never includes prompts, commands or tool output. Use when: reviewing how a task unfolded. Not for: only the latest decision (use explain_decision). Side effects: none; read-only. Errors: 'No decision snapshots recorded yet' before any task was planned; a 'not enabled' message until the project is approved.

無需輸入參數。

get_candidate_paths

Get candidate paths

Show every candidate path OpenReflex considered for the most recent task side by side. Returns: plain text with each strategy's score, success probability, cost/risk numbers, and whether it was dominated; which path was recommended; and which one was actually followed - explicit (via choose_path), inferred from tool-call evidence, or not yet determined while the execution is still running. Use when: the user asks what other approaches were considered, or whether the agent followed the suggested path. Not for: a single recommendation's reasoning (use explain_decision) or the decision timeline (use get_execution_trace). Side effects: none; read-only. Errors: 'No execution recorded yet' before any task was planned; a 'not enabled' message until the project is approved.

無需輸入參數。

get_project_reflexes

Get project Reflexes

Show the project Reflex and specialised procedures OpenReflex is learning from repeated work. Returns: the root Project Reflex after the first captured experience, plus specialised Reflexes with learning/learned/proven/stale maturity, support/verification counts and procedure steps. Use when: the user asks what OpenReflex has learned specifically about this project, which reusable procedures exist, or how a named Reflex works. Not for: backend routing internals or generic strategies (use get_candidate_paths for those diagnostics). Side effects: may refresh derived local Reflex data from already-captured evidence; touches no project files. Errors: a 'not enabled' message is returned until the project is approved.

無需輸入參數。

get_reflex_score

Get Reflex Score

Return the latest decision's Reflex Score and machine-readable components. Returns: structured fields for availability, Reflex Score (0-100 recommendation strength, not success probability), success probability, confidence, strategy, next-best strategy, route advantage, evidence, context cost, budget use, component signals and policy version. If no decision exists, available=false and reason explains why. Use when: a program or agent needs decision numbers it can inspect without parsing prose. Not for: a readable explanation (use explain_decision) or the full decision timeline (use get_execution_trace). Side effects: none; read-only. Errors: an MCP error is returned until the project is approved.

無需輸入參數。

choose_path

Choose path

Declare the strategy you are following for the most recent task. Returns: one line, 'Recorded chosen path: <strategy>'. Use when: deliberately departing from the suggested path, so OpenReflex remembers what was actually done rather than confusing the recommendation with the observed work. Not for: tasks that follow the suggestion; the path is then inferred from tool activity. Side effects: writes the choice to the local Experience Graph; calling it again replaces the earlier choice. Touches no project files. Errors: 'No current execution' before any task was planned (call get_execution_context first); a 'not enabled' message until the project is approved.

輸入參數stepsstrategy必填

record_outcome

Record outcome

Record the verified outcome of the most recent task and learn from it. Returns: the recorded status plus a plain-language Path check. A better path is only named when comparable completed tasks provide evidence; otherwise the result says that no better option is proven. Use when: the result is confirmed: tests/lint/build passed, research was cross-checked against relevant evidence, the user confirmed the answer, or the task failed/was abandoned. Not for: declaring the strategy (use choose_path). Side effects: finalizes the task in the local Experience Graph and updates its experience, lessons and path comparison; calling it again for the same task replaces the recorded outcome. Touches no project files. Errors: 'No execution to record an outcome for' before any task was planned; a 'not enabled' message until the project is approved.

輸入參數status必填evidence必填

search_experience

Search experience

Search this project's past tasks by description similarity. Returns: structured 'experiences' (id, score, description, class, agent, strategy, status, tool_calls, minutes, files), best match first, plus structured 'lessons' (text, confidence, support). Both lists are empty when nothing is similar enough. Use when: the user asks what was learned or what worked before, or to find an experience id for explain_node or forget_experience. Not for: planning a new task (use get_execution_context). Side effects: none; read-only. Matching is lexical, on task descriptions only. Errors: invalid limit values are rejected by the input schema; an MCP error is returned until the project is approved.

輸入參數limitquery必填

explain_node

Explain graph node

Show one Experience Graph node with its direct relations. Returns: structured 'root', 'nodes' (Task, Execution, ToolCall, Outcome, Experience, Lesson, Context or CandidatePath and their stored fields) and typed 'edges' (used, caused, failed_with, resolved_by, recommended_for). Embeddings are omitted. Use when: tracing why a lesson or recommendation exists, after finding an id with search_experience or get_execution_context. Not for: searching by topic (use search_experience). Side effects: none; read-only. Errors: an MCP error reports 'Unknown graph node' for an id that does not exist, and an MCP error is returned until the project is approved.

輸入參數node_id必填

get_project_insights

Get project insights

Summarize what OpenReflex has recorded and learned in this project. Returns: structured activation, engagement, experience reuse, outcomes, observational efficiency with and without prior experience, path-comparison trends, routing agreement, live alerts, execution-control metrics and lesson count. Efficiency comparisons are observational and are not presented as causal evidence. Use when: the user asks how OpenReflex is doing in this project or a program needs project-level metrics. Not for: individual past tasks (use search_experience). Side effects: none; read-only. Errors: an MCP error is returned until the project is approved.

無需輸入參數。

approve_project

Enable project

Enable OpenReflex capture for this project. Returns: one line confirming the project is enabled, or 'Not approved' when confirm is false. Use when: the user explicitly asks to enable OpenReflex here. Never call it on your own initiative; the user can also run `openreflex approve`, and `openreflex revoke` disables capture again. Not for: anything else; every other tool answers with a 'not enabled' message until this has happened. Side effects: writes the project's approval to the local OpenReflex home; enabling an already enabled project changes nothing. Touches no project files. Errors: none.

輸入參數confirm

forget_experience

Forget experience

Delete one past task from this project's memory. Returns: one line listing what was removed (task, executions, tool calls, outcomes, experience, lessons), or 'Not forgotten' when confirm is false. Use when: the user explicitly asks to forget a specific past task, for example one that involved sensitive work or taught a wrong lesson. Never call it on your own initiative. Not for: deleting everything; the user runs `openreflex forget --yes` for that. Side effects: permanently removes that task's nodes from the local Experience Graph; other tasks are untouched. Touches no project files. Errors: 'Unknown experience id' for an id that does not exist, is not an experience, or was already forgotten; a 'not enabled' message until the project is approved.

輸入參數confirmexperience_id必填

版本歷史

12
  1. v0.10.1最新Oct 29, 2026
  2. v0.9.10Sep 24, 2026
  3. v0.9.7Sep 24, 2026
  4. v0.9.6Sep 23, 2026
  5. v0.9.3Sep 23, 2026
  6. v0.9.2Sep 22, 2026
  7. v0.8.0Sep 21, 2026
  8. v0.5.3Sep 21, 2026
  9. v0.5.2Sep 20, 2026
  10. v0.5.1Sep 19, 2026
  11. v0.5.0Sep 18, 2026
  12. v0.3.2Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分