Repository navigation
fix(prompt): write memories in Claude Code's current frontmatter format - #54
Merged
kuitos merged 1 commit intoOct 7, 2026
Merged
Conversation
kuitos
added this pull request to stack #55
October 7, 2026 14:53
kuitos
force-pushed
the
fix/claude-code-frontmatter-format
branch
3 times, most recently
from
October 7, 2026 15:23
966c574 to
ddfe6ff
Compare
The prompts taught the old format: `name: {{memory name}}` and a top-level
`type:` in FRONTMATTER_EXAMPLE, `user_role.md` / `feedback_testing.md`
examples, `name: short title` and snake_case file names in the extraction
prompt, "Human-readable name" and "Use snake_case" in memory_save's args,
and the same in the README. In #47 all 12 files the main agent wrote used
a title as `name` and a top-level `type`, while Claude Code writes a
kebab-case slug and `metadata.type`, so a shared folder ended up with two
formats.
Every prompt, the memory_save arg descriptions and the README now show the
current format (kebab-case slug `name`, `metadata:\n type:`) with
kebab-case file names. `name` is not forced to equal the file name (real
Claude Code files differ). memory_save gains an optional `title` for the
MEMORY.md line, since the slug makes a poor title; it only names a new
line or one the plugin generated, never a hand-written one. Old files are
read as before and not migrated.
Refs #47
kuitos
force-pushed
the
fix/claude-code-frontmatter-format
branch
from
October 7, 2026 15:33
ddfe6ff to
c62f2ec
Compare
kuitos
marked this pull request as ready for review
October 7, 2026 15:35
|
🎉 This PR is included in version 2.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Problem
#47: memories the main agent wrote did not match Claude Code's current format.
name:No autouse pytest fixtures)type:metadata:In the report, all 12 files the main agent wrote used the old shape. The prompts taught it:
FRONTMATTER_EXAMPLE(name: {{memory name}}, top-leveltype:);user_role.md/feedback_testing.mdexamples;name: short titleand snake_case file names in the extraction prompt;memory_save's args;A memory folder shared with Claude Code ended up holding two formats.
Fix
memory_savearg descriptions and the README now show the current format: a kebab-case slugname,metadata:\n type:, and kebab-case file names. The examples areuser-role.mdandno-db-mocks-in-tests.md.nameis not forced to equal the file name; real Claude Code files differ.memory_savegains an optionaltitlefor theMEMORY.mdline, defaulting toname. It names a new line or a line the plugin generated, never a hand-written one (fix(store): keep hand-written MEMORY.md index lines #51).memory_savedoes both steps (file and index line), so the agent should not editMEMORY.mditself afterwards. If it ever edits the index by hand, it changes one line and never rewrites the file. See the verification below for why.Tests
test/prompt.test.ts:metadata.type, and the old shapes are gone;MEMORY.mdtomemory_save.test/store/MemoryStore.test.ts:titlenames a new index line while the file keeps the slug;test/tools.test.ts:memory_savewrites a slugnameandmetadata.typeand titles the index line withtitle, falling back toname.bun run lint,bun run typecheck,bun testandbun run buildpass.Real-environment verification (OpenCode 2.0.22, isolated DB/config, memory agents on
opencode/gpt-6-luna)Format: in the extraction and fact-statement scenarios (the ones that create memories), every new memory file used a kebab-case slug
nameandmetadata.type, 20/20. That covers extraction forks andmemory_savecalls from big-pickle and gpt-6-luna main agents. Forks passed a readabletitle(e.g.[Billing database](billing-postgres.md)).Main agent editing
MEMORY.mditself (big-pickle, aftermemory_savehad already written the index line):MEMORY.mdyourself" sentence, 3 of the 6 inspected runs:write, dropping a hand-written line;editappended a duplicate line;edittouched the index.Refs #47
🤖 Generated with Claude Code