Repository navigation
feat(claude-code): start sessions with the agent's recent notes - #2040
rileycrane wants to merge 1 commit into
Conversation
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
left a comment
There was a problem hiding this comment.
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) => |
There was a problem hiding this comment.
[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
left a comment
There was a problem hiding this comment.
🤖 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.
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.tsgains a helper next to core memory. It reads yesterday's and today's notes by slug and keeps the newest 8 KB of each.<recent-notes>block after core memory, once per process start.Trade-offs
launch-boundary.test.tsloosens that invariant in three tests.Try it (
just dev, with a local Claude Code agent)mem/notes/<today>), for example "I like short answers".🤖 Generated with Claude Code
buzz-review-completed