Skip to content

feat: add Claude-style memory recall#102

Merged
Prodesire merged 4 commits into
mainfrom
codex/claude-code-memory
Jun 8, 2026
Merged

feat: add Claude-style memory recall#102
Prodesire merged 4 commits into
mainfrom
codex/claude-code-memory

Conversation

@guima-why

@guima-why guima-why commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR redesigns iac-code memory around a Claude Code-style workflow.

Users now manage long-lived instruction memory through /memory, while auto-memory topic files are recalled in the background only when relevant. The old memory folder manager remains available as a hidden compatibility command, but it is no longer the primary user experience.

User-Facing Changes

New /memory experience

/memory now opens an interactive memory screen instead of the old memory-folder command UI.

Users can:

  • Toggle auto-memory on or off.
  • Edit project memory.
  • Edit user memory.
  • Open the auto-memory folder when auto-memory is enabled.

Project and user memory are edited in a full-screen Vim-like editor. The editor supports the core operations users expect for this flow, including insert/normal mode, cursor movement, save-and-quit, and quit-without-saving. Saving only writes the file when content actually changed.

Instruction memory uses AGENTS.md

Instruction memory now defaults to AGENTS.md.

  • Project memory is stored at the project root.
  • User memory is stored under the iac-code config directory.
  • The file name can be overridden with IAC_CODE_INSTRUCTION_MEMORY_FILE.
  • make run and make dev set that override to IAC-CODE.md, preserving the local development workflow.

This means released/default behavior aligns with AGENTS.md, while local development can still use IAC-CODE.md.

Auto-memory is recalled, not always injected

Auto-memory topic files are no longer permanently inserted into the main system prompt.

Instead, iac-code performs a small background recall query using:

  • the current user prompt
  • the available topic file metadata
  • no topic file body content

When relevant topic files are selected, their content is added as hidden conversation context. This keeps topic memory available in later turns without exposing it in the normal transcript.

Duplicate memory injection is reduced

Once a topic memory file has been recalled into the current conversation, it is not recalled again unless it disappears from retained conversation context after compaction.

Topic files explicitly read through read_memory are also treated as already surfaced, so auto-memory does not immediately duplicate them.

/status shows memory recall only in debug mode

Memory recall diagnostics are hidden from normal /status output.

In debug mode, /status now reports:

  • side query totals
  • success / failure / cancellation counts
  • in-progress side calls
  • latest recall status
  • selected files
  • side-call token usage

This makes background memory behavior observable during debugging without adding noise for regular users.

Provider compatibility

For Anthropic models, consecutive same-role messages are normalized inside the Anthropic provider before sending the request. This avoids provider errors when hidden recalled-memory messages create adjacent user-role messages, without changing the global conversation structure.

Hidden diagnostic and compatibility commands

This PR adds or keeps hidden commands that are intentionally not shown in / suggestions or public docs:

  • /memory-folder: compatibility path for the old memory folder UI
  • /prompt: exports an HTML prompt snapshot for debugging system prompt, provider messages, and tools

Compatibility Notes

  • Existing topic memory files remain usable.
  • The old memory folder workflow is still available through the hidden /memory-folder command.
  • read_memory and write_memory continue to work.
  • Auto-memory can be disabled from /memory.
  • Hidden recalled-memory messages are skipped by normal transcript rendering, session titles, and other user-facing conversation views.

Validation

Validated locally with:

  • make translate
  • make lint
  • make test
  • make -C website build

Full test result from the latest run:

  • 4610 passed, 244 warnings

@Prodesire Prodesire merged commit dbe128f into main Jun 8, 2026
14 checks passed
@guima-why guima-why deleted the codex/claude-code-memory branch June 8, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants