Skip to main content

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 pull
  • git merge
  • git checkout (branch switch)

Usage with Claude Code

  1. Add .repomap/output/ to your project context
  2. Claude will see the L1/L2/L3 files and understand your codebase structure
  3. 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 SXxx service classes
  • Categories: Core, Game, UI, Data, Network, Audio

Generic Preset

  • Configured for src directory
  • Boosts Service, Repository, Controller patterns
  • 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

Metadata

Release files for csharp-repomap 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csharp-repomap 0.1.0
File Size Uploaded Provenance Actions
csharp_repomap-0.1.0.tar.gz 26.5 kB Without provenance Details for csharp_repomap-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for csharp-repomap 0.1.0
File Interpreter ABI Platform Actions
csharp_repomap-0.1.0-py3-none-any.whl Python 3 none any Details for csharp_repomap-0.1.0-py3-none-any.whl

Total release size: 56.0 kB

Release files / csharp_repomap-0.1.0.tar.gz

Download URL csharp_repomap-0.1.0.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b5bb3c78b58e1981912caa38cef96b67b898b3253775f8372c61cc62de98ca83
BLAKE2b-256 checksum
How to use checksums
08ff903fa1c41be006d878ab4df3448b7b7af3b5405afa0271d788177042fdfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / csharp_repomap-0.1.0-py3-none-any.whl

Download URL csharp_repomap-0.1.0-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8e077d391c74c5a229de9b2e2558f373ac3a3599c75c9f89f0f662c865c13cc
BLAKE2b-256 checksum
How to use checksums
de65ff652613ff01635f83b92087e97ddc1247798498d9f0c1a0769aedaf4918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for csharp-repomap 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page