feat(memory): port openclaude's /memory — TUI picker overlay, $EDITOR spawn, backend memory controls#693
Merged
Conversation
… spawn, backend memory controls Typing /memory in the Ink TUI now opens the memory-file picker (port of openclaude's commands/memory + MemoryFileSelector): synthetic User/Project rows plus every loaded CLAUDE.md / rules file / @-import, served by a new memory_targets control over the shared build_memory_options enumeration. Selecting a file ensure-creates it (exclusive-create), suspends the TUI to the alternate screen, spawns $VISUAL/$EDITOR (bare code/subl get wait flags — the TS EDITOR_OVERRIDES), prints the TS-verbatim 'Opened memory file at …' line + editor hint, and busts the backend memory-file cache (memory_edited) so the next turn re-reads the edited content. Previously /memory had no reachable surface: the Python InteractiveCommand port existed but the Ink TUI (sole interactive UI since #566) never dispatched it. Verified end-to-end over a real PTY (picker rows, editor spawn under suspend, transcript message, file created+edited, Esc cancel) plus 17 new unit tests (3 backend controls, 14 memoryEdit lib). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports openclaude's
/memorycommand (typescript/src/commands/memory/+MemoryFileSelector) to clawcodex. Previously/memoryhad no reachable surface — the PythonInteractiveCommandport existed but the Ink TUI (sole interactive UI since #566) never dispatched it, so typing it hit the "isn't wired into the clawcodex backend yet" fallback.ui-tui/src/components/memoryPicker.tsx):/memoryopens the memory-file hierarchy — synthetic User memory (~/.clawcodex/CLAUDE.md) and Project memory rows first, then every loaded CLAUDE.md / rules file /@-import with its "Saved in …" / "@-imported" description. Remembers the last selection across opens (TSlastSelectedPathidiom).ui-tui/src/lib/memoryEdit.ts): selecting a row ensure-creates the file (exclusive-create preserves content), suspends the TUI to the alternate screen, spawns$VISUAL/$EDITOR(barecode/sublget wait flags — the TSEDITOR_OVERRIDES), then prints the TS-verbatimOpened memory file at …line + editor hint.src/server/agent_server.py):memory_targetsserializes the sharedbuild_memory_optionsenumeration for the picker;memory_editedbusts the memory-file cache (keys on cwd only) so the next turn re-reads the edited content./memoryadded to the slash registry + completion catalog;memoryPickeroverlay wired into overlay state, Esc/Ctrl+C close, and$isBlocked./model,/logo) instead of printing "Cancelled memory editing".Testing
tests/server/test_memory_controls.py), 14 memoryEdit lib tests (ensure-create, hint strings, wait flags, relative-path, spawn orchestration).tsc --noEmitclean against the post-feat(tui): Tab accepts the composer's suggested query placeholder #690/feat(tui): highlight past user inputs with the original userMessageBackground band #691 base.🤖 Generated with Claude Code