RepoPilot

karpathy / nanochat

Search karpathy/nanochat

GitHub

Code

Understand karpathy/nanochat's source layout and find a starting point for your task using the saved repository evidence.

Detailed import-graph metrics were not captured for this report.

How the code fits together

  • dev1 captured source file in this directory. Its responsibility has not been described in the saved analysis.
  • nanochat14 captured source files in this directory. Its responsibility has not been described in the saved analysis.
  • scripts9 captured source files in this directory. Its responsibility has not been described in the saved analysis.
  • tasks6 captured source files in this directory. Its responsibility has not been described in the saved analysis.

Files at 92d63d4e8bb4 · captured source folders.

Where to start reading

  1. Repository root
  2. Repository root

Find files for a task

Change the public API

Start with possible export surfaces, then check their consumers and tests. These suggestions use file names, not verified execution paths.

  • File-name match for this task.

Add or update tests

Use a nearby test as a pattern. Read the root manifest or contribution guide for the correct test command. These suggestions use file names, not verified execution paths.

  • File-name match for this task.
  • File-name match for this task.
  • File-name match for this task.

Change build or automation

Inspect the relevant configuration and the commands it runs before changing the workflow. These suggestions use file names, not verified execution paths.

  • File-name match for this task.

File paths come from a snapshot of up to 500 captured paths; an omitted file may still exist.

  • Public and runtime candidates are based on file names; their exports and execution paths still need checking in source.

Code quality and hotspots

Quality Score: 80/100

Low Risk

This repo is in good health with CI, tests, and active maintenance.

No CI -20

Maintainability grade

Static analysis

How maintainable the code looks — from complexity, code issues, test presence, file size, and hotspot load. It grades the shape of the code, not defect risk, and doesn't replace review.

B
75/100
A ≥ 85, B ≥ 70, C ≥ 55, D ≥ 40, F < 40
Cyclomatic complexityavg 13
27/35
Code issues0 errors, 25 warnings
8/20
Testspresent · ~20% of files
16/20
Largest file605 lines
14/15
Hotspot load0 high-risk files
10/10

Configuration status

CI/CD Pipeline — not detected

Regression risk without automated builds

Add GitHub Actions CI
Test Suite — detected

6 test files detected

Stack: Pytest

Where: tests

Test Coverage — ~20%heuristic

6 test files / 30 source files. This is a file-count ratio, not real line coverage — set up Codecov for authoritative numbers.

Dependency Scanning — no config detected

No Dependabot / Renovate / Snyk / Trivy / CodeQL config found. Enable Dependabot or Renovate.

Top hotspots

Files edited often AND hard to reason about. Churn = recent commit frequency, Complexity = branches and nesting, Risk = both combined. These are the highest-leverage targets for refactoring or testing.

nanochat/gpt.py
Churn: 28 (7 commits/180d)Complexity: 84Risk: 24
scripts/base_train.py
Churn: 28 (7 commits/180d)Complexity: 42Risk: 12

All hotspots

Files that change often and are complex tend to accumulate more bugs

Code metrics

Static analysis on sampled source files (up to 15 files).

Avg Cyclomatic Complexity13

Counts if/for/while/switch/catch/ternary branches

Errors / Warnings0 / 25

Secrets, empty catches, console.log, var usage, long lines

Largest File Analyzed605 lines
scripts/base_train.py