Skip to content

✨ knowledge: drain CLI auto-memory into beads/knowledge at session end instead of hidden MEMORY.md #17033

Closed
3 of 3 issues completed

Description

@clubanderson

Summary

Design-only issue (no PR attached). Follow-up to the CLI-memory isolation / disable work.

Greg Hunt (2026-11-05 community meeting): the CLIs' built-in memory "creates its own hidden bead storage … like 60% of these should have been beads … is there a create-memory hook where instead we could overload that for our CLIs and make it inject a bead instead? I pulled them down locally, created them as beads, and turned that feature off on the CLI."

Hive already has the destination: beads (bd create --type knowledge), the knowledge store with lifecycle states (draft/approved/deprecated/superseded), per-agent knowledge.agent_scopes, the kick primer (src/pkg/scheduler/kick_priming.go:256-305) and the pull-mode TOC/MCP. What is missing is the drain: anything a CLI writes to its memory store should become a reviewable, scoped, lifecycle-managed knowledge bead instead of a hidden per-agent Markdown file.

Design sketch

  1. Claude Code: register a SessionEnd hook (and optionally PostToolUse matched on writes under ~/.claude/projects/*/memory/) in the hive-seeded settings.json. The hook script reads MEMORY.md + sibling topic files, emits one bd create --type knowledge --state draft --tag auto-memory --tag agent:<name> per entry (dedup by content hash), then truncates the memory file. Hook docs: https://code.claude.com/docs/en/hooks
  2. Codex: no hook surface for memories yet; run the same drain over $CODEX_HOME/memories from the manager at kick time (same hook point as clear_memory_on_kick), before the wipe.
  3. Copilot CLI / Gemini: same manager-side drain over their memory dirs.
  4. Drained beads enter as draft so the knowledge curator / operator promotes or discards them; nothing auto-primes into other agents until approved. This is exactly the "I don't want a developer agent working another ticket to pull that information in yet" scoping Greg asked for.
  5. Revives open question 5 in src/docs/design/knowledge-system.md:566 ("should ~/.claude/projects/*/memory/ be migrated into the wiki?") — answer: yes, as draft knowledge beads, via the drain, and the memory file is then emptied.

Open questions

  • Dedup/merge strategy when the same inference is drained from several agents.
  • Whether to run the drain through the existing knowledge.curator instead of a bespoke hook script.
  • Prompt-injection posture: drained text is agent-written; keep it draft and never render it into a kick until approved.

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 7, 2026
  2. hivecommons-hive commented on Nov 7, 2026

    @hivecommons-hive
    Contributor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

    Claim history
    • 2026-11-07 18:48 UTC — claimed by scanner (agent on hive hosted-available-oke-11-placeholder-r05x)
    • 2026-11-07 18:48 UTC — claimed by scanner (agent on hive hosted-available-oke-11-placeholder-r05x)
  3. hivecommons-hive commented on Nov 7, 2026

    @hivecommons-hive
    Contributor

    Design PR #17061 opened; implementation decomposed into #17056, #17057, #17058 (sub-issues).


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

    — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

  4. added 2 commits that reference this issue on Nov 7, 2026
    66f1228
    f1a4d07
  5. added 3 commits that reference this issue on Nov 7, 2026
    76d0f72
    61996b8
    6fe79ae
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

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions