Blog
Claude Code /init vs. Semantic Codebase Index: They Are Not the Same Thing
9 min read
Both claude /init and a semantic codebase index give Claude knowledge about your project. They are not competing approaches to the same problem — they are different tools operating at different scales, with different maintenance models and different accuracy properties. Understanding the distinction matters because they fail in different ways, and teams that expect one to do the job of the other end up with confident wrong answers.
What /init produces
The /init command creates a CLAUDE.md file — a static markdown document loaded into Claude's system prompt at the start of every session. It is authored by Claude (via a one-time scan), committed to your repo, and maintained manually going forward:
claude /init output: CLAUDE.md
Format: Markdown document
Lives in: repository root, committed to git
Updates: manually, when a developer edits it
Loaded by: Claude at session start (system prompt)
Accessible to: developers using Claude Code
Scope: one repository
Content: build commands, structure, conventions
Freshness: as of the last manual updateThe key properties are: it is a document (static, not queryable), it requires manual updates to stay current, and it is limited to what can fit in a readable markdown file. For solo developers and greenfield projects, these properties are fine. For teams and evolving codebases, they create the drift problem described in CLAUDE.md drift on teams.
What a semantic index is
A semantic index is a continuously maintained, queryable representation of your codebase — vector embeddings of code chunks, behavioral relationship graphs, and cross-repo linkages. It is not loaded into the system prompt; it is retrieved on demand:
Semantic index (e.g. Kognita)
Format: Vector embeddings + behavioral graph
Lives in: server-side infrastructure
Updates: automatically on every commit/merge
Loaded by: retrieved on demand via MCP
Accessible to: entire team, all roles
Scope: all connected repositories
Content: semantic code relationships, behavioral flows
Freshness: always current (post-merge update)The key differences: automatic updates (no manual maintenance), server-side storage (no per-developer local index), cross-repo scope (not bounded by a single repository), and on-demand retrieval (the right context surfaces per query, not a fixed document loaded every session).
The same question, two different answers
The practical difference becomes clear when you trace how each approach handles the same codebase query after a significant refactor:
"Where is the user session handled?"
/init + CLAUDE.md:
→ Claude reads CLAUDE.md → "auth module is in auth/"
→ Accurate if CLAUDE.md was updated after last refactor
→ Answers: location if documented
→ Misses: if auth was split into auth/, jwt/, session/ after /init
Semantic index:
→ Retrieval searches current embeddings
→ Surfaces auth.ts, jwt.middleware.ts, session.store.ts
→ Accurate to current codebase state, not documentation date
→ Answers: current location from live codeThe gap grows with codebase velocity. On a team making 20 commits per week, a CLAUDE.md that was accurate last month may have dozens of stale references. A semantic index that updated after each merge reflects the current state. Both give Claude context; only one gives it current context.
Scale comparison at team level
The difference in maintenance model becomes stark at team scale. A CLAUDE.md approach across six repositories requires six documents maintained manually by whoever gets to it. A semantic index across the same six repositories updates automatically after each merge:
Scale comparison at 30-engineer team:
/init + CLAUDE.md:
→ One file per repo, edited by whoever remembers to
→ 6 repos × ~5 months average since last update
→ Accuracy varies per repo, no signal when stale
Semantic index:
→ One index per connected repo, updated per merge
→ 6 repos × current state
→ Accuracy consistent, freshness automaticThe accuracy variance of the manual approach is not hypothetical — it is the natural outcome of documentation ownership distributed across a team with no enforcement mechanism. Some repos will have accurate CLAUDE.md files because someone cares. Others will have files that have not been touched since Q4 of last year.
When to use which
These are not mutually exclusive. CLAUDE.md and a semantic index can work together — CLAUDE.md handling stable project conventions (build commands, linting setup, team norms) that change infrequently, and the semantic index handling current codebase structure and cross-service questions that change every week:
When each approach fits:
Use /init + CLAUDE.md when:
→ Solo project with stable conventions
→ You actively maintain the file as the codebase evolves
→ You want build/test commands baked into every session
Use semantic index when:
→ Team of 3+ developers
→ Codebase changes multiple times per week
→ Non-developers need codebase answers
→ Questions require cross-repo context
→ You need impact analysis, not just navigationThe mistake is using CLAUDE.md as the primary grounding mechanism for a team-scale project and expecting it to remain accurate across months of active development without active maintenance. It will not. The file is a document, and documents age. A semantic index is infrastructure, and infrastructure can be designed to stay current.
What Kognita adds on top of both
Kognita functions as the semantic index layer — cross-repo, continuously updated, accessible to the whole team. It does not replace CLAUDE.md for the things it does well: project conventions, build commands, architectural principles the team wants baked into every session. It replacesCLAUDE.md for the things it does poorly: current codebase structure, cross-service relationships, and any question that requires fresh code context rather than committed documentation.
Final take
claude /init is the right starting point. It gives Claude useful grounding from day one at no ongoing maintenance cost — until you start relying on it for questions that require current codebase truth rather than documented conventions.
/init creates a document about your codebase. A semantic index creates a live representation of it. The difference is who maintains accuracy: you, or the infrastructure.