r/devtools • u/Spare_Bat_3040 • Oct 24 '26
Building Shifu's coding memory: correcting a remembered decision without editing its source
Imagine your coding agent retrieves a note saying a five-minute cache TTL is a product requirement. You correct it: that TTL was a temporary experiment during an incident. Before the next change, what should the agent see: the old note, your correction, or an unexplained replacement?
That's an illustrative case behind a design choice in Shifu, the personal work-context engine I'm building for engineers using Codex, Claude Code or OpenCode on existing products. With MCP and harness instructions, an agent can retrieve decisions, constraints and rationale from work you choose to share.
For the MCP correction path, I require an explicit user correction tied to the current record and its version. The corrected interpretation gets a new version while the original source evidence and approval state stay intact. The record also identifies that a user requested the correction. Editing the remembered statement doesn't turn the original note into something it never said, or confer approval that wasn't already there.
The current-version check matters when two sessions have read the same record. After one correction is accepted, an edit based on the older version conflicts. I want the caller to inspect the current record and the user's intended correction before trying again. Quietly applying the stale edit would hide that another correction happened in between.
For the cache example, I'd test a correction that adds the missing temporary scope, then reopen the context from another session. I'd check that the corrected statement keeps its original evidence attached and doesn't change approval merely because it was edited. I'd also test an older edit arriving afterwards and re-extraction of the same source. Those are the cases I'd use to exercise the contract; this example isn't a customer incident or a report of a live test.
There's still a judgment boundary. Recording a user's correction tells me who supplied the new interpretation. It doesn't independently establish that the new interpretation is true. If the source and the correction disagree, that disagreement needs to stay inspectable when the next task depends on it.
If you build memory into coding tools, what information should a later session receive so it can use a correction without losing the evidence behind it?
If you're repeatedly reconstructing decisions before changing your own codebase, try Shifu on one feature you're planning: https://useshifu.com. I'm the builder and can help connect one supported source you're allowed to share, inspect the returned context, and see whether it belongs in your plan. Keep confidential work details out of this thread.