code-stats
Analyze codebase statistics with tokei (line counts by language) and difft (semantic AST-aware diffs). Use for project composition, refactoring scope, codebase metrics.
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
Code Statistics
Rapid codebase analysis using two complementary tools.
Tools
tokei - Language Statistics
Line-count statistics across programming languages:
- File count per language
- Total lines, code lines, comments, blank lines
- Supports 150+ languages
Usage:
tokei # Full project stats
tokei --type=TypeScript,JavaScript # Filter by language
tokei --exclude="vendor/*" # Exclude patterns
tokei -o json # JSON output for automation
difft - Semantic Diffs
AST-aware diffing that understands code structure:
- Ignores formatting changes
- Recognizes code moves and refactoring
- Shows meaningful changes, not line shuffles
Usage:
difft file1.go file2.go # Compare two files
GIT_EXTERNAL_DIFF=difft git diff # Git integration
GIT_EXTERNAL_DIFF=difft git show HEAD # Show last commit
GIT_EXTERNAL_DIFF=difft git log -p # Log with semantic diffs
Workflow
-
Quick snapshot:
tokeifor project composition -
Deep analysis:
tokei -o json | jqfor automation -
Review changes:
GIT_EXTERNAL_DIFF=difft git difffor meaningful diffs
MUST DO
- Use
tokeibefore estimating project scope - Use
difftfor refactoring reviews - Filter output when only specific languages matter
MUST NOT
- Rely on raw line counts for complexity estimates
- Ignore comment ratios in health assessments
Advanced Features
-
tokei advanced: See
references/tokei-advanced.mdfor filtering, automation, CI patterns -
difft advanced: See
references/difft-advanced.mdfor git integration, display modes, config
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!