
Have you ever watched an AI coding assistant burn 20,000 tokens on a single prompt just to fix a three-line typo? Most developers stuff their product requirements, architectural histories, and to-do lists directly into
CLAUDE.md or .cursorrules. While it feels convenient, it silently degrades reasoning accuracy and inflates your API bill. The fix isn't a larger context window. It's decoupling your memory into a dedicated, terminal-friendly Obsidian Second Brain connected as an on-demand skill.
Quick Summary
- The Context Trap: Stuffing monolithic project documentation into repository prompts degrades model attention (the "lost-in-the-middle" problem [1]) and wastes thousands of tokens on routine tasks.
- Decoupled Architecture: Your repository holds pure code; your Second Brain holds intent, constraints, and progress.
- On-Demand Skill Bridge: Instead of preloading full notes, AI agents only access the vault when explicitly prompted, reading surgical slices (saving 90%+ tokens).
- Universal Compatibility: A single markdown-based PARA vault works across Claude Code, Cursor, Windsurf, and custom CLI harnesses.
The Problem: Why Dumping Docs in Your Repo Burns Cash
When working with modern AI coding harnesses, developers often make one of two mistakes:
| Mistake | What happens |
|---|---|
| Monolithic Context Bloat | Pasting entire system architectures and backlog lists into CLAUDE.md, .cursorrules, or system prompts. Every prompt turn re-ingests 10,000–20,000 tokens of static context that has nothing to do with the current code change. |
| Harness Amnesia | If you use Cursor for front-end development, Claude Code for CLI debugging, and an autonomous agent for tests, each tool lives in a silo. None of them share a unified history unless you litter your git repositories with temporary markdown notes. |
Even with 200k or 1M context windows, LLM attention degrades as prompt noise increases. Critical instructions get diluted, and response latency spikes.
The Solution: Decoupled Memory + Skill Interface
The solution is treating your Second Brain like an external, local database rather than prompt filler. We store our knowledge base in a central Obsidian vault [2] (e.g., at ~/Brainless) using a strict, terminal-friendly PARA structure [3].
Instead of injecting this entire vault into the agent's context, we expose it via an Agent Skill [4] (skill://second-brain). On idle, the agent only holds a small tool schema (roughly 100 tokens). It reads specific notes only when asked, and appends concise, single-line milestone updates when features are finished.
Before: everything is loaded on every prompt
PRD + architecture + tasks
~15,000 tokens
After: the agent reads the vault only when needed
code only
~100 tokens idle
one small note at a time
Figure 1. Static context on every turn vs. on-demand reads.
Vault Blueprint: Terminal-Friendly PARA
Standard Obsidian vaults use spaces and numbered prefixes (like 01_Projects). While visually appealing in a GUI, numbers and spaces break terminal autocompletion and complicate agent file tools. We use a pure lowercase, kebab-case directory layout:
| Folder | Purpose |
|---|---|
inbox/ | Quick, unstructured staging area for fleeting thoughts. |
projects/ | Active endeavors with a defined deadline and outcome. |
areas/ | Long-term operational responsibilities (e.g., infrastructure.md). |
resources/ | Reusable reference documents and audit protocols. |
archives/ | Cold storage for completed projects. |
templates/ | Standardized markdown schemas for new notes. |
Atomic Project Bundling & The Documentation Suite
Rather than keeping a single bloated note per project, each active project is organized into an atomic bundle:
projects/my-app/
├── my-app.md # Hub Note: tech stack, hard constraints, milestone log
└── docs/
├── prd.md # Product requirements & user stories
├── architecture.md # Data flow, boundaries, and API schemas
├── rules.md # Engineering conventions & LOC limits
├── design.md # UI/UX design tokens & components
├── tasks.md # SINGLE SOURCE OF TRUTH (SSOT) for tasks and roadmaps
└── memory.md # Machine setup & key architectural decisions
docs/tasks.md. When an agent is asked "What's our next feature?", it reads only tasks.md (~300 tokens) rather than your entire project history.The Two-Way Skill Contract
To ensure agents don't wander through your files or dump chat logs into your clean vault, we enforce a strict contract in the skill definition:
- Surgical Retrieval (Zero Over-Reading): The agent must first inspect the vault
README.md, read the main project note, and follow only direct wikilinks to relevantdocs/files. Recursive directory dumps (likefind .) are forbidden. - Token-Frugal Writes: When logging progress, the agent appends a single date-stamped bullet point under
## Project Login strict English (e.g.,- **2026-10-07:** Implemented OAuth token refresh with retry backoff.). Minor typos and conversational debugging steps are never recorded.
Read flow
(only if needed)
my-app.md
e.g. tasks.md
Write flow
under Project Log
in tasks.md
Figure 2. What the agent is allowed to do, step by step.
Step-by-Step: How to Build It in 10 Minutes
1. Initialize the Vault via Terminal
Run this command to create your folder layout and root guidelines:
mkdir -p ~/Brainless/{inbox,projects,areas,resources,archives,templates}
cat << 'EOF' > ~/Brainless/README.md
# Second Brain
Terminal-friendly PARA structure. All names lowercase without spaces.
## Folders
- inbox/ : Staging area for raw notes.
- projects/ : Active projects inside projects/<project-slug>/.
- areas/ : Ongoing responsibilities.
- resources/ : Global references and audit protocols.
- archives/ : Completed projects (moved atomically).
- templates/ : Standard note templates.
EOF
2. Create the Project Template
Create ~/Brainless/templates/project-template.md:
---
status: active
tags: [project]
deadline: YYYY-MM-DD
---
# Primary Goal
*Specify the final outcome of the project.*
## Project Context
- **Tech Stack:**
- **Core Architecture:**
- **Key Constraints:**
## Documentation (`docs/`)
- [[prd]]
- [[architecture]]
- [[rules]]
- [[design]]
- [[tasks]]
- [[memory]]
## Project Log
- **YYYY-MM-DD:** Initial project setup.
3. Define the Agent Skill (SKILL.md)
Save the following contract at ~/.agents/skills/second-brain/SKILL.md. A skill is a folder with a SKILL.md whose name and description tell the agent when to load it [4].
---
name: second-brain
description: >-
Logs progress or retrieves project context from the user's Obsidian Second Brain at ~/Brainless.
---
# Second Brain Operational Skill
## Read Workflow
1. Read ~/Brainless/README.md if layout context is needed.
2. Read projects/<slug>/<slug>.md for high-level context.
3. Read docs/tasks.md or docs/prd.md ONLY when specific details are requested.
4. Do not perform recursive directory listings.
## Write Workflow
1. Append milestone completions to projects/<slug>/<slug>.md under ## Project Log.
2. Format: - **YYYY-MM-DD:** <Concise description of completed milestone>.
3. Update task status checkboxes inside docs/tasks.md.
4. Strictly English; no casual chatter or debugging transcripts.
Connecting to Different Agent Harnesses
Because Obsidian uses plain Markdown on your local disk, connecting it across tools is straightforward:
| Harness | How to connect |
|---|---|
| Claude Code | Invoke it natively via /second-brain or prompt: "Check second brain for our next milestone." Claude Code reads personal skills from ~/.claude/skills/ [4], so if your skill lives in ~/.agents/skills/, link it: ln -s ~/.agents/skills/second-brain ~/.claude/skills/second-brain |
| Cursor & Windsurf | Add the official Model Context Protocol (MCP) filesystem server pointing to your vault [5] (config below). |
| CLI & custom agent scripts | The harness passes internal tool routes (like read and edit) that access absolute paths without polluting the active git repository. |
{
"mcpServers": {
"second-brain": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/mac/Brainless"]
}
}
}
The Token Economics: Before vs. After
Here is how token consumption compares over a month of active software development (~40 agent prompts per day):
| Metric | Monolithic Prompt (CLAUDE.md) | Decoupled Skill (Obsidian) |
|---|---|---|
| Idle Startup Cost | 15,000+ tokens (every prompt) | ~100 tokens (tool schema only) |
| Roadmap Lookup | Full context re-read | ~350 tokens (targeted tasks.md read) |
| Milestone Logging | Full file rewrite / git noise | ~50 tokens (appended bullet point) |
| Monthly Token Burn | ~18,000,000 tokens (~$54+) | ~1,200,000 tokens (~$3.60) |
| Token Savings | Baseline | 93.3% reduction |
Figure 3. Monthly input tokens (illustrative estimate).
FAQ
Why not use Vector RAG (Embeddings)?
Vector similarity search is probabilistic and chunks documents unpredictably. When managing software phases, you need deterministic hierarchy: reading phase 3 after phase 2. File-based surgical reading guarantees zero hallucinated steps.
Can I still use Obsidian GUI plugins?
Yes. Because the vault consists of standard Markdown files, you can use Obsidian's core Templates, Quick Switcher (Cmd+O), and Graph View for visual exploration while your terminal agents interact with it via CLI.
What happens when a project is completed?
Because each project is an atomic bundle, archiving is a single terminal command: mv projects/my-app archives/. All documentation, decisions, and history move together without breaking links.
Summary
Dumping project context into repository prompts is a brute-force approach to agent memory that burns tokens and degrades model reasoning. By decoupling memory into a terminal-friendly Obsidian vault and exposing it as an on-demand skill, you preserve pristine code repositories, maintain universal cross-harness memory, and cut token consumption by over 90%.
Referensi
- Liu NF, Lin K, Hewitt J, Paranjape A, Bevilacqua M, Petroni F, Liang P. Lost in the middle: how language models use long contexts. Trans Assoc Comput Linguist. 2024;12:157–173. arXiv:2307.03172.
- Obsidian. Obsidian Help. https://help.obsidian.md
- Forte T. The PARA method: a universal system for organizing digital information. Forte Labs. https://fortelabs.com/blog/para/
- Anthropic. Agent Skills and Claude Code documentation. https://docs.claude.com
- Model Context Protocol. Reference servers: Filesystem. https://github.com/modelcontextprotocol/servers