Skip to content
Nocha12Public

About

Correct a coding agent once; every coding agent on the team follows it. Shared lessons, recall and review with decision traces on Meko (ContextCon).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

oncefix

Correct a coding agent once; every coding agent on the team follows it.

Teams run Claude Code, Codex and Cursor side by side. A correction given in one session ("use pnpm, not npm") is lost to the next agent. oncefix keeps each correction as a lesson in a shared Meko datapack, lets any agent recall it before working, and reviews every change against it, leaving a trace of which lesson decided.

Works with both local open-source Meko and Meko Cloud (mcp.mekodata.ai), shipping the oncefix CLI (learn, recall, review, report, gaps), prompt hooks tested in real Claude Code and Codex sessions, and a git pre-commit review hook (examples/README.md).

Demo video (4 min): https://youtu.be/ryCwoPWKWL0 · Slides: docs/slides/oncefix-slides.pdf · Before and after numbers: docs/measurement.md

Built for ContextCon: Remember Everything, Challenge 01 "One Memory, Every Coding Agent".

A lesson

Plain text in a Meko memory, readable by any agent without this tool:

[lesson] Install packages with pnpm, never npm
why: npm rewrote the lockfile and CI broke
scope: package.json, docs/**/*.md
forbid: \bnpm install
learned-from: claude-code
  • scope: file globs. None means everywhere.
  • forbid: regular expressions checked against added lines. None means the agent confirms the lesson itself.

Prerequisites

  • Node.js 22.12 or newer.

  • A Meko datapack, either way:

    • Local: the open-source Meko (https://github.com/yugabyte/meko), started with meko start. It serves MCP at http://127.0.0.1:7777/mcp and writes its client token to ~/.meko/client.token.
    • Meko Cloud (https://mekodata.ai): sign up, create an API key in the console, and use the datapack Meko made for you or a new one.
  • The datapack id: from the Meko console, or on a local Meko with two calls (Meko asks for a conversation first):

    node scripts/mcp-call.mjs conversation_create '{"agent_id":"setup","title":"oncefix setup"}'          # note the "id"
    node scripts/mcp-call.mjs datapack_create '{"name":"oncefix","conversation_id":"<conversation id>"}' # the reply carries the datapack id

Use

In daily use, hooks run oncefix automatically (UserPromptSubmit hooks call oncefix recall --hook on prompt submission, and the git pre-commit hook runs oncefix review; see examples/README.md). You can also invoke every command directly from the CLI:

npm install && npm run build      # dist/oncefix.mjs; `npm link` puts `oncefix` on PATH
export ONCEFIX_DATAPACK=<datapack id>   # ONCEFIX_MEKO_URL defaults to http://127.0.0.1:7777, the token to ~/.meko/client.token

oncefix recall --agent codex --task "install the packages"          # recall lessons for a task
git diff --cached | oncefix review --agent cursor                     # exit 1 when a staged change repeats a lesson
oncefix report --agent team-lead                                      # which agent's correction saved which other agent
oncefix gaps --agent team-lead                                        # searches Meko's Self-learning says found little

# Capture a correction directly (or wire into an agent hook; drop --dry-run to save):
echo '{"rule":"Install packages with pnpm, never npm","path":"docs/setup.md","before":"Run npm install first.","after":"Run pnpm install first."}' \
  | oncefix learn --agent claude-code --dry-run

On Meko Cloud: ONCEFIX_MEKO_URL=https://mcp.mekodata.ai and the API key in ONCEFIX_MEKO_TOKEN or a file named by ONCEFIX_MEKO_TOKEN_FILE.

Demo

examples/demo/demo.sh runs the whole story against a datapack in about a minute: a person corrects Claude Code (pnpm) and Cursor (UTC dates) once each; Codex recalls both lessons for a task it was never told about; the review blocks Codex's npm install with the lesson Claude Code learned, and Claude Code's local-time date with the lesson Cursor learned; the fixed change passes; oncefix report reads the review traces back and says who saved whom; oncefix gaps lists what the team has not taught yet. Step 9 (examples/demo/inside-meko.mjs) reads back from Meko what the run left there: the lessons as memories and the blocked review's conversation turn with its reasoning, plan and metadata.

What lives where in Meko

Meko part What oncefix keeps there
Memory Each lesson, plain text, shared by every agent in the datapack
Search context_search picks the lessons for a task in the prompt hook
Conversations and decision traces Each review is a turn: the lessons consulted and the one that decided (reasoning), the steps (plan), and machine-readable metadata (verdict, blocked lessons and where they were learned)
Artifacts A Markdown audit report per review (artifact_put)
Self-learning oncefix gaps turns weak searches into lessons to write
Sharing oncefix report counts, per lesson, the blocks of agents other than the one that taught it

Meko writes conversation turns asynchronously, so a review can take a moment to appear in oncefix report.

Exit codes: 0 ok or pass, 1 blocked or nothing saved, 2 usage, 3 Meko failed, 4 oncefix failed. Hooks: examples/README.md.

Develop

npm install
npm test
npm run typecheck
MEKO_LIVE=1 npm test   # also runs the whole flow on a local Meko (`meko start`), in a new datapack

License

MIT (LICENSE).

About

Correct a coding agent once; every coding agent on the team follows it. Shared lessons, recall and review with decision traces on Meko (ContextCon).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages