AI 에이전트의 코드베이스 파괴와 토큰 낭비를 막기 위해 자가 부트스트래핑 마크다운 프로토콜을 만들었습니다.
I got tired of AI agents destroying my codebase and eating tokens, so I built a self-bootstrapping Markdown protocol to fix their memory.
핵심 요약
AI 에이전트의 메모리 관리를 위해 프로젝트 루트에 배치하는 마크다운 기반의 에이전트 OS, BEMYAGENT를 소개합니다.
- 메모리 관리 — 프로젝트 루트에 BEMYAGENT.md를 배치하여 AI의 컨텍스트 윈도우 오염을 방지함.
- 구조적 분리 — 불변하는 문서(docs)와 휘발성 작업(work) 영역을 나누어 AI의 할루시네이션을 줄임.
- 모델 핸드오프 — 전략 수립과 코드 실행 단계에서 모델을 교체하여 토큰 비용을 획기적으로 절감함.
- 범용성 — 특정 도구에 종속되지 않고 마크다운 기반으로 작동하여 Aider, Cline 등에서 즉시 사용 가능함.
Hey everyone,
If you use Claude, Cursor, Copilot, or Gemini for large projects, you know the pain: after 20 messages, the AI's context window gets bloated. It forgets the architecture, hallucinates features, or worse, overwrites perfectly good code because it didn't read the right files.
I realized the problem isn't the models; it's how we manage their memory.
So I created BEMYAGENT: a single, lightweight Markdown file (BEMYAGENT.md) that acts as an "Agent OS".
You just drop it into your project root, tell your AI to "Execute BEMYAGENT.md bootstrap", and it automatically generates a strictly separated file structure:
docs/(Immutable truth):01-overview,02-architecture,03-code-map. The AI is forced to use Lazy Loading (it's instructed never to read feature specs unless strictly required for the current task).work/(Volatile memory): Uses a Fractal TTE (Think-Task-Execute) workflow based on Hierarchical Task Networks (HTN). If a task is too big, the AI must decompose it into sub-folders instead of executing blindly.
The coolest feature? Model Handoff / Pacing. I built a configuration state right into the rules. You can tell the AI to switch to INTERACTIVE mode. It will use a heavy model (like o1 or Claude 3.5 Sonnet) to write the 01_think.md strategy, then it pauses. You swap to a fast/cheap model (like Haiku or Flash) in your UI or CLI, and tell it to execute the code. Massive token/cost savings.
It works with any AI UI or CLI tool (Aider, Cline, etc.) because it's just Markdown.
I’d love for you to try it out or tear the architecture apart.
Repo here: https://github.com/vitotafuni/bemyagent


