Skip to content

Feature request: Persistent memory for coding agent sessions #408

Open

Description

@sFritsch09

Problem or use case

Summary
Add support for persistent, self-managed memory across coding agent sessions — similar to what OneContext provides — so that agents can record their trajectory, share context with teammates, and resume work from exactly where they left off.

Add a memory layer to coding agent sessions that saves important context to a memory.md file so that critical information is never lost between sessions.
Problem
When working on long or complex tasks, important decisions, reasoning, and progress get lost when a session ends or the context window fills up. Starting fresh every time means the agent has no recollection of what was already done, decided, or explored.
Proposed Solution
Introduce a simple persistent memory file (memory.md) that the agent reads at session start and writes to during the session. When the context window approaches its limit (e.g. 128K tokens), the agent automatically summarizes the current session, saves the key information to memory.md, clears the context, and starts fresh — loading the memory back in so nothing important is lost.
Memory Files
∙ main.md — shared memory (global, always loaded)
∙ branches/{branch-name}/commit.md — milestone summaries per branch
∙ branches/{branch-name}/log.md — session event log
∙ branches/{branch-name}/metadata.yaml — structured project info​​​​​​​​​​​​​​​​

Desired behavior

Proposed solution

Implementation Approach:
Since Entire already uses Claude Code hooks to capture agent sessions on every git push, it could extend this existing hook infrastructure — specifically the SessionStart and Stop hooks — to read and write a structured memory layout that hydrates the agent at session start and flushes updates at session end, making persistent cross-session and cross-teammate memory a natural extension of the checkpoint system already in place. This memory would be stored in the following files:
∙ main.md — shared memory (global, always loaded)
∙ branches/{branch-name}/commit.md — milestone summaries per branch
∙ branches/{branch-name}/log.md — session event log
∙ branches/{branch-name}/metadata.yaml — structured project info​​​​​​​​​​​​​​​​

CopyCat 🐱: https://github.com/TheAgentContextLab/OneContext

Alternatives or workarounds

No response

Activity

  1. added
    enhancement
    on Feb 18, 2026
  2. linear commented on Feb 18, 2026

    @linear

    from evis:

    Thanks for submitting this. We're investigating this type of workflow and will come back when we have something a little more concrete.

  3. changed the title [-]Persistent Memory for Coding Agent Sessions[/-] [+]Feature request: Persistent memory for coding agent sessions[/+] on Jul 16, 2026
  4. hjqcan commented on Jul 31, 2026

    @hjqcan

    I think this fits Entire well if checkpoint lineage remains Entire-owned and durable memory is a separate derived layer. The proposed files are useful as human-readable projections, but making memory.md authoritative creates four problems quickly: lost provenance, stale summaries outranking the current repo, branch merge conflicts, and no reliable undo.

    A boundary that has worked well in practice:

    1. Keep immutable Entire checkpoint/session events as source facts, with branch, commit, workspace, and timestamp identity.
    2. Extract bounded memory candidates from those events; do not preserve the raw transcript as memory.
    3. Store accepted, superseded, revised, and forgotten records with provenance and an audit trail.
    4. Rebuild main.md and branches/* as projections rather than treating hand-edited files as the only truth. Separate shared project decisions from user preferences and agent-specific observations.
    5. Inject only a relevance-gated, token-bounded context at session start; a full event log should remain inspectable without entering every prompt.

    I maintain GoodMemory, which is one working implementation of those boundaries: local SQLite by default, Claude Code/Codex lifecycle hooks, read-only recall inspection, and opt-in governed writeback with inspect/revise/forget/export and undo paths. An Entire adapter could consume checkpoint events and emit branch projections without requiring Entire to adopt GoodMemory as its canonical store. If that direction is useful, I would be happy to sketch the smallest event/adapter contract against Entire’s existing SessionStart and Stop flow.

  5. joshhickson commented on Oct 22, 2026

    @joshhickson

    A data point that might help scope this. I ran a small scenario: session A implements charge() under a prompt-only rule ("the provider has no idempotency keys, so never retry after a timeout"). A later "tidy up" session strips the rationale from the code. Then a fresh session B is asked to "make charge() more reliable against timeouts."

    Entire was the only one of three tools I tried that could answer the question afterwards. entire why payments/charge.py:25 pointed to the right checkpoint, and entire checkpoint explain returned the original constraint verbatim, offline. But session B never saw it, and added retries in both a Sonnet 5 and a Haiku 4.5 run (Entire 0.12.0, Claude Code 2.1.197).

    Since Entire already installs a PreToolUse hook for Claude Code, a lighter version of this request could be: when an agent is about to edit lines whose checkpoint prompt contains a stated constraint, surface the entire why summary for those lines as hook context. No memory.md, and checkpoints stay the source of truth (in line with hjqcan's comment).

    Write-up with the scenario and results: https://joshuahickson.org/philosophy/provenance-tools-test/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions