(第二部分)将克劳德整合到我的代码库中,尝试持久化内存
1 分•作者: blas0•5 天前
我“杀”了我的“宝贝”,这是我做过的最好的决定
只有几千人看到了我的 CAM 帖子,这是一个 10,000 行的语义记忆接口,带有嵌入、知识图谱和 Claude 钩子。
我用了大约一周后发现:
* 它确实有效
* 慢 < /3
实际发生了什么
花了一些时间构建这个精心设计的记忆基础设施。向量数据库。SQLite。语义搜索。自动摄取管道。关系图。应有尽有。
它奏效了!Claude 记住了东西!问题解决了,对吧?
但是...
每次会话启动都需要 4 秒以上的时间。尝试运行 6 个 ghostty 会话,并填充相当大的上下文窗口。我基本上是在看着 Claude 吞噬我的内存。
我构建的旨在使 Claude 更“高效”的东西却让 Claude 变慢了。
所以我想到:
“我是在围绕 Claude 进行工程设计,还是与它一起工作?”
重构:
全部扔掉。重新开始。
新堆栈:
* 两个 Bash 脚本
* 全局/项目 CLAUDE.md 文件
* Claude 代码钩子
* 仅此而已
会话开始 → 上下文从 Markdown 加载
会话结束 → 状态保存到 Markdown
没有 API 调用。没有数据库。没有依赖项。
总共 1,500 行。
见解:
代理不需要精心设计的记忆基础设施。
他们需要一个持久层,这个层需要:
* 足够简单,值得信赖
* 足够轻量,可以忽略
* 足够强大,可以持久化
事实证明,CLAUDE.md 文件 + Bash 脚本 + 钩子可以完成 10k 行的“怪物”所做的一切。只是……更干净。更快。并且更易于维护。
哲学转变
我不再试图围绕 Claude 的局限性构建,而是开始利用 Claude 的优势。
最初的系统是我试图变得聪明并尝试新颖性(感谢 ADHD)
“Claude 没有记忆?我将构建一个完整的数据库!”
新系统是我变得聪明。
“Claude 可以读取 Markdown,Bash 快得要命。让我们直接使用它。”
更少的基础设施 = 更少的瓶颈 = 更多的窗口 = 更高的速度
未分离的记忆
我就是这么称呼它的。
同样的问题,同样的解决方案。代码减少了 93%。速度提高了 10 倍。实际上可以维护。
有时候,行动是减法而不是加法。
有时候,你 10,000 行的“解决方案”只是因为你能才过度设计。
---
总结 - 重写了我的整个 Claude 记忆系统。从 10k 行带数据库到 1.5k 行带 Markdown 文件。现在可以立即启动。运行 6 个窗口,没有延迟。了解到简单每次都胜过聪明。
原始分离线程的链接:https://www.reddit.com/r/ClaudeAI/comments/1phtii5/unsevering_claude_to_my_codebase_achieving/ 如果你想看看我们是如何走到这一步的
Git 仓库链接:https://github.com/blas0/UnseveredMemory
查看原文
i killed my baby and it was the best decision i ever made<p>only a few thousand of you saw my CAM post, the 10,000 line semantic memory interface with embeddings and knowledge graphs and claude hooks.<p>i found after about a week of using it:
- it worked
- slow </3<p>what actually happened<p>spent some time building this elaborate memory infrastructure. vector db. sqlite. semantic search. auto-ingestion pipelines. relationship graphs. the whole nine yards.<p>it worked! claude remembered stuff! problem solved right?<p>except...<p>every session took 4+ seconds just to boot. try running 6 ghostty sessions with a pretty big chunk of filled context windows. i was basically watching claude fibbergitting (aka eating my ram up)<p>the thing i built to make claude more "performant" was making claude slower.<p>so i thought:<p>"am i engineering around claude or working with it?"<p>refactoring:<p>threw it all out. started over.<p>new stack:<p>- two bash scripts<p>- global/project CLAUDE.md files<p>- claude code hooks<p>- thats it<p>session starts → context loads from markdown<p>session ends → state saves to markdown<p>no api calls. no database. no dependencies.<p>1,500 lines total.<p>insight:<p>agents dont need elaborate memory infrastructure.<p>they need a persistent layer thats:<p>- simple enough to trust<p>- light enough to ignore<p>- powerful enough to persist<p>turns out CLAUDE.md files + bash scripts + hooks can do everything the 10k line monster did. just... cleaner. faster. & more maintainable.<p>the philosophy shift<p>i stopped trying to build around claude's limitations and started building with claude's strengths.<p>the original system was me trying to be clever and attempt novelty (thx adhd)<p>"claude has no memory? ill build a whole ass database!"<p>the new system is me being smart.<p>"claude can read markdown and bash is fast as hell. lets just use that."<p>less infrastructure = less bottlenecks = more windows = more velocity<p>unsevered memory<p>thats what im calling it.<p>same problem solution. 93% less code. 10x faster. actually maintainable.<p>sometimes the move is subtracting not adding.<p>sometimes your 10,000 line "solution" was just you over-engineering because you could.<p>---<p>tl;dr - rewrote my entire claude memory system. went from 10k lines with databases to 1.5k lines with markdown files. boots instantly now. runs 6 windows without lag. learned that simple beats clever every single time.<p>link to original severance thread: https://www.reddit.com/r/ClaudeAI/comments/1phtii5/unsevering_claude_to_my_codebase_achieving/ if you wanna see how we got here
link to git repo: https://github.com/blas0/UnseveredMemory