惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Securelist
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
V
V2EX
小众软件
小众软件
博客园 - 聂微东
H
Help Net Security
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
F
Fortinet All Blogs
S
Schneier on Security
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
Google Online Security Blog
Google Online Security Blog
Webroot Blog
Webroot Blog
A
Arctic Wolf
量子位
博客园 - 叶小钗
I
Intezer
C
Check Point Blog
Cloudbric
Cloudbric
IT之家
IT之家
Last Week in AI
Last Week in AI
GbyAI
GbyAI
Attack and Defense Labs
Attack and Defense Labs
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
Jina AI
Jina AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
J
Java Code Geeks
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
L
Lohrmann on Cybersecurity
有赞技术团队
有赞技术团队
Simon Willison's Weblog
Simon Willison's Weblog
The Register - Security
The Register - Security
T
Threatpost

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
A 3-layer memory system that gives Claude Code persistent context across sessions.
Ssanvi Build · 2026-05-26 · via DEV Community

Claude Code forgets everything between sessions. You explain your project, your architecture, your preferences and next session it's ground zero again.

I spent 45 minutes setting this up manually. Debugging ports, copying tokens, configuring MCP servers by hand. Then days debugging the Smart Connections integration.

So I built ObsiForge, one command that does all of it:

obsiforge init --name myproject --path ~/vaults/myproject

Enter fullscreen mode Exit fullscreen mode

30 seconds + 2 plugin clicks. The rest of this article explains what it configures and why each layer matters.

The architecture

Three layers, each with a distinct job. No duplication. No redundancy.

  • Layer 3: MEMORY.md (pointers only) → "Where to find things"
  • Layer 2: Obsidian vault (knowledge) → "What we know"
  • Layer 1: claude-mem (observations) → "What happened this session"

Layer 3 - MEMORY.md (pointers, not content)

Each project gets a MEMORY.md that points to where knowledge lives. It never stores knowledge itself, just pointers and rules.

This is the only file Claude reads on every session start. ~800 tokens to know where everything is.

The rules are simple:

  • NEVER store actual knowledge here, only pointers.
  • Project context goes to the Obsidian vault (Layer 2).
  • Session observations go to claude-mem (Layer 1).
  • This file is a pointer only.

The search tools are listed here:

  • Semantic search: mcp__smart-connections__search_notes
  • Specific file: mcp__obsidian-mcp-tools__get_vault_file
  • Session history: mcp__plugin_claude-mem_mcp-search__search

Layer 2 — Obsidian vault (project knowledge)

Each project has a vault with self-contained notes. No wikilinks, no "see also", each note has full context.

  • project.md — architecture, stack, decisions, roadmap
  • user.md — preferences, code style, what works/doesn't
  • MEMORY.md — search tools, session lifecycle, vault index
  • [other].md — assessments, gap analyses, ADRs

Smart Connections indexes these at block level (384-dim embeddings via bge-micro-v2, running locally inside Obsidian). The MCP server exposes search_notes to Claude Code.

Layer 1 — claude-mem (session observations)

Automated capture via hooks. Every tool use gets logged as an observation. At session start, the last 50 observations get injected into context. At session end, /consolidate distills what matters into the vault.

SQLite + Chroma (vector DB) running locally. Zero cloud dependencies.

The session lifecycle

START → /dashboard

  • Read 3 core notes (project.md, user.md, MEMORY.md)
  • Check claude-mem for recent activity
  • Smart Connections semantic search for related context
  • Brief the user

WORK → normal Claude Code session

  • claude-mem captures observations automatically
  • Smart Connections available for semantic lookups
  • Vault notes readable/writable via MCP

END → /consolidate

  • Search claude-mem for session observations
  • Filter: what belongs in vault vs. what stays in claude-mem
  • Update vault notes
  • Report what was consolidated

The Smart Connections problem

The Smart Connections plugin for Obsidian generates embeddings fine, bge-micro-v2, 384 dimensions, block-level indexing. The problem was the MCP server that bridges Claude Code to those embeddings.

Its search_notes function was doing regex matching. The code literally said:

"For now, we'll do a simple keyword match since we don't have a way to generate embeddings for arbitrary text without the model."

Every time Claude Code "searched semantically," it was grepping. A query like "how to handle offline data sync" would only find notes containing those exact words, not notes about "event sourcing" or "conflict resolution" which is the entire point of embeddings.

The other search tools (get_similar_notes, get_embedding_neighbors) do real semantic search, but they require a pre-existing note path or a raw 384-dim vector. search_notes is the only tool that accepts free text, and it's the one MCP clients call most often.

The fix

I added @xenova/transformers to the MCP server and rewrote searchByQuery to generate embeddings from the query text, then find nearest neighbors by cosine similarity.

Before (regex): 0 results — no note contains those exact words.

After (embeddings): 5 results — similarity 0.60-0.63, conceptually relevant.

I used Claude Code itself to diagnose the bug and write the fix. This is now PR #7 on the original repo.

This is the kind of thing ObsiForge's doctor command catches, if your semantic search isn't actually semantic, you want to know before you rely on it.

Token economics (real data)

Measured from an active project with 21 vault notes totaling 243KB:

Layer What Token cost
Layer 3 MEMORY.md (pointers) ~800 tokens, loaded every session start
Layer 2 3 core vault notes ~5,300 tokens on /dashboard call
Layer 1 claude-mem (50 observations) ~5,000-15,000 tokens auto-injected at start
Layer 2 Smart Connections query ~300-800 tokens on demand per search
Layer 2 Additional vault note ~1,000-4,500 tokens on demand per read

Without memory (baseline): re-explaining project context costs ~3,000-6,000 tokens per session. And Claude still doesn't have the full picture.

With memory: ~6,100-20,000 tokens for full context. But you get:

  • Architecture decisions that would take 10+ minutes to explain.
  • Bug fixes from 3 weeks ago that Claude remembers.
  • User preferences without re-stating them.

Without memory, to get the same context you'd need to manually re-explain:

What you'd re-explain Token cost
Project architecture ~4,200 tokens
User preferences ~640 tokens
Past decisions and why ~2,700-10,000 tokens
What was tried and what failed ~5,000-15,000 tokens
Total without memory 10,000-30,000 tokens per session

And the real problem isn't the cost, it's that you wouldn't remember what to include. The session from 3 weeks ago where approach X didn't work? You wouldn't think to mention it. The architectural decision from last month? You'd summarize it differently each time.

Real token savings: 1.5-2x less per session. But what's priceless is that claude-mem captures "we tried X and it failed because Y" knowledge you wouldn't re-explain because you simply wouldn't remember it.

The key insight: we never load all 60,700 tokens of the vault. The pointer file (800 tokens) tells Claude where things are, and it pulls knowledge on demand via semantic search. Most sessions need 2-3 vault reads and 1-2 searches.

Session type Searches Reads Tokens used
Quick (1 search, 1 read) 1 1 ~7,100
Deep (3 searches, 5 reads) 3 5 ~18,000
Continuation (dashboard only) 0 3 ~6,100

claude-mem's context injection (~5,000-15,000 tokens for 50 observations) is the main cost. But "we already tried X and it failed because Y" saves far more tokens than it costs.

What's not automatic (and what I did about it)

Consolidation is a skill, not a script.

The /consolidate skill requires Claude's judgment: what knowledge belongs in the vault (permanent) vs. what stays in claude-mem (session-level). A script can't decide if "we switched from REST to gRPC" is a vault-worthy architectural decision or a temporary debugging note.

What I did automate: at session end, a Stop hook runs that checks whether you're in a project with an Obsidian vault and reminds you to consolidate. The actual distillation still needs Claude's judgment, but you no longer have to remember to run /consolidate, the system reminds you.

Cross-project boundaries are solved by separate sessions. Each project gets its own vault, its own MEMORY.md, and its own .mcp.json. When you work on project A, Claude loads project A's context. When you switch to project B, you open a new Claude Code session in project B's directory. No cross-contamination. claude-mem is global (it sees all sessions), but /consolidate filters by project, so observations go to the right vault.

Re-indexing happens inside Obsidian. If you add notes outside Obsidian, re-open Obsidian to trigger re-embedding. The Smart Connections plugin handles this automatically when it's running.

ObsiForge automates all of this

The 3-layer architecture is a pattern, not a product. You can set it up manually, the steps above work. But the setup is fragile: wrong port, expired token, plugin version mismatch, and nothing works.

ObsiForge handles:

  • Plugin download and configuration
  • MCP server setup with port collision prevention
  • Token generation and configuration
  • MEMORY.md template with search tools
  • /dashboard and /consolidate skills
  • Multi-vault support (separate ports, separate configs)
  • obsiforge doctor — 9 health checks to diagnose any setup issue
uv tool install https://github.com/ssanvi-builds/ObsiForge
obsiforge init --name myproject --path ~/vaults/myproject

Enter fullscreen mode Exit fullscreen mode

Enable 2 community plugins in Obsidian Settings (security requirement, not bypassable). Done.

If you want to set it up manually, the steps in the original guide still work, but you'll probably spend some time instead of 30 seconds.

github.com/ssanvi-builds/ObsiForge

Takeaways

  1. Verify your semantic search is actually semantic. The search_notes tool was regex for months. If your "semantic search" only finds exact keyword matches, it's not semantic.
  2. Pointers over copies. MEMORY.md stores ~800 tokens that point to 60,700 tokens of knowledge.
  3. Self-contained notes beat wikilinks. Each vault note has full context. No "see X for details" that breaks when X moves.
  4. The lifecycle matters more than the storage. /dashboard → work → /consolidate is the loop. Without it, knowledge rots.
  5. Consolidation needs judgment. Automate the reminder, not the action. A script can't decide if "we switched frameworks" is vault-worthy or just a session note.
  6. Separate projects, separate sessions. One vault per project, one Claude Code session per project. No cross-contamination.
  7. Open source tools can have quiet gaps. The MCP server's most-called tool was its least-tested for semantic correctness. Test your tools' claims.
  8. Manual setup takes 45+ minutes and breaks easily. Automated setup takes 30 seconds. Use the tool.

The smart-connections-mcp fix is PR #7 on an MIT-licensed project.

ObsiForge is open source and free: github.com/ssanvi-builds/ObsiForge

The 3-layer architecture is just a pattern, no special code needed, just discipline about what goes where.

If you're building something similar, the key question isn't "what tool do I use?" but "what does each layer store, and who reads it?" Get that right, and the tools are interchangeable.