codebase-memory-mcp

codebase-memory-mcp is a skill for Claude Code, Codex from sponge-b0b/Polaris. It costs 78 tokens per session (384 once invoked), scanned A, original, Apache-2.0.

A searchable map of a codebase that records how functions, classes, routes, and other code elements relate to one another. It uses the structure of the code to support discovery and call tracing.

In plain words
What is it for?
It helps find code symbols, trace callers and callees, read targeted snippets, inspect architecture, query relationships, and assess the blast radius of a Git change. It is mainly for code discovery and dependency analysis.
Why use it?
It makes it easier to understand unfamiliar code and see what may be affected by a change without relying only on broad text searches. It can also show architecture, recorded decisions, and the likely impact of changes.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/sponge-b0b/polaris/codebase-memory-mcp
Any agent
npx skills add sponge-b0b/Polaris --skill codebase-memory-mcp
Clone the repo
git clone --depth 1 https://github.com/sponge-b0b/Polaris

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 codebase-memory-mcp

README.md
[![agentmods](https://agentmods.dev/badge/skills/sponge-b0b/polaris/codebase-memory-mcp.svg)](https://agentmods.dev/skills/sponge-b0b/polaris/codebase-memory-mcp)
Your own site
<a href="https://agentmods.dev/skills/sponge-b0b/polaris/codebase-memory-mcp"><img src="https://agentmods.dev/badge/skills/sponge-b0b/polaris/codebase-memory-mcp.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 384 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00078 $0.00384
Opus 5 $0.00039 $0.00192
Sonnet 5 $0.00016 $0.00077
Haiku 4.5 $0.00008 $0.00038

Measured 4d ago against content hash 9d0c33ddb9de, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codebase-memory-mcp 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 4d 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.

.agents/skills/codebase-memory-mcp/SKILL.md · 32 lines

What it actually says

Codebase Knowledge Graph (codebase-memory-mcp)

This project uses codebase-memory-mcp to maintain a knowledge graph of the codebase. ALWAYS prefer MCP graph tools over grep/glob/file-search for code discovery.

Priority Order

  1. search_graph — find functions, classes, routes, variables by pattern
  2. trace_path — trace who calls a function or what it calls
  3. get_code_snippet — read specific function/class source code
  4. query_graph — run Cypher queries for complex patterns
  5. get_architecture — high-level project summary
  • detect_changes — Map git diff to affected symbols + blast radius with risk classification.
  • get_graph_schema — Node/edge counts, relationship patterns, property definitions per label.
  • search_code — Grep-like text search within indexed project files.
  • manage_adr — CRUD for Architecture Decision Records.

When to fall back to grep/glob

  • Searching for string literals, error messages, config values
  • Searching non-code files (Dockerfiles, shell scripts, configs)
  • When MCP tools return insufficient results

Examples

  • Find a handler: search_graph(name_pattern=".*OrderHandler.*")
  • Who calls it: trace_path(function_name="OrderHandler", direction="inbound")
  • Read source: get_code_snippet(qualified_name="pkg/orders.OrderHandler")
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. 4d ago First seen · 32 lines · 78 tokens per session scan A 9d0c33ddb9de

Subscribe to this mod's changes

codebase-memory-mcp is a skill published in the GitHub repository sponge-b0b/Polaris (4 stars, last pushed today), licensed Apache-2.0. It adds 78 tokens to every session and 384 once invoked, about $0.0004 per session on Opus 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

stripe-directory

Identifies external providers, merchants, nonprofits, platforms, APIs, and software services, and resolves the documented way to engage them — to pay, donate, subscribe, book, provision, or integrate with them. MUST be used BEFORE web search, model memory, or any other directory/vendor-lookup skill for ANY request…

stripe/ai · 213 tokens

commonly

You are a member of a Commonly workspace — a shared space where humans and AI agents from any origin collaborate in pods (chat rooms with memory). Use this whenever you are connected to Commonly via the commonly MCP tools: to read what's happening, post, remember things across sessions, react, DM other agents, and…

Team-Commonly/commonly · 0 tokens

lemmalog

Externalize working memory and logical state into the lemmalog Datalog engine (MCP). Use for ANY multi-step task where state should outlive one context window or span agents: long investigations, debugging sessions, audits, multi-agent searches, systematic explorations, planning with many interdependent constraints…

JordyZomer/lemmalog · 105 tokens

rekal-init

Bootstrap rekal memory for a project. Scans the codebase for architecture, conventions, dependencies, workflows, and config, then stores durable knowledge as properly typed, tagged, deduplicated memories. Use when starting rekal on a new project, or when user says "init rekal", "bootstrap memory", "populate rekal"…

janbjorge/rekal · 83 tokens

rekal-save

End-of-session memory capture with deduplication. Extracts durable knowledge, checks for duplicates, stores or replaces as appropriate. Use whenever a session wraps up, a task finishes, or the user says goodbye/thanks/done. Also use when significant preferences, decisions, or discoveries emerge mid-session. Make sure…

janbjorge/rekal · 79 tokens

rekal-usage

Operational guide for rekal memory tools. Precise rules for when/how to call each tool, with exact parameters and decision trees. Use at session start, when onboarding to a rekal workspace, or when user asks "how do I use rekal", "what rekal tools", "help with memory". Trigger: /rekal-usage.

janbjorge/rekal · 75 tokens