Skip to content

yurukusa/cc-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cc-python

How does Claude Code use Python? 3,790 python3 calls. 55.9% are inline one-liners (-c flag). python -m py_compile runs 703 times — syntax checking as a quality gate. pip called only 5 times.

python3 call analysis across all your sessions.

npx cc-python

No install. No dependencies.


What it shows

  • Total python calls — across all sessions
  • How Python is used — inline (-c), module (-m), script (.py) breakdown
  • Top -m modules — py_compile, pytest, and others
  • Most imported modules — what Claude imports in inline code
  • Most run scripts — which .py files get executed most

Output

  cc-python — Python Call Analysis
  ════════════════════════════════════════

  ▸ Overview
    Total python calls:   3,790
    Sessions with Python: 288
    Inline (-c/heredoc):  2,120 (55.9%)
    Module (-m):          1,224 (32.3%)
    Script (.py):         345 (9.1%)
    pip install:          5

  ▸ How Python is used
    Inline (-c/heredoc)  ████████████████  55.9%  (2,120)
    Module (-m)          █████████░░░░░░░  32.3%  (1,224)
    Script (.py)         ███░░░░░░░░░░░░░   9.1%  (345)

  ▸ Top -m modules
    py_compile           ████████████████  18.5%  (703)
    pytest               ███████████░░░░░  12.5%  (472)

  ▸ Most imported modules (inline)
    import json          ████████████████  (468)
    import yaml          █████████████░░░  (392)
    import re            ████████░░░░░░░░  (220)

  ▸ Insights
    55.9% inline — Claude uses Python as a shell scripting language.
    python -m py_compile: 703 calls (18.5%) — syntax checking as a quality gate.
    python -m pytest: 472 calls — automated test runs.

Options

npx cc-python          # terminal output
npx cc-python --json   # JSON output for scripting

JSON output

{
  "version": "1.0.0",
  "totalPythonCalls": 3790,
  "sessionsWithPython": 288,
  "inline": 2120,
  "module": 1224,
  "script": 345,
  "pip": 5,
  "inlinePct": 55.9,
  "topModules": [
    { "mod": "py_compile", "count": 703 },
    { "mod": "pytest", "count": 472 }
  ],
  "topImports": [
    { "module": "json", "count": 468 },
    { "module": "yaml", "count": 392 }
  ]
}

Browser version

Try it without installing: yurukusa.github.io/cc-python

Drag-drop your ~/.claude/projects/ folder (or any subfolder) to analyze.

How it works

Reads ~/.claude/projects/**/*.jsonl session transcripts and extracts every Bash tool call that starts with python or python3. Classifies each call into inline (-c flag or heredoc), module (-m), or script (.py file). Extracts import statements from inline code and script filenames from script calls. Zero external dependencies.


Part of cc-toolkit — 76 tools for understanding your Claude Code sessions.

About

How does Claude Code use Python? python3 call analysis — 3,790 calls, 55.9% inline, py_compile as quality gate.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors