Show HN: A plain-text cognitive architecture for Claude Code
TL;DR Highlight
A project that designs a hierarchical memory structure (Cognitive Architecture) based on plain-text files to address Claude Code's inability to retain memory across sessions. A practical reference for developers who want to use AI coding assistants consistently over the long term.
Who Should Read
Developers who use AI coding assistants like Claude Code or Aider daily in their work, but are frustrated by having to re-explain context every time a new session starts.
Core Mechanics
- Claude Code has no memory between sessions by default — once a conversation ends, it retains no prior context. Cog is a project that addresses this by building an external memory system composed of plain-text files.
- Instead of dumping everything into a single file, memory is divided into tiers such as 'hot (load immediately) → warm (load on demand) → cold (archive)'. This allows efficient use of the context window and enables fast access to frequently needed information.
- A dedicated 'onboarding flow' at session start and a 'shutdown flow' at session end are built in, so the AI can organize and update its own memory autonomously — similar to how a person checks their TODO list at the start of the day and writes a journal at the end.
- One of the core design philosophies of this project is that storing context-rich lessons (e.g., 'Do not mock the DB in integration tests — there was a case where tests passed but the migration failed') is far more effective than storing bare facts (e.g., 'The database is PostgreSQL 16').
- The project is similar to CLAUDE.md (the per-project instruction file officially supported by Claude Code), but adds a more sophisticated structure. Architectural decisions, file paths, and rules like 'do X / don't do Y' are systematically organized to guide Claude toward consistent behavior.
- This approach is not limited to Claude Code — it is a general-purpose pattern that applies equally to other AI coding tools such as Aider and OpenCode. Being plain-text based makes it compatible with any tool.
- Alternatives like Anthropic's official Auto Dream feature or episodic-memory exist, but Cog's differentiator is that developers can directly customize the structure and version-control the files with git.
Evidence
- "A comment pointed out reliability issues with long-term memory — if observations from 30 sessions ago and inferences drawn from a single offhand remark are stored at the same level, the memory becomes increasingly useless. A real implementation experience was shared where tagging entries with confidence scores and timestamps, decaying memories that hadn't been reinforced over time, and managing conflicting observations in a separate 'contradictions log' proved to be useful. There was also a pragmatic counterargument that a well-written CLAUDE.md alone is sufficient. A developer who heavily uses Claude Code for infrastructure work argued that 'storing lessons was far more effective than storing facts,' and that a single well-crafted CLAUDE.md can be more powerful than a complex memory architecture. A case was shared of someone implementing a far more sophisticated workflow on their own — managing separate onboarding.md, journal.md, and musings.md files, and having the AI review consistency across all documents and code before submitting a PR at the end of each session. The view was that 'treating AI as a collaborator rather than a tool yields much better results,' though the author honestly noted the significant downside of massive token consumption ('token fire'). Some expressed that Codex handles context management better than Claude, sharing a comparison experience that 'Claude drops information from its context, whereas Codex doesn't forget content even in long sessions' — which ironically validates the very reason this project exists to work around Claude Code's fundamental limitations. There was also a critical perspective that this entire approach is a superficial fix that patches LLM architectural limitations with text files. The argument was that if local open models were more competitive, this would have been solved with overnight fine-tuning — a philosophical critique pointing to the inherent limitations of the current LLM paradigm."
How to Apply
- "If you find yourself repeating the same explanations at the start of every Claude Code session, write lessons in your CLAUDE.md in the format 'don't do X + the reason why (including failure cases)' instead of plain facts. For example, including context like 'No DB mocking in integration tests — there was a past case where tests passed but the actual migration failed' will make Claude behave far more consistently. Managing all memory in a single file wastes your context window. Split files into three tiers — 'always-load (core project principles)', 'load-when-needed (per-module rules)', and 'archive (history of past decisions)' — and instruct Claude to read only the relevant files at session start to improve token efficiency. If you're concerned about the reliability of AI memory in long-running projects, get into the habit of annotating stored information with 'when it was recorded' and 'how certain it is (speculation vs. verified fact)'. When conflicting information arises, don't delete either entry — keep both in a 'conflict' section, which will help with context reconstruction later. The Cog architecture is not exclusive to Claude Code, so it applies equally if you use Aider or other AI coding tools. Check out the structure on the official Cog site (https://lab.puga.com.br/cog/) and try adopting it by simply adjusting the file conventions to fit your own tool."
Terminology
Related Papers
Migrating a production AI agent to GPT-5.6: 2.2x faster, 27% cheaper
마케팅 웹사이트를 자동 생성하는 프로덕션 AI 에이전트를 Claude Opus 4.8에서 GPT-5.6 Sol로 전환한 실전 경험담으로, 단순 모델 교체가 아니라 eval 하네스, 툴 스키마, 캐싱, 추론 리플레이까지 손봐야 했던 과정을 구체적인 수치와 함께 정리했다.
What xAI's Grok build CLI sends to xAI: A wire-level analysis
xAI의 공식 코딩 CLI 도구 Grok Build가 사용자 동의 없이 전체 Git 저장소와 .env 시크릿 파일을 xAI 서버로 업로드한다는 사실이 네트워크 트래픽 분석으로 밝혀졌다.
Remember When It Matters: Proactive Memory Agent for Long-Horizon Agents
LLM 에이전트가 긴 작업 중 중요한 정보를 잊어버리는 문제를 별도의 메모리 에이전트가 '적절한 타이밍에' 끼어들어 해결하는 방법
WebSwarm: Recursive Multi-Agent Orchestration for Deep-and-Wide Web Search
복잡한 웹 검색을 재귀적으로 분해하고 각 노드에 적합한 검색 모드를 동적으로 할당하는 멀티에이전트 프레임워크
Show HN: Reverse-engineering web apps into agent tools
로그인된 웹 앱의 API 호출을 브라우저에서 감시해 자동으로 MCP 도구로 변환하는 에이전트를 만들었다. 소스 코드나 공식 API 문서 없이도 Jira, Spotify 같은 서비스에 AI 어시스턴트를 붙일 수 있다.
Show HN: FableCut – A browser video editor AI agents can drive (zero deps)
타임라인 전체를 JSON 파일 하나로 표현하고 MCP/REST로 AI 에이전트가 직접 편집할 수 있는 브라우저 비디오 에디터로, Claude 같은 AI가 프롬프트 하나로 영상을 자동 컷편집하고 결과를 실시간으로 UI에 반영해준다.