codeTree CLAUDE.md

A Python MCP server that gives coding agents structured information about source code, such as classes, functions, imports, references, and call relationships. It uses tree-sitter, a parser that reads code structure across supported languages.

In plain words
What is it for?
Use it to map a repository, inspect a file's structure, retrieve a function or class, find where a symbol is used, and examine what functions call each other.
Why use it?
It lets an agent inspect only the relevant symbols and relationships instead of reading whole files, making unfamiliar codebases easier to understand.

Instructions file

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 instructions/thinkyminer/codetree/claude-md
Clone the repo
git clone --depth 1 https://github.com/ThinkyMiner/codeTree
Per session 8,688 This file is loaded in full into every session.
When invoked 8,688 The same file — it is already loaded in full.
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.08688 $0.08688
Opus 5 $0.04344 $0.04344
Sonnet 5 $0.01738 $0.01738
Haiku 4.5 $0.00869 $0.00869

Measured yesterday against content hash 61532912d895, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codeTree CLAUDE.md 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 yesterday.

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.

CLAUDE.md · 500 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What This Is

codetree is a Python MCP (Model Context Protocol) server that gives coding agents structured code understanding via tree-sitter. Instead of reading entire files, an agent can ask "what classes are in this file?" or "what does this function call?" and get precise, structured answers.

It exposes 23 tools over MCP:

Structural Analysis Tools (13)

Tool Purpose Returns
get_file_skeleton(file_path, format?) Classes, functions, methods with line numbers + doc comments; format="compact" omits doc lines class Foo → line 5, "A calculator.", def bar(x, y) (in Foo) → line 7
get_symbol(file_path, symbol_name) Full source of a function/class # path:line\n<source code>
find_references(symbol_name) All usages across the repo file.py:12, other.py:34
get_call_graph(file_path, function_name) What it calls + what calls it → callee, ← file.py:20
get_imports(file_path) Import/use statements with line numbers 1: import os, 2: from pathlib import Path
get_skeletons(file_paths, format?) Skeletons for multiple files in one call; format="compact" omits doc lines === calc.py ===\nclass Foo → line 1
get_symbols(symbols) Full source of multiple symbols # calc.py:1\nclass Foo:
get_complexity(file_path, function_name) Cyclomatic complexity of a function Complexity of foo() in calc.py: 5\n if: 2, for: 1
find_dead_code(file_path?) Symbols defined but never referenced Dead code in calc.py:\n function unused() → line 15
get_blast_radius(file_path, symbol_name) Transitive impact analysis Direct callers:\n main.py: run() → line 4
detect_clones(file_path?, min_lines?) Duplicate/near-duplicate functions Clone group 1 (2 functions, 12 lines each):
search_symbols(query?, type?, parent?, ..., format?) Flexible symbol search; format="compact" omits doc lines calc.py: class Calculator → line 1
find_tests(file_path, symbol_name) Find test functions for a symbol test_calc.py: test_add() → line 3 (name match)

Read the full file on GitHub · 500 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. yesterday First seen · 500 lines · 8,688 tokens per session scan A 61532912d895

Subscribe to this mod's changes

codeTree CLAUDE.md is an instructions file published in the GitHub repository ThinkyMiner/codeTree (28 stars, last pushed 2mo ago), licensed MIT. It adds 8,688 tokens to every session, about $0.0434 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-30.