tools-codebase-memory

tools-codebase-memory is a skill for Claude Code, Codex from alexei-led/architect. It costs 152 tokens per session (1,404 once invoked), scanned A, original, MIT.

A skill for gathering code-structure evidence from a persistent repository knowledge graph. It provides architecture overviews, call relationships, dependency analysis, cycles, change impact, module clusters, dead-code findings, and stored decisions.

In plain words
What is it for?
Use it to index a repository, investigate dependencies and call paths, identify cycles or dead code, estimate blast radius, and retrieve architecture records.
Why use it?
It helps an agent understand a large codebase’s structure without repeatedly inspecting every file manually.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to index a repository, investigate dependencies and call paths, identify cycles or dead code, estimate blast radius, and retrieve architecture records.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alexei-led/architect/tools-codebase-memory
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alexei-led/architect --skill tools-codebase-memory
Clone the repo
git clone --depth 1 https://github.com/alexei-led/architect

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tools-codebase-memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexei-led/architect/tools-codebase-memory/github.svg)](https://agentmods.dev/skills/alexei-led/architect/tools-codebase-memory)
Your own site
<a href="https://agentmods.dev/skills/alexei-led/architect/tools-codebase-memory"><img src="https://agentmods.dev/badge/skills/alexei-led/architect/tools-codebase-memory/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tools-codebase-memory

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexei-led/architect/tools-codebase-memory"><img src="https://agentmods.dev/badge/skills/alexei-led/architect/tools-codebase-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,404 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00152 $0.01404
Opus 5.5 $0.00061 $0.00562
Sonnet 5.5 $0.00030 $0.00281
Haiku 4.5 $0.00015 $0.00140

Measured 1mo ago against content hash 4098ece6b581, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tools-codebase-memory scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/skills/tools-codebase-memory/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

codebase-memory-mcp

codebase-memory-mcp indexes a repository into a persistent SQLite knowledge graph (tree-sitter ASTs plus a hybrid LSP layer) and exposes it over MCP. It answers the same graph-shaped questions as codegraph — what calls this, what a change reaches, where the hubs, cycles, and clusters are — plus cross-session Architecture Decision Records. Query it instead of re-reading files when the server is installed.

Evidence dimensions: dependency, semantic, and change-impact.

When to use

Use when the session exposes mcp__codebase-memory-mcp__* tools (verify with /mcp; the server reports as codebase-memory-mcp). Index during the system-map step, then query during evidence gathering for module structure, call/dependency edges, cycles, blast radius, and Louvain module clusters. Prefer it over tools-codegraph only when its index is present and fresh; otherwise use whichever graph tool is current.

Tools

All tools are namespaced mcp__codebase-memory-mcp__<name>. The architecture-relevant set:

  • index_repository — build or refresh the graph. repo_path must be ABSOLUTE.
  • list_projects — indexed projects with node/edge counts.
  • index_status — indexing state for a project.
  • get_graph_schema — node labels, edge types, counts. Run this first.
  • get_architecture — overview: languages, packages, routes, hotspots, clusters, dead code.
  • search_graph — find symbols by label / name_pattern / file_pattern.
  • trace_path (alias trace_call_path) — callers/callees of a function; direction in|out|both, depth 1-5 (fan-in/out, blast radius).
  • detect_changes — map the git diff to affected symbols and blast radius.
  • query_graph — read-only Cypher for cycles, dependency direction, hubs.
  • get_code_snippet — source for a symbol by qualified name.
  • search_code — grep-like text search within the index.
  • manage_adr — read ADRs (mode: get); write modes need user approval.

Workflow

  1. list_projects — is the target already indexed? If not, index_repository with the absolute repo path and wait for completion.
  2. get_graph_schema — learn the available labels/edges before querying.
  3. get_architecture — overview before deep dive: packages, entry points, routes, hotspots, clusters, dead code.
  4. search_graph then get_code_snippet — locate and read specific symbols.
  5. trace_path — fan-in/out and call paths for boundary/coupling claims.
  6. detect_changes — blast radius of the working diff before a change.
  7. query_graph — Cypher for cycles and wrong-way dependencies, e.g. MATCH (f:Function)-[:CALLS]->(g) WHERE ... RETURN ....

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 121 lines · 152 tokens per session scan A 4098ece6b581

Subscribe to this mod's changes

tools-codebase-memory is a skill published in the GitHub repository alexei-led/architect (3 stars, last pushed 3mo ago), licensed MIT. It adds 152 tokens to every session and 1,404 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

memory-doctor

Run Locus environment health check — 10-point diagnostic covering Node.js version, storage backend, FTS5, DB permissions, git availability, and more. Use when troubleshooting plugin issues or checking setup.

Magnifico4625/locus · 45 tokens

vibe-debugging-journal

Records resolved bugs in a persistent journal — symptom, root cause, difficulty, fix, prevention. Organized by category for future reference.

mracal/vibe-engineering · 33 tokens

browserwing-admin

Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.

MemTensor/MemOS · 47 tokens

exploiting-format-string-vulnerabilities

Methodology for exploiting format string bugs where attacker-controlled data reaches the format argument of printf-family functions, enabling stack/memory disclosure (info leaks for ASLR/PIE/canary defeat) and arbitrary write primitives (%n) to hijack control flow via GOT/.finiarray overwrites.

xalgorix/xalgorix · 69 tokens

mindos

MindOS: local knowledge assistant & shared KB. Keeps decisions, notes, SOPs, debugging lessons, research findings, preferences across sessions/agents. Core: save notes, search KB, organize files, run workflows, review, append CSV, hand off context, distill lessons. NOT for app source or paths outside KB. Triggers…

GeminiLight/MindOS · 136 tokens

sivtr-memory

Retrieve shared local work memory: terminal activity, AI conversation history, prior decisions, validation evidence, debugging trails, recaps, and handoff context. Use before asking the user to repeat local work context.

Ariestar/sivtr · 46 tokens