Skip to content

feat(claude-code): start sessions with the agent's recent notes - #2040

Open
rileycrane wants to merge 1 commit into
mainfrom
rileycrane/bestie-l2b-recent-notes
Open

rileycrane wants to merge 1 commit into
mainfrom
rileycrane/bestie-l2b-recent-notes

Conversation

@rileycrane

@rileycrane rileycrane commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

A Claude Code agent now starts each session knowing what it wrote down today and yesterday. Its prompt carries those daily notes (mem/notes/<date>) next to core memory.

It is based on main and is independent of the Bestie tab stack (#2034 onward).

What changes

  • features/agent-harness/core-memory.ts gains a helper next to core memory. It reads yesterday's and today's notes by slug and keeps the newest 8 KB of each.
  • The Claude Code runtime adds a <recent-notes> block after core memory, once per process start.
  • A missing, blank or unread note adds nothing, and a start waits at most 2 seconds for the notes.
  • Dates follow the device's time zone, with UTC as the fallback.

Trade-offs

  • An agent's process start now does one relay read. Before, it did none: launch-boundary.test.ts loosens that invariant in three tests.
  • A long-running process keeps the notes it read at start until it restarts, including across midnight.
  • Claude Code only. Codex, goose, Pi and hosted agents are not covered.

Try it (just dev, with a local Claude Code agent)

  1. Ask the agent to save a note for today (mem/notes/<today>), for example "I like short answers".
  2. Restart the agent (or Buzz) and start a new chat. Ask it what today's note says. It answers without reading memory first.
  3. An agent with no daily notes behaves as before.

🤖 Generated with Claude Code

buzz-review-completed

A Claude Code session's prompt now carries yesterday's and today's
mem/notes/<date> after core memory, read by slug once per process start
and the newest 8 KB of each. A missing, blank or unread note adds
nothing, and a start waits at most 2 seconds for them.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kyle reviewed this PR and the Nexus review-tracker notes and approved with the non-blocking comment below.

Posted by Codex (gpt-6.1-sol) on behalf of kylez

// slow read starts it without them.
const [memory, notes] = await Promise.all([
this.core(agent),
recentNotesSection((slug) =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Release startup note reads when their budget expires

The outer timeout stops startup waiting after two seconds, but this.memories() still permits the underlying read to run for ten seconds. Since owner-view memory reads share a serialized queue, a stalled startup note read can make another agent’s memory read time out after this session has already started. I reproduced a 2.5-second core read succeeding without these startup reads and timing out with them. Could the startup budget also cancel the underlying note work, without cancelling unrelated shared readers?

Posted by Codex (gpt-6.1-sol) on behalf of kylez

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Star Lord’s automated source review via Wes’s GitHub account, with independent Rocket, Mantis and Groot coverage.

The existing P2 about releasing startup note reads remains applicable at this head. The two-second wrapper stops waiting, but the underlying read can occupy the shared serialized memory queue for ten seconds. A different agent with no cached core can exhaust its five-second startup budget behind that optional work and start without its memory. Please address the existing comment’s cancellation/queue-isolation recommendation while preserving unrelated shared readers. I’m referencing that thread rather than adding a duplicate inline finding. No additional actionable defects found in the six-file PR diff.

Reviewed head 0b66b4b44e2275c6d6f8493fe63da0463889ac83, target base b5747efe32a7fc6df97714f8dd70dfe9a9fff907, merge-base 336e8a147dedf12034301ccaa57d471f119dd906. Inspected launch callers, memory isolation/lifetime, date and UTF-8 handling, changed test coverage, public description and commit material (no attached images).

Source-only: no tests, builds, app launches or live Claude/relay workflows executed. The hosted-check snapshot shows CI required passing; Windows native validation and browser flake check were skipped. Real startup latency, native acceptance and incremental test cost remain unverified. This is a non-blocking COMMENT review, not approval or merge authorization.

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.

3 participants