Generate layered code maps for C# projects, optimized for AI assistants like Claude
Project description
csharp-repomap
Generate layered code maps for C# projects, optimized for AI assistants like Claude.
What is it?
csharp-repomap creates structured code maps that help AI assistants understand your C# codebase. It generates three levels of detail:
- L1 Skeleton (~1k tokens): Module overview and core entry classes
- L2 Signatures (~2k tokens): Class and method signatures
- L3 Relations (~3k tokens): Reference graph between classes
The tool uses tree-sitter for accurate C# parsing and PageRank algorithm to identify the most important classes in your codebase.
Features
- Tree-sitter parsing: Accurate C# syntax analysis
- PageRank ranking: Identify important classes by reference count
- Token-limited output: Fits within AI context windows
- Git hooks: Auto-update on pull/merge/checkout
- Windows notifications: Toast notifications when updates complete
- Unity preset: Pre-configured for Unity projects
Installation
pip install csharp-repomap
For token counting (optional):
pip install csharp-repomap[tiktoken]
Quick Start
# Initialize in your project (choose preset)
cd your-csharp-project
repomap init --preset unity # For Unity projects
repomap init --preset generic # For other C# projects
# Generate repo map
repomap generate --verbose
# Check status
repomap status
# Install Git hooks for auto-update
repomap hooks --install
Configuration
After repomap init, edit .repomap/config.yaml:
project_name: "My Project"
source:
root_path: "Assets/Scripts" # Path to your C# source
exclude_patterns:
- "**/Editor/**"
- "**/Tests/**"
tokens:
l1_skeleton: 1000
l2_signatures: 2000
l3_relations: 3000
importance_boost:
patterns:
- prefix: "S" # SPlayerService
boost: 2.0
- suffix: "Manager" # GameManager
boost: 1.5
Output Files
Generated in .repomap/output/:
| File | Description |
|---|---|
repomap-L1-skeleton.md |
Module overview, categories, core classes |
repomap-L2-signatures.md |
Top classes with method signatures |
repomap-L3-relations.md |
Reference graph (who calls whom) |
repomap-meta.json |
Git info, statistics, timestamps |
Git Hooks
Auto-update repo map when code changes:
# Install hooks
repomap hooks --install
# Uninstall hooks
repomap hooks --uninstall
Hooks trigger on:
git pullgit mergegit checkout(branch switch)
Usage with Claude Code
- Add
.repomap/output/to your project context - Claude will see the L1/L2/L3 files and understand your codebase structure
- The maps auto-update as you pull new code
Example prompt:
"Look at the repo map to understand the module structure, then implement..."
Presets
Unity Preset
- Configured for
Assets/Scripts - Boosts
SXxxservice classes - Categories: Core, Game, UI, Data, Network, Audio
Generic Preset
- Configured for
srcdirectory - Boosts
Service,Repository,Controllerpatterns - Categories: Core, Domain, Application, API, Data
Requirements
- Python 3.8+
- Git (for hooks and commit info)
- Windows 10+ (for Toast notifications)
License
MIT License - see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file csharp_repomap-0.1.0.tar.gz.
File metadata
- Download URL: csharp_repomap-0.1.0.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5bb3c78b58e1981912caa38cef96b67b898b3253775f8372c61cc62de98ca83
|
|
| MD5 |
896c07c77d87d6abddfaa63b26785592
|
|
| BLAKE2b-256 |
08ff903fa1c41be006d878ab4df3448b7b7af3b5405afa0271d788177042fdfb
|
File details
Details for the file csharp_repomap-0.1.0-py3-none-any.whl.
File metadata
- Download URL: csharp_repomap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8e077d391c74c5a229de9b2e2558f373ac3a3599c75c9f89f0f662c865c13cc
|
|
| MD5 |
a409c75209090b3f981a1f7693b39f68
|
|
| BLAKE2b-256 |
de65ff652613ff01635f83b92087e97ddc1247798498d9f0c1a0769aedaf4918
|