Skip to content

perf(memory): tell agents to prefer shared notes over tool memory - #384

Merged
runkids merged 4 commits into
mainfrom
runkids/memory-guidance
Oct 4, 2026
Merged

runkids merged 4 commits into
mainfrom
runkids/memory-guidance

Conversation

@runkids

@runkids runkids commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)

Linked Issue

None.

Summary

The shared-memory guidance block told agents what is worth saving, but never said how the shared folder relates to the agent's own built-in memory. Agents with their own memory (Claude Code, Codex) kept saving there and left the shared notes alone, even in active mode.

  • Both modes now read INDEX.md at the start of each task instead of "when prior context is relevant".
  • active says to save here instead of in the tool's own memory, and gives a note format and an INDEX.md line shape.
  • passive still updates only on request, but asks the agent to point out facts worth keeping so the user can ask for them.
  • Dashboard mode descriptions (11 locales), CLI help, and website docs (en + 4 locales) match the new text.
  • The LEARNED.md starter no longer says "update only when the user requests it", which contradicted the active rule.

Second commit fixes stale facts a prompt audit turned up in website/AGENTS.md, wiki/testing.md, wiki/architecture.md, and the targets reference.

Existing guidance blocks will show as Outdated in the dashboard after upgrading; reconnecting rewrites them.

Checks run

  • go test ./internal/memory/ ./internal/server/ ./cmd/...
  • make build && go test ./tests/integration/ -run Memory -count=1
  • pnpm vitest run src/components/memory (22 passed)
  • python3 scripts/ai-context.py check

Not run: full make check, website build.

Checklist

  • I've read CONTRIBUTING.md
  • Tests included and passing (make check) — targeted Go, UI, and integration tests ran; full make check was not run
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

The generated guidance block defined "what is worth saving" the same way
agents' built-in memory does, but never said how the two relate, so agents
with their own memory kept saving there and left the shared folder alone.
The active rule now says to save here instead of tool-specific memory,
gives a note format and an INDEX.md line shape, and both modes read
INDEX.md at the start of each task instead of "when relevant". The
passive rule asks agents to point out facts worth keeping so the user
can ask for them to be saved.

Dashboard mode descriptions, the CLI help, and the website pages are
updated to match. Test fixtures that anchored on "Read only" follow the
new wording.
- The LEARNED.md starter said to update only on request, which
  contradicted the active memory guidance; it now defers to the guidance.
- website/AGENTS.md hardcoded a command-page count that had drifted and
  omitted the Desktop App navbar item.
- wiki/testing.md gave `bash -c` and `bash -lc` as the rule in different
  places; it now says which container needs which, and why.
- Migration-relative wording in wiki/architecture.md and an unexplained
  "Always use" in the targets reference are stated as current rules with
  their reason.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T07:02:45.439404Z 3a83de1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ea51b1890

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/memory/guidance.go Outdated
passiveRule = "Update these notes only when the user requests it."
activeRule = "Save a note only when you learn something that will still matter in future sessions: a stated user preference, a decision with its reason, or a pitfall you confirmed. Skip one-off task details, guesses, and anything the repository already records. When you are unsure whether something is worth keeping, propose the note to the user and save it only if they agree. Before writing, search the existing notes: update or correct the matching note instead of adding a duplicate, and remove a note proven wrong. Keep each note to one fact, link it from `INDEX.md`, never record secrets, and tell the user in one line what you saved."
passiveRule = "Update these notes only when the user requests it. When you notice something worth keeping, such as a stated preference, a decision with its reason, or a pitfall you confirmed, say so in one line so the user can ask you to save it."
activeRule = "When a fact is worth keeping across sessions, save it here instead of in this tool's own memory; use tool-specific memory only for things that matter to this tool alone. Save a note when you learn something that will still matter later: a stated user preference, a decision with its reason, or a pitfall you confirmed. Skip one-off task details, guesses, and anything the repository already records. When you are unsure whether something is worth keeping, propose the note to the user and save it only if they agree.\n\nOne fact per file, kebab-case `.md`, first line `# Title`, then the fact and why. Add a `- [Title](file.md)` line with a short hook under `## Notes` in `INDEX.md`. Before writing, search the existing notes and update or remove them instead of adding a duplicate. Never record secrets. Tell the user in one line what you saved."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reconcile the one-fact rule with LEARNED.md

When an active agent learns another durable lesson, this new rule requires a separate file, but initialization still creates LEARNED.md as a multi-entry lesson template (internal/memory/store.go:278-279) and the public workflow explicitly tells users to ask agents to update that file (website/docs/how-to/daily-tasks/sharing-memory.md:167-171). The generated instructions therefore force the agent either to violate the one-fact-per-file rule or to ignore the advertised starter workflow, producing inconsistent memory layouts; either exempt LEARNED.md or align the template and documentation with per-fact files.

AGENTS.md reference: AGENTS.md:L15-L15

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 464d2fa. The active rule now routes by kind instead of saying one fact per file: a durable fact or decision gets its own kebab-case file linked from INDEX.md, and a lesson from a failure goes under a new heading in LEARNED.md with date, context, conclusion, and evidence. That matches the starter template fields and the workflow the sharing-memory page describes, so neither needed to change. Covered by TestInstructionsModes and the memory integration tests, which render the generated block.

The active rule asked for one fact per file, while init still creates
LEARNED.md as a multi-lesson log and the docs tell users to have agents
update it. The rule now says which goes where: a fact or decision gets
its own file linked from INDEX.md, a lesson from a failure gets a new
heading in LEARNED.md.

Refs Codex review on #384.
@runkids

runkids commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 464d2fab73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/skillshare/extras_memory.go Outdated
"An empty --version creates a new note. To update, use the version from show --json.",
"Changes are backed up; a stale version is rejected. Native automatic memory is separate.",
"--update-mode passive (default) lets agents update notes only when asked; active lets them save lasting facts and propose ones they are unsure of.",
"Both modes read INDEX.md at the start of each task. --update-mode passive (default) only points out facts worth keeping; active saves them here instead of the tool's own memory and proposes ones it is unsure of.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve passive mode's on-request saving behavior

The new help text says passive mode “only points out facts worth keeping,” which implies that it never saves notes. The generated passive rule still explicitly allows updates when the user requests them, and the dashboard and website descriptions retain that behavior. Users choosing a mode from extras memory --help can therefore select it based on an incorrect contract; describe passive mode as pointing facts out and saving them only when asked.

AGENTS.md reference: AGENTS.md:L15-L15

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3a83de1. The help now reads: passive points out facts worth keeping and saves them only when asked; active saves them here instead of the tool's own memory. Matches the generated passive rule and the dashboard and website descriptions.

The --update-mode help described passive as only pointing facts out,
which dropped the on-request saving that the generated rule, dashboard,
and docs all keep.

Refs Codex review on #384.
@runkids

runkids commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a83de16d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/memory/store.go
starters := []struct{ path, content string }{
{"INDEX.md", "# Shared memory\n\nKeep durable notes in this folder. Link relevant notes here with standard Markdown links.\n\n## Notes\n\n- [Lessons learned](LEARNED.md)\n"},
{"LEARNED.md", "# Lessons learned\n\nRecord durable lessons and verified solutions. Update only when the user requests it. Verify changeable claims before reusing them.\n\n## Lesson title\n\n- Date:\n- Context:\n- Conclusion:\n- Evidence:\n"},
{"LEARNED.md", "# Lessons learned\n\nRecord durable lessons and verified solutions here. Your memory guidance says when to update these notes. Verify changeable claims before reusing them.\n\n## Lesson title\n\n- Date:\n- Context:\n- Conclusion:\n- Evidence:\n"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Migrate the previous LEARNED starter

For users upgrading with the starter LEARNED.md created by the previous release, changing only this literal has no effect: Init skips every readable existing starter at lines 282–283, so their file still says to update only when requested while the new active guidance explicitly routes lessons from failures there for autonomous saving. Reconnecting updates the guidance block but leaves these users with contradictory policies; migrate only the exact old starter safely, or keep the active rule compatible with it.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as is. Notes are user-owned files and Skillshare does not rewrite their content on upgrade; a LEARNED.md created under 0.24.x keeps whatever the user has in it, template sentence included. The rule that governs saving is the guidance block in the agent's instruction file, which reconnecting does update, and the new starter sentence only points at that block. Adding an exact-match migration of a one-line template for a feature released days ago would cost more than the mismatch it removes, so I'd rather not add that code path.

@runkids
runkids merged commit 63a3df9 into main Oct 4, 2026
8 checks passed
@runkids
runkids deleted the runkids/memory-guidance branch October 4, 2026 07:06
runkids added a commit that referenced this pull request Oct 4, 2026
Rewrites the generated notes as user-facing entries with examples, drops
the duplicate Performance line that the #384 merge commit produced, and
syncs the website changelog.
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.

1 participant