Prose has no state
The memory server worked. I could ask a question in September and get back the three paragraphs I needed from March, on either machine, ranked by relevance. The problem it left behind took a few months to name.
A memory cannot be finished.
Every session summary my /stop routine wrote ended with the same three sections: what got done, what was blocked, what comes next. Good structure, and it made the handoffs readable. But a memory row is a piece of text with a timestamp. When a summary from March said the fragRag bearer token needed rotating, that sentence sat in the store reading exactly as urgent in September as the day it was written, because there was nowhere to record that it had been handled. The only way to know was to find a later memory that happened to mention it.
By late August the store held 2,525 memories. Just under a thousand were session summaries, and every one of them carried a next-steps section that had never been reconciled against any other. The result was a specific and slightly comic failure mode: I would start a session, the memory search would surface a handoff, and I would begin work on something I had already finished six weeks earlier on a different machine.
Multiply that by the number of things reading the store. Claude Code on the laptop, Claude Code on the VPS, and Codex threads on a couple of repositories. Each of them, given the same query, would surface the same stale next step and each would treat it as live.
Memory answers why, issues answer whether
The fix was to stop asking memory to be the ledger.
Git already had the primitive I was missing, and it had it before any of this. An issue has an identifier, a state with exactly two values that everything agrees on, an assignee, a comment thread, and a close event with a timestamp and an author. Every machine I own can already read and write them over an API that has been stable for a decade. Every model I use already understands what an issue is.
So I wrote the rule down in a spec, docs/memory-issue-bridge.md, and it comes to three lines. GitHub issues are the single source of truth for anything trackable. Memory is the session-context layer that references issues. On conflict, GitHub wins.
The division of labour that falls out of it is clean in a way I didn't anticipate. Memory is very good at the question no tracker answers: why did we do it this way, what did we try first, what broke. Issues are very good at the question memory can't answer: is this still outstanding. Asking either one to do the other's job is where I'd been losing time.
Promotion
Mechanically it's a promotion step, and it runs at the end of a session.
A memory can carry an actionable tag. At session close, a routine collects that session's actionable memories and turns each one into a GitHub issue in the repository the work belongs to. Three MCP tools do the work: one promotes a single memory, one sweeps a whole session, and one resolves which repository a project maps to.
The memory row gained two columns to hold the link, github_issue_url and github_issue_state, plus two partial indexes: one over actionable memories with no issue yet, one over the issue URL. Partial because the interesting queries are both narrow. "What have I written down as actionable and never filed" is a question about a small slice of a large table.
The link is bidirectional, which is the part that actually retires the stale-next-step problem. A poller watches the issues. When one transitions from open to closed it patches the memory's state through a REST endpoint and adds a resolved tag. The next search that surfaces that memory surfaces it marked done, so a session in September reading a March handoff can see that the token rotation was closed in April without having to find the memory that says so.
Two kinds of duplicate
Promotion without deduplication would have been worse than no promotion. I found this out immediately, because the first thing I did was re-run a session close to test it.
There are two distinct duplicate shapes and they need different detectors.
The first is the same work described in different words, which happens because two sessions independently notice the same problem. Cosine similarity catches it. The threshold is 0.85, checked against memories already promoted to the same repository, and the scoping matters: the same sentence about restarting a service is a duplicate within one project and a coincidence across two.
The second is the identical title arriving twice, usually from re-running a promotion or from a memory that was written once and swept twice. An exact title match against that repository's open issues catches it for a fraction of the cost of an embedding comparison.
Both fired in testing. One candidate was rejected on title against an existing issue, and another was caught by similarity at 0.928 against a memory that had already become an issue. Keeping both stages was the right call, because the cheap one handles the common case and the expensive one handles the case that actually causes duplicate work.
Which repository is this, anyway
The step I badly underestimated was mapping a working directory to a repository.
My first version matched on the directory's basename against the project name, with a repo-slug fallback. It works for maybe two thirds of my projects and fails silently for the rest, which is the worst available outcome, because a promotion that can't resolve a repository just doesn't file anything.
The example that broke it: /home/michael/fragrag/claude-memory is a working copy of gitDiot-Org/fragRag. There's no string relationship between the path and the repository. The directory is named after the service, the repository is named after the product, and the sshfs mount that puts it at that path is named after neither.
The fix was to stop inferring and start recording. A project_repo_paths table, one project to many paths, unique on the pair and indexed on the path, because the same project sits at a different absolute path on every machine. Five projects across two machines came to ten rows. Resolution now queries that table first and keeps the old heuristics as fallbacks, wrapped so that an unmigrated database degrades instead of failing.
Ten hand-entered rows is not elegant. It is, however, the only version that gets /home/michael/fragrag/claude-memory right, and I'd rather maintain ten rows than debug silent non-promotion again.
Identifiers as coordination keys
The part I did not plan for is that once every piece of trackable work has a stable identifier, that identifier turns out to be useful for something else entirely.
I run a small toolkit for parallel agent work: claims held as locks on an orphan coordination branch, one worktree per task, branches named agent/<host>/<slug>, and a FIFO merge queue. Claims serialise on file paths, so before an agent touches anything it declares the paths it needs.
The convention that ties it together is that the claim slug is the issue identifier. Claim, worktree, branch, and issue all carry the same name, so the link between "who is working on this right now" and "what is this work" costs nothing to maintain and can't drift.
In August I ran eight concurrent claims against one repository, AgentCRM. Two files were the contention points: a 4,700-line pipeline module that four separate issues all wanted to edit, and the migrations directory, which has to be claimed as a whole directory because claims serialise paths and not migration sequence numbers. The strategy that made it work was slicing each issue so that at most one slice touched a chokepoint and deferring the rest. Five issues ran genuinely in parallel with zero collisions, and the deferred halves became their own issues, which is exactly the behaviour you want from a ledger.
There's a gap in it I still haven't closed. When the toolkit is used with pull requests instead of the merge queue, nothing releases the claim after a merge, because the release path lives in the queue code that never runs. The claims go stale and get cleaned up by hand. It's filed, which is the whole point of the system, and it's still open, which is also the point.
The 403 nobody saw
Worth recording the failure that cost the most, because it wasn't in any of the design.
The poller that syncs issue state had been returning 403 and skipping. Fine-grained personal access tokens need Issues granted read and write explicitly; repository access alone doesn't imply it. The poller treated the error the way pollers usually treat errors, which is to log it and move on to the next connection, so nothing surfaced.
When the tokens were fixed, the first clean cycle drained six outbound syncs that had been stuck. Six is a small number. The reason it stayed small is luck, because the same silent-skip pattern showed up again later at a much worse scale, and that story belongs to the next chapter.
The lesson I took from it is about integration points rather than tokens. A sync layer that fails by skipping looks identical to a sync layer with nothing to do. If a component's healthy state and its broken state produce the same logs and the same dashboard, you will not find out from the dashboard.