Available on Claude Code Plugin Marketplace

Code Knowledge Graph
for Claude CLI

Reduce token usage by 5-10x with intelligent, graph-aware code retrieval. Fully local. Zero config. No API keys.

Terminal
Before grep / glob / read
$ rg "authentication" --files-with-matches
  src/auth/middleware.py
  src/auth/tokens.py
  src/api/views.py
  src/api/permissions.py
  ... 8 more files

$ cat src/auth/middleware.py   # 200 lines
$ cat src/auth/tokens.py       # 150 lines
$ cat src/api/views.py         # 300 lines

  ~8,000 tokens consumed
After Avicenna
$ search_code("authentication middleware")

  auth/middleware.py:15  AuthMiddleware
    class AuthMiddleware(BaseHTTPMiddleware)
    lines: 15-45
    calls: verify_token, get_user

  auth/tokens.py:8  verify_token
    def verify_token(token: str) -> User
    lines: 8-22



  ~800 tokens consumed

Why Avicenna?

A smarter way for Claude to understand your codebase — semantic search, dependency graphs, and architectural advice in one MCP extension.

Semantic Code Search

Natural language queries instead of regex. Ask for 'authentication middleware' and get precise results with file paths and line numbers.

Dependency Analysis

Trace what any file or symbol depends on, and what depends on it. Impact analysis before refactoring — in a single tool call.

Advisor Skills

Built-in guidance for Django, React, SOLID principles, and design patterns. Extensible with custom SKILL.md files.

Fully Local & Free

No API keys, no Ollama, no external services. FastEmbed runs on CPU. LanceDB and SQLite are file-based. Everything stays on your machine.

Per-Repo Isolation

Each repository gets its own isolated knowledge graph. Index multiple repos in parallel with no cross-contamination.

Token Savings

5-10x reduction in exploration tokens. Returns signatures and line numbers instead of full source files. Built-in metrics tracking.

Use Cases

Real workflows where Avicenna saves time and tokens.

Semantic Code Search

Search for "authentication middleware" across a Python project and instantly find the relevant functions by meaning, without knowing exact file names or function names.

search_code

Pre-Refactoring Impact Analysis

Before refactoring a utility function, run find_symbol and get_dependents to see every file and function that depends on it.

find_symbol + get_dependents

Onboarding to Unfamiliar Codebases

Index a new TypeScript monorepo and use get_file_summary to quickly understand the structure of unfamiliar files without reading their full contents.

get_file_summary

Keeping Search Fresh After Edits

After making edits to several files, call refresh_index to update the knowledge graph, then use search_code to verify your changes are reflected.

refresh_index

Understanding Code Dependencies

Use get_dependencies to trace what a module imports and calls, helping you understand unfamiliar code before making changes.

get_dependencies

12 MCP Tools

Everything Claude needs to navigate your codebase — nothing it doesn't.

Code Exploration

search_code

Semantic search across indexed code by meaning

find_symbol

Find function/class/variable with dependency graph

get_dependencies

What a file or symbol imports, calls, or extends

get_dependents

Reverse dependencies — what depends on a target

get_file_summary

Structural summary without reading full contents

index_repository

Parse and index a codebase (incremental support)

refresh_index

Re-index only files changed since last run

Architecture Advice

advise

Best-practice advice matched by semantic similarity

list_skills

List all loaded advisor skills with metadata

Analytics

index_status

Indexing stats: file count, entities, languages

usage_stats

Token savings report with daily breakdown

cancel_indexing

Cancel a currently running indexing operation

Advisor Skills

Built-in knowledge about frameworks, principles, and patterns — extensible with your own SKILL.md files.

django framework

Django architecture, views, models, ORM optimization, DRF, testing, and security best practices.

django python orm web rest-api
react framework

React patterns, hooks, component design, state management, performance optimization, and TypeScript integration.

react typescript javascript frontend hooks
solid-principles principle

SRP, OCP, LSP, ISP, and DIP explained with real Python and TypeScript code examples.

solid architecture oop design clean-code
strategy-pattern pattern

Strategy pattern: when to use, Python and TypeScript implementations, comparison with other behavioral patterns.

strategy design-pattern behavioral polymorphism

Skill Discovery Locations

Project

{repo}/.avicenna/skills/

Team-specific overrides

priority +20
User

~/.avicenna/skills/

User-installed skills

priority +10
Built-in

Built-in

Ships with Avicenna

priority +0

SKILL.md Format

SKILL.md
---
name: my-framework
description: Best practices for...
category: framework
domains: [django, python, orm]
triggers: ["django views", "manage.py"]
priority: 50
depends-on: [solid-principles]
---

# My Framework Guide

Markdown body with best practices...

Get Started in 60 Seconds

Zero config. No API keys. Just install, init, and go.

1

Install as Plugin (Recommended)

$ /plugin install avicenna@claude-plugins-official

Run this inside Claude Code. That's it — Avicenna tools are immediately available in all your projects.

2

Or Install from Source

$ git clone https://github.com/smrf1093/Avicenna.git
$ cd Avicenna
$ python -m venv .venv && source .venv/bin/activate
$ pip install -e .
$ python -m avicenna init /path/to/your/project

Registers the MCP server, indexes your codebase, and creates a CLAUDE.md — all in one command.

3

Use

$ cd /path/to/your/project && claude

Avicenna tools are now available. Try asking Claude to search your code or analyze dependencies.

Supported languages

Python TypeScript JavaScript

How It Works

From source code to intelligent responses — no cloud services required.

Codebase
Python / TS / JS
tree-sitter
Parsing
Knowledge Graph
LanceDB + SQLite
MCP Server
FastMCP stdio
Claude CLI
Your IDE
No LLM during indexing

Embeddings generated locally by FastEmbed on CPU

File-based storage

LanceDB (vectors) + SQLite (graph + state)

Per-repo isolation

Each repo gets ~/.avicenna/repos/{hash}/

Incremental indexing

SHA-256 content hashes detect only changed files

Project Structure

src/avicenna/
  config/      Pydantic settings from .env
  models/      6 DataPoint subclasses
  parser/      tree-sitter engine + language queries
  indexer/     File discovery, hashing, incremental state
  graph/       SQLite + LanceDB engines, search, ingestion
  advisor/     Skill registry, matching, formatting
  server/      FastMCP server + tool implementations
  stats/       Token savings tracker

Token Savings

Real metrics from actual usage — not theoretical estimates.

86.6%

Token savings measured over 7 days of real use

avicenna stats
=== Avicenna Token Savings Report ===

  Period:            Last 7 day(s)
  Total tool calls:  47
  Avicenna tokens:   3,842
  Traditional est.:  28,650
  Tokens saved:      24,808
  Savings:           86.6%

Task-by-Task Comparison

Task

Finding a function

Without Avicenna

3-5 grep calls + 2-3 file reads

~4,000 tokens

With Avicenna

1 find_symbol call

~400 tokens

Task

Understanding dependencies

Without Avicenna

grep imports + read 4 files

~6,000 tokens

With Avicenna

1 get_dependencies call

~600 tokens

Task

Exploring a module

Without Avicenna

ls + read 5 files

~10,000 tokens

With Avicenna

1 get_file_summary call

~500 tokens