mem for Code
Your coding agent, with a memory.
Long-term memory for Claude Code and Codex. Verified lessons come back next session.
01
Plan. Execute. Verify. Learn. One loop around the agent you already use.
mem for Code is agentware for coding agents. It wraps the agent you already use in a plan, execute, verify, learn loop and keeps what it learns as plain text in a folder you own.
- Plan. The agent writes a plan with verifiable subtasks in your knowledge folder. Plan lint: every subtask has a Verify: line.
- Execute. One subtask at a time, with worklog entries.
- Verify. The agent runs the subtask's verification command: your project's own build, test or health check. Evidence in the worklog.
- Learn. Discoveries marked LEARNED are promoted by the toolkit into a learning entry registered in the index. Index validation and the promotion scan.
Code checks that each subtask has a verification command, not whether the check was good. That judgment stays with your agent and with you.
- Plan
- Execute
- Verify
- Learn
02
Lessons become files. Plain text you can diff.
- Sessions start cold. Each new session begins without what the last one learned.
- Built-in memory is per machine. Claude Code's auto memory is written by Claude and stays on the machine where it was written.
- Rewritten memory is hard to audit. If a model rewrites what it stores, a diff won't tell you why it changed.
agentware keeps what your agent verified as Markdown and JSON, written by a deterministic toolkit, so every change is a diff you can review.
# in the worklog, the agent marks what it verified> LEARNED: run the migration on a scratch copy firstscripts/agentware learn --topic migrations --summary "Scratch copy first" --tags db# a Markdown file in your knowledge folder, registered in the indexscripts/agentware index validate 03
Recalled next session. Before the agent starts work.
At the start of a task the agent asks its knowledge base first. The right entries come back ranked, inside a token budget, so the context it pays for is the context it needs.
Recall@5 on LongMemEval: 91.4%, scored at a pinned commit. How we measured 91.4% View the run
Why does only the toolkit write the index?
- 1 docs/methodology.md › Verification gates — the "why"
- 2 docs/methodology.md › Why a steering-only repo?
- 3 docs/fanout.md › Why two isolations per lane
- 4 README.md › Why the numbers are that good — agentware loops don't hallucinate
- 5 docs/methodology.md › Claude Code loader facts that drove the design
What's in the box. Each with its status.
-
The loop
AvailablePlan, execute, verify, learn, around Claude Code or Codex. Every subtask carries a verification command.
-
Learnings become rules
AvailableDiscoveries marked LEARNED become knowledge entries, written only through the toolkit.
-
Vetted skills
AvailableSecurity, productivity and loop skills, catalogued and validated before they load.
-
Adversarial review gate
AvailableChanges to agentware itself are reviewed by an independent critic before they ship.
-
Dream mode, phase 1
Opt-inDeterministic maintenance of your knowledge base, on a schedule only if you turn it on.
-
Your runtime
AvailableClaude Code or OpenAI Codex: choose during onboarding. agentware wraps the agent you already use.
When built-in memory is enough.
If you're one developer on one machine and happy with notes Claude writes for itself, Claude Code's auto memory may be all you need. Choose agentware when you want memory shared across machines or a team, writes you can review in a diff, and retrieval you can benchmark.
FAQ.
- Does it replace CLAUDE.md?
- No. It works alongside your existing instructions. agentware adds a knowledge folder and a loop.
- Does memory leave my machine?
- Your knowledge base stays in your folder. Your agent sends prompts, including any recalled snippets, to its model provider, as it does today.
- What does it cost to run?
- agentware is free. You use your existing Claude Code or Codex plan. Check your provider's terms for unattended use.
- Does it work with Codex?
- Yes. Choose Codex during onboarding.
- Does the loop run my agent unattended?
- Yes. The loop, and the PLAN_AW and WORK_AW aliases if you install them, launch Claude Code with
--dangerously-skip-permissions(Codex:--dangerously-bypass-approvals-and-sandbox), so your agent isn't asked before it runs commands. Run it in a container, a VM or a dedicated account. Onboarding asks before it installs the aliases. - What does onboarding write, and where?
- A pointer to your knowledge folder in
~/.agentware/, and the knowledge folder itself wherever you choose. If you say yes, a marked block with two aliases (PLAN_AW and WORK_AW) appended to~/.zshrc,~/.bashrcor~/.bash_profile. With Codex, a copy of the shipped skills in.agents/skills/inside the clone, or in a path you name; Claude Code reads them from.claude/skills/in place, with no copy. Options you turn on add more: semantic recall (Mode B) installs one pinned Python package and downloads its model, and dream mode or automatic updates add a scheduled job (launchd on macOS, cron on Linux). If you ask it to, onboarding can also create GitHub repositories withghand add Playwright to your own app. - How do I uninstall?
- If you turned on dream mode or automatic updates, first run
scripts/agentware dream --uninstall-scheduleandscripts/agentware tick --uninstall-schedulein the clone. Then delete the cloned folder, your knowledge folder and~/.agentware/, remove the# >>> agentware aliases >>>block from your shell rc file, and delete the skills folder if you named one outside the clone. Mode B's Python package stays installed until you remove it with pip.
Start in your terminal.
git clone https://github.com/r5rana/agentware.git
cd agentware
git checkout 3c25cdd
claude "hi" git clone https://github.com/r5rana/agentware.git
cd agentware
git checkout 3c25cdd
codex "hi" This installs agentware, the open-source engine behind memfor. No tagged release yet. These commands pin commit 3c25cdd.
Apache-2.0. No memfor account. Needs macOS or Linux (Windows via WSL), git, Python 3, bash, jq, and Claude Code or Codex.
Paste setup into your agent
Set up agentware for me. Clone https://github.com/r5rana/agentware.git into ./agentware and check out commit 3c25cddd28b5e4d1c320c1e34a98eacaecf6a199. Read ./agentware/README.md and follow its onboarding. Stop and ask me before you install anything, before you run a command that writes outside ./agentware, and before you choose where my knowledge base lives. Stay inside your sandbox. If onboarding offers the PLAN_AW and WORK_AW shell aliases, or offers to start the unattended loop, ask me first: both start you with approvals turned off. If a step fails, tell me instead of retrying with broader permissions.
This text is shown in full here. Nothing is hidden in the clipboard.