Skip to main content

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 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csharp_repomap-0.1.0.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

csharp_repomap-0.1.0-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

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

Hashes for csharp_repomap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b5bb3c78b58e1981912caa38cef96b67b898b3253775f8372c61cc62de98ca83
MD5 896c07c77d87d6abddfaa63b26785592
BLAKE2b-256 08ff903fa1c41be006d878ab4df3448b7b7af3b5405afa0271d788177042fdfb

See more details on using hashes here.

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

Hashes for csharp_repomap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8e077d391c74c5a229de9b2e2558f373ac3a3599c75c9f89f0f662c865c13cc
MD5 a409c75209090b3f981a1f7693b39f68
BLAKE2b-256 de65ff652613ff01635f83b92087e97ddc1247798498d9f0c1a0769aedaf4918

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page