Skip to content

feat(memory): share notes between the agents in one project's panes - #85

Merged
code0xff merged 2 commits into
devfrom
feat/memory-plugin
Oct 7, 2026
Merged

code0xff merged 2 commits into
devfrom
feat/memory-plugin

Conversation

@code0xff

@code0xff code0xff commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Purpose

Coding agents running in different panes of one project had no way to tell each other anything. nightcrow-memory gives them a shared set of notes and a status board, as MCP tools each agent's CLI calls.

  • nightcrow-memory mcp is a stdio MCP server. Tools: memory_write, memory_search, memory_recent, memory_delete, board_post, board_read.
  • One SQLite file per project under ~/.nightcrow/memory, never inside the repository. The project is found through NIGHTCROW_PLUGIN_RUNTIME_DIR and NIGHTCROW_PANE_TOKEN, which nightcrow already sets on every pane, so there is no host change.
  • nightcrow-memory export prints a project's board and notes as Markdown.

Design notes for review

  • No server process. The original plan was a host-spawned plugin with a socket and a single writer. The host only starts a plugin a pane names or one with watch_on_signal, and a single writer adds nothing SQLite does not already do across processes, so each helper opens the file directly. Recorded in docs/decisions.md.
  • New dependency: rusqlite 0.40 (MIT) with bundled, which compiles SQLite in and needs a C compiler on every CI platform.
  • Release automation is touched (needs @code0xff review): the crate inherits the workspace version, so release-policy.json, release-lib.mjs and its test now list six version entries, and the push hook's plugin scope names both plugin crates.
  • Trust: a note is another agent's text. Reads are prefixed with a notice, bodies are quoted so they cannot forge another entry's heading, and authors are labelled but not verified. This lowers cross-agent prompt injection and does not remove it; the limits are documented in docs/plugins.md.

Verification

  • cargo build / test / clippy -D warnings --locked --workspace and cargo +stable fmt --all --check pass on macOS: 2205 tests, 60 of them new.
  • Process-level tests start the binary as an agent would: two agents in one project, a different project seeing nothing, a run outside a pane, four concurrent writers, and export.
  • An opener race found during testing (WAL switch answering BUSY at once, about 40% of concurrent starts) is fixed and covered; the new test fails 3 runs in 10 with the retry removed.
  • Checked against the official Python MCP client SDK: handshake, tool listing, calls and tool errors.
  • node --test scripts/prepare-release.test.mjs scripts/publish-release.test.mjs and prepare-release.mjs check pass.

Not run: Linux and Windows (left to CI), and a session with real Claude Code, Codex or OpenCode. The Codex and OpenCode registration snippets follow those tools' documentation.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K9Y6nr4J3kMp6GVQNUd9Ry

code0xff and others added 2 commits October 7, 2026 09:13
`nightcrow-memory mcp` is a stdio MCP server each agent's CLI runs. It
offers notes (write, search, recent, delete) and a status board (post,
read), kept in one SQLite file per project under ~/.nightcrow/memory and
found through the two variables nightcrow already sets on every pane, so
agents in the same project meet without configuration and an agent
started elsewhere reaches nothing.

There is no server between them. The host only starts a plugin some pane
names or one with `watch_on_signal`, and a single writer process would
add nothing SQLite does not already do across processes. The one place
that needed care is opening: switching to WAL answers BUSY at once
rather than waiting out the busy timeout, so agents starting together
failed to open a store that was merely being opened; it is retried.

Every read is prefixed with a notice that entries are another agent's
unverified notes, authors are labelled with the client name and a prefix
of the pane token, and text over a limit is refused rather than cut.

The crate inherits the workspace version, so the release policy and the
push hook's plugin scope list it beside the recovery plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K9Y6nr4J3kMp6GVQNUd9Ry
How to install it and register it with Claude Code, Codex and OpenCode,
what each tool does, its limits, and the three things to know before
turning it on: a note is another agent's words, the store is neither
private nor authenticated, and nothing scans what agents write.

The architecture notes record that it is a pane helper outside the
plugin protocol, and the decision record why it opens SQLite directly
and which alternatives were set aside.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K9Y6nr4J3kMp6GVQNUd9Ry
@code0xff
code0xff merged commit 2dc3b46 into dev Oct 7, 2026
6 checks passed
@code0xff
code0xff deleted the feat/memory-plugin branch October 7, 2026 04:41
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