Self-Evolving Codebase Memory

Give Claude Code a long-term memory that grows every session, extracts lessons from your conversations, and answers questions from a compiled wiki instead of re-scanning your codebase.

Memory/Knowledgememoryknowledge
by AgentVoltv1.0.0Published 1y ago1 install
Free to sign up · every skill included with AgentVolt Pro

Before & after

Same prompt, same agent — the only difference is the skill.

PromptHow do I remember architectural decisions I made last quarter?
Beforegeneric AI agent
That's a good question. Most teams rely on git commit messages or documentation wikis, but those get outdated fast. You could set up a decision log or read through your PRs from that time period. Some teams use architecture decision records, or ADRs, to formally document why they made choices. You'd need to decide what decisions matter enough to capture, and then someone has to write and maintain that documentation. It's hard to keep it current unless you build it into your workflow somehow.
Afterwith Self-Evolving Codebase Memory
CODEBASE MEMORY SYSTEM (auto-compiled)

SESSION-START HOOK
→ Loads agents.md (active decision-makers, CTO priorities) + index.md (compiled concepts wiki)
→ Runs at every session start; you see relevant architectural context before you code

AUTO-CAPTURED (per session)
→ Session SDK logs end-of-session Claude summary: "Architecture questions answered today: X vs. Y trade-off, reason we chose Z"
→ Daily log saved to logs/2026-07-31.md (session summary + decisions made)

WIKI PROMOTION (nightly flush)
→ Last 7 days of daily logs → concepts and connections wiki (Obsidian)
→ Example: "Why we chose Postgres over DynamoDB" promoted as a permanent wiki entry
→ Backlinks auto-added: "Postgres decision" links to "scaling strategy", "transaction guarantees", "team SQL expertise"

QUERY FROM MEMORY (instant)
Asked: "How did we justify the auth refactor last quarter?"
Clause answers in 3 sec: "See kb/auth-refactor-decision.md (May 2026); context was security audit X and team capacity Z; alternative we considered was Y. Linked issues: security-audit-5, sprint-23, onboarding-refactor."

OBSIDIAN GRAPH VIEW
→ See your architectural concepts as a visual network
→ "Data layer" connects to "caching strategy", "backup procedures", "API contracts"
→ Hover over nodes to see decision timeline

CUSOMIZATION
vault_root: /your-repo/.claude-memory
log_retention: 30 days before wiki promotion
flush_frequency: Nightly at midnight UTC
hook_prompts: Tuned to ask about trade-offs and alternatives
codebase_scope: This repo + shared monorepo (if applicable)

RESULT: New engineer onboarding cut from 2 weeks to 4 days (can query the memory instead of code archaeology)

About this skill


name: self-evolving-codebase-memory description: Give Claude Code a long-term memory that grows every session, extracts lessons from your conversations, and answers questions from a compiled wiki instead of re-scanning your codebase.

Self-Evolving Codebase Memory

What This Does

Inspired by the original author's LLM knowledge bases idea, the creator builds a session-start hook that loads agents.md and a compiled index.md, plus pre-compact and session-end hooks that call the Claude Agent SDK to summarize each conversation into a daily log. A flush process promotes those logs into a concepts and connections wiki with backlinks in Obsidian.

What You Get

  • SessionStart hook loading agents.md and index.md
  • PreCompact and SessionEnd hooks calling Claude Agent SDK to summarize
  • daily log MD files per session
  • flush process into concepts and connections wiki
  • Obsidian graph view of the codebase memory

Customize

  • vault_root: where the wiki lives
  • log_retention: how long daily logs stay before promotion
  • flush_frequency: how often logs promote into wiki
  • hook_prompts: what the SDK asks for at compact and session end
  • codebase_scope: which repos this memory covers

Sample Output

Asked what to watch out for in the project, Claude answers in 10 seconds citing three specific KB articles instead of grepping the git log.

Target Audience

Developers who want per-codebase long-term memory for Claude Code

SKILL.md preview

SKILL.md
---
name: self-evolving-codebase-memory
description: Use this skill when setting up or operating a long-term codebase memory system that compiles session lessons into a searchable wiki instead of re-scanning the repository each time.
version: 1.0.0
category: Memory/Knowledge
author: AgentVolt
license: proprietary
tags:
  - memory
  - knowledge
  - standard
---

# Self-Evolving Codebase Memory

Gives the agent a growing memory of a codebase: session summaries accumulate into daily logs, and a periodic flush promotes them into a linked wiki the agent reads from instead of re-scanning the repo.

## When to use

… (sign up to view the full skill)
Sign up to view, copy, and install the full skill

More ai & agents skills

View all AI & Agents skills →