anthropics / claude-agent-sdk-python
File Size

The distribution of size of files (measured in lines of code).

Intro
  • File size measurements show the distribution of size of files.
  • Files are classified in four categories based on their size (lines of code): 1-100 (very small files), 101-200 (small files), 201-500 (medium size files), 501-1000 (long files), 1001+(very long files).
  • It is a good practice to keep files small. Long files may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
File Size Overall
  • There are 30 files with 6,389 lines of code.
    • 1 very long files (1,060 lines of code)
    • 4 long files (2,385 lines of code)
    • 6 medium size files (1,839 lines of code)
    • 5 small files (659 lines of code)
    • 14 very small files (446 lines of code)
16% | 37% | 28% | 10% | 6%
Legend:
1001+
501-1000
201-500
101-200
1-100


explore: grouped by folders | grouped by size | sunburst | 3D view
File Size per Extension
1001+
501-1000
201-500
101-200
1-100
py16% | 37% | 28% | 10% | 6%
js0% | 0% | 0% | 0% | 100%
File Size per Logical Decomposition
primary
1001+
501-1000
201-500
101-200
1-100
src18% | 40% | 26% | 9% | 4%
scripts0% | 0% | 51% | 20% | 28%
.github0% | 0% | 0% | 0% | 100%
Longest Files (Top 30)
File# lines# units
sessions.py
in src/claude_agent_sdk/_internal
1060 44
types.py
in src/claude_agent_sdk
757 2
query.py
in src/claude_agent_sdk/_internal
597 8
subprocess_cli.py
in src/claude_agent_sdk/_internal/transport
523 9
session_mutations.py
in src/claude_agent_sdk/_internal
508 15
__init__.py
in src/claude_agent_sdk
469 7
session_resume.py
in src/claude_agent_sdk/_internal
335 8
message_parser.py
in src/claude_agent_sdk/_internal
297 1
build_wheel.py
in scripts
268 13
client.py
in src/claude_agent_sdk
249 2
session_store_conformance.py
in src/claude_agent_sdk/testing
221 2
client.py
in src/claude_agent_sdk/_internal
160 2
session_summary.py
in src/claude_agent_sdk/_internal
142 5
transcript_mirror_batcher.py
in src/claude_agent_sdk/_internal
132 1
session_store.py
in src/claude_agent_sdk/_internal
119 7
download_cli.py
in scripts
106 5
100 3
_task_compat.py
in src/claude_agent_sdk/_internal
88 13
session_import.py
in src/claude_agent_sdk/_internal
84 1
31 1
_errors.py
in src/claude_agent_sdk
30 4
session_store_validation.py
in src/claude_agent_sdk/_internal
27 2
__init__.py
in src/claude_agent_sdk/_internal/transport
23 2
refresh-identity-token.js
in .github/actions/setup-claude-auth
20 1
20 1
query.py
in src/claude_agent_sdk
18 -
__init__.py
in src/claude_agent_sdk/testing
2 -
_version.py
in src/claude_agent_sdk
1 -
_cli_version.py
in src/claude_agent_sdk
1 -
__init__.py
in src/claude_agent_sdk/_internal
1 -
Files With Most Units (Top 25)
File# lines# units
sessions.py
in src/claude_agent_sdk/_internal
1060 44
session_mutations.py
in src/claude_agent_sdk/_internal
508 15
build_wheel.py
in scripts
268 13
_task_compat.py
in src/claude_agent_sdk/_internal
88 13
subprocess_cli.py
in src/claude_agent_sdk/_internal/transport
523 9
query.py
in src/claude_agent_sdk/_internal
597 8
session_resume.py
in src/claude_agent_sdk/_internal
335 8
__init__.py
in src/claude_agent_sdk
469 7
session_store.py
in src/claude_agent_sdk/_internal
119 7
download_cli.py
in scripts
106 5
session_summary.py
in src/claude_agent_sdk/_internal
142 5
_errors.py
in src/claude_agent_sdk
30 4
100 3
types.py
in src/claude_agent_sdk
757 2
session_store_conformance.py
in src/claude_agent_sdk/testing
221 2
__init__.py
in src/claude_agent_sdk/_internal/transport
23 2
session_store_validation.py
in src/claude_agent_sdk/_internal
27 2
client.py
in src/claude_agent_sdk/_internal
160 2
client.py
in src/claude_agent_sdk
249 2
refresh-identity-token.js
in .github/actions/setup-claude-auth
20 1
20 1
31 1
transcript_mirror_batcher.py
in src/claude_agent_sdk/_internal
132 1
message_parser.py
in src/claude_agent_sdk/_internal
297 1
session_import.py
in src/claude_agent_sdk/_internal
84 1
Files With Long Lines (Top 1)

There is only one file with lines longer than 120 characters. In total, there is only one long line.

File# lines# units# long lines
query.py
in src/claude_agent_sdk/_internal
597 8 1
Correlations

File Size vs. Commits (all time): 30 points

src/claude_agent_sdk/_cli_version.py x: 165 commits (all time) y: 1 lines of code src/claude_agent_sdk/__init__.py x: 38 commits (all time) y: 469 lines of code src/claude_agent_sdk/_internal/message_parser.py x: 19 commits (all time) y: 297 lines of code src/claude_agent_sdk/types.py x: 72 commits (all time) y: 757 lines of code src/claude_agent_sdk/testing/session_store_conformance.py x: 3 commits (all time) y: 221 lines of code .github/actions/setup-claude-auth/refresh-identity-token.js x: 1 commits (all time) y: 20 lines of code src/claude_agent_sdk/_internal/session_resume.py x: 3 commits (all time) y: 335 lines of code src/claude_agent_sdk/_internal/sessions.py x: 8 commits (all time) y: 1060 lines of code src/claude_agent_sdk/_internal/transcript_mirror_batcher.py x: 4 commits (all time) y: 132 lines of code src/claude_agent_sdk/_internal/transport/subprocess_cli.py x: 47 commits (all time) y: 523 lines of code src/claude_agent_sdk/_internal/query.py x: 31 commits (all time) y: 597 lines of code src/claude_agent_sdk/_internal/client.py x: 14 commits (all time) y: 160 lines of code src/claude_agent_sdk/client.py x: 23 commits (all time) y: 249 lines of code src/claude_agent_sdk/_internal/session_summary.py x: 2 commits (all time) y: 142 lines of code src/claude_agent_sdk/_internal/_task_compat.py x: 1 commits (all time) y: 88 lines of code src/claude_agent_sdk/_internal/session_import.py x: 1 commits (all time) y: 84 lines of code src/claude_agent_sdk/query.py x: 5 commits (all time) y: 18 lines of code src/claude_agent_sdk/_internal/session_store.py x: 2 commits (all time) y: 119 lines of code src/claude_agent_sdk/_internal/session_mutations.py x: 5 commits (all time) y: 508 lines of code src/claude_agent_sdk/_internal/session_store_validation.py x: 1 commits (all time) y: 27 lines of code src/claude_agent_sdk/testing/__init__.py x: 1 commits (all time) y: 2 lines of code scripts/download_cli.py x: 3 commits (all time) y: 106 lines of code scripts/check_pypi_quota.py x: 1 commits (all time) y: 100 lines of code src/claude_agent_sdk/_version.py x: 3 commits (all time) y: 1 lines of code scripts/build_wheel.py x: 2 commits (all time) y: 268 lines of code scripts/update_version.py x: 4 commits (all time) y: 31 lines of code src/claude_agent_sdk/_errors.py x: 1 commits (all time) y: 30 lines of code src/claude_agent_sdk/_internal/transport/__init__.py x: 1 commits (all time) y: 23 lines of code
1060.0
lines of code
  min: 1.0
  average: 212.97
  25th percentile: 22.25
  median: 112.5
  75th percentile: 306.5
  max: 1060.0
0 165.0
commits (all time)
min: 1.0 | average: 15.43 | 25th percentile: 1.0 | median: 3.0 | 75th percentile: 15.25 | max: 165.0

File Size vs. Contributors (all time): 30 points

src/claude_agent_sdk/_cli_version.py x: 2 contributors (all time) y: 1 lines of code src/claude_agent_sdk/__init__.py x: 12 contributors (all time) y: 469 lines of code src/claude_agent_sdk/_internal/message_parser.py x: 12 contributors (all time) y: 297 lines of code src/claude_agent_sdk/types.py x: 27 contributors (all time) y: 757 lines of code src/claude_agent_sdk/testing/session_store_conformance.py x: 1 contributors (all time) y: 221 lines of code .github/actions/setup-claude-auth/refresh-identity-token.js x: 1 contributors (all time) y: 20 lines of code src/claude_agent_sdk/_internal/session_resume.py x: 3 contributors (all time) y: 335 lines of code src/claude_agent_sdk/_internal/sessions.py x: 2 contributors (all time) y: 1060 lines of code src/claude_agent_sdk/_internal/transcript_mirror_batcher.py x: 3 contributors (all time) y: 132 lines of code src/claude_agent_sdk/_internal/transport/subprocess_cli.py x: 25 contributors (all time) y: 523 lines of code src/claude_agent_sdk/_internal/query.py x: 13 contributors (all time) y: 597 lines of code src/claude_agent_sdk/_internal/client.py x: 8 contributors (all time) y: 160 lines of code src/claude_agent_sdk/client.py x: 12 contributors (all time) y: 249 lines of code src/claude_agent_sdk/_internal/session_summary.py x: 1 contributors (all time) y: 142 lines of code src/claude_agent_sdk/_internal/_task_compat.py x: 1 contributors (all time) y: 88 lines of code src/claude_agent_sdk/_internal/session_import.py x: 1 contributors (all time) y: 84 lines of code src/claude_agent_sdk/query.py x: 4 contributors (all time) y: 18 lines of code src/claude_agent_sdk/_internal/session_store.py x: 1 contributors (all time) y: 119 lines of code src/claude_agent_sdk/_internal/session_mutations.py x: 1 contributors (all time) y: 508 lines of code src/claude_agent_sdk/_internal/session_store_validation.py x: 1 contributors (all time) y: 27 lines of code src/claude_agent_sdk/testing/__init__.py x: 1 contributors (all time) y: 2 lines of code scripts/download_cli.py x: 2 contributors (all time) y: 106 lines of code scripts/check_pypi_quota.py x: 1 contributors (all time) y: 100 lines of code src/claude_agent_sdk/_version.py x: 3 contributors (all time) y: 1 lines of code scripts/build_wheel.py x: 1 contributors (all time) y: 268 lines of code scripts/update_version.py x: 2 contributors (all time) y: 31 lines of code src/claude_agent_sdk/_errors.py x: 1 contributors (all time) y: 30 lines of code src/claude_agent_sdk/_internal/transport/__init__.py x: 1 contributors (all time) y: 23 lines of code
1060.0
lines of code
  min: 1.0
  average: 212.97
  25th percentile: 22.25
  median: 112.5
  75th percentile: 306.5
  max: 1060.0
0 27.0
contributors (all time)
min: 1.0 | average: 4.83 | 25th percentile: 1.0 | median: 1.5 | 75th percentile: 5.0 | max: 27.0

File Size vs. Commits (30 days): 9 points

src/claude_agent_sdk/_cli_version.py x: 30 commits (30d) y: 1 lines of code src/claude_agent_sdk/__init__.py x: 1 commits (30d) y: 469 lines of code src/claude_agent_sdk/_internal/message_parser.py x: 1 commits (30d) y: 297 lines of code src/claude_agent_sdk/types.py x: 1 commits (30d) y: 757 lines of code src/claude_agent_sdk/testing/session_store_conformance.py x: 1 commits (30d) y: 221 lines of code .github/actions/setup-claude-auth/refresh-identity-token.js x: 1 commits (30d) y: 20 lines of code src/claude_agent_sdk/_internal/session_resume.py x: 1 commits (30d) y: 335 lines of code src/claude_agent_sdk/_internal/sessions.py x: 1 commits (30d) y: 1060 lines of code src/claude_agent_sdk/_internal/transcript_mirror_batcher.py x: 1 commits (30d) y: 132 lines of code
1060.0
lines of code
  min: 1.0
  average: 365.78
  25th percentile: 76.0
  median: 297.0
  75th percentile: 613.0
  max: 1060.0
0 30.0
commits (30d)
min: 1.0 | average: 4.22 | 25th percentile: 1.0 | median: 1.0 | 75th percentile: 1.0 | max: 30.0

File Size vs. Contributors (30 days): 9 points

src/claude_agent_sdk/_cli_version.py x: 1 contributors (30d) y: 1 lines of code src/claude_agent_sdk/__init__.py x: 1 contributors (30d) y: 469 lines of code src/claude_agent_sdk/_internal/message_parser.py x: 1 contributors (30d) y: 297 lines of code src/claude_agent_sdk/types.py x: 1 contributors (30d) y: 757 lines of code src/claude_agent_sdk/testing/session_store_conformance.py x: 1 contributors (30d) y: 221 lines of code .github/actions/setup-claude-auth/refresh-identity-token.js x: 1 contributors (30d) y: 20 lines of code src/claude_agent_sdk/_internal/session_resume.py x: 1 contributors (30d) y: 335 lines of code src/claude_agent_sdk/_internal/sessions.py x: 1 contributors (30d) y: 1060 lines of code src/claude_agent_sdk/_internal/transcript_mirror_batcher.py x: 1 contributors (30d) y: 132 lines of code
1060.0
lines of code
  min: 1.0
  average: 365.78
  25th percentile: 76.0
  median: 297.0
  75th percentile: 613.0
  max: 1060.0
0 1.0
contributors (30d)
min: 1.0 | average: 1.0 | 25th percentile: 1.0 | median: 1.0 | 75th percentile: 1.0 | max: 1.0

File Size vs. Commits (90 days): 21 points

src/claude_agent_sdk/_cli_version.py x: 85 commits (90d) y: 1 lines of code src/claude_agent_sdk/__init__.py x: 17 commits (90d) y: 469 lines of code src/claude_agent_sdk/_internal/message_parser.py x: 7 commits (90d) y: 297 lines of code src/claude_agent_sdk/types.py x: 35 commits (90d) y: 757 lines of code src/claude_agent_sdk/testing/session_store_conformance.py x: 3 commits (90d) y: 221 lines of code .github/actions/setup-claude-auth/refresh-identity-token.js x: 1 commits (90d) y: 20 lines of code src/claude_agent_sdk/_internal/session_resume.py x: 3 commits (90d) y: 335 lines of code src/claude_agent_sdk/_internal/sessions.py x: 6 commits (90d) y: 1060 lines of code src/claude_agent_sdk/_internal/transcript_mirror_batcher.py x: 4 commits (90d) y: 132 lines of code src/claude_agent_sdk/_internal/transport/subprocess_cli.py x: 18 commits (90d) y: 523 lines of code src/claude_agent_sdk/_internal/query.py x: 14 commits (90d) y: 597 lines of code src/claude_agent_sdk/_internal/client.py x: 8 commits (90d) y: 160 lines of code src/claude_agent_sdk/client.py x: 11 commits (90d) y: 249 lines of code src/claude_agent_sdk/_internal/session_summary.py x: 2 commits (90d) y: 142 lines of code src/claude_agent_sdk/_internal/_task_compat.py x: 1 commits (90d) y: 88 lines of code src/claude_agent_sdk/_internal/session_import.py x: 1 commits (90d) y: 84 lines of code src/claude_agent_sdk/query.py x: 3 commits (90d) y: 18 lines of code src/claude_agent_sdk/_internal/session_store.py x: 2 commits (90d) y: 119 lines of code src/claude_agent_sdk/_internal/session_mutations.py x: 3 commits (90d) y: 508 lines of code src/claude_agent_sdk/_internal/session_store_validation.py x: 1 commits (90d) y: 27 lines of code src/claude_agent_sdk/testing/__init__.py x: 1 commits (90d) y: 2 lines of code
1060.0
lines of code
  min: 1.0
  average: 276.62
  25th percentile: 55.5
  median: 160.0
  75th percentile: 488.5
  max: 1060.0
0 85.0
commits (90d)
min: 1.0 | average: 10.76 | 25th percentile: 1.5 | median: 3.0 | 75th percentile: 12.5 | max: 85.0

File Size vs. Contributors (90 days): 21 points

src/claude_agent_sdk/_cli_version.py x: 1 contributors (90d) y: 1 lines of code src/claude_agent_sdk/__init__.py x: 8 contributors (90d) y: 469 lines of code src/claude_agent_sdk/_internal/message_parser.py x: 4 contributors (90d) y: 297 lines of code src/claude_agent_sdk/types.py x: 12 contributors (90d) y: 757 lines of code src/claude_agent_sdk/testing/session_store_conformance.py x: 1 contributors (90d) y: 221 lines of code .github/actions/setup-claude-auth/refresh-identity-token.js x: 1 contributors (90d) y: 20 lines of code src/claude_agent_sdk/_internal/session_resume.py x: 3 contributors (90d) y: 335 lines of code src/claude_agent_sdk/_internal/sessions.py x: 2 contributors (90d) y: 1060 lines of code src/claude_agent_sdk/_internal/transcript_mirror_batcher.py x: 3 contributors (90d) y: 132 lines of code src/claude_agent_sdk/_internal/transport/subprocess_cli.py x: 9 contributors (90d) y: 523 lines of code src/claude_agent_sdk/_internal/query.py x: 4 contributors (90d) y: 597 lines of code src/claude_agent_sdk/_internal/client.py x: 3 contributors (90d) y: 160 lines of code src/claude_agent_sdk/client.py x: 4 contributors (90d) y: 249 lines of code src/claude_agent_sdk/_internal/session_summary.py x: 1 contributors (90d) y: 142 lines of code src/claude_agent_sdk/_internal/_task_compat.py x: 1 contributors (90d) y: 88 lines of code src/claude_agent_sdk/_internal/session_import.py x: 1 contributors (90d) y: 84 lines of code src/claude_agent_sdk/query.py x: 2 contributors (90d) y: 18 lines of code src/claude_agent_sdk/_internal/session_store.py x: 1 contributors (90d) y: 119 lines of code src/claude_agent_sdk/_internal/session_mutations.py x: 1 contributors (90d) y: 508 lines of code src/claude_agent_sdk/_internal/session_store_validation.py x: 1 contributors (90d) y: 27 lines of code
1060.0
lines of code
  min: 1.0
  average: 276.62
  25th percentile: 55.5
  median: 160.0
  75th percentile: 488.5
  max: 1060.0
0 12.0
contributors (90d)
min: 1.0 | average: 3.05 | 25th percentile: 1.0 | median: 2.0 | 75th percentile: 4.0 | max: 12.0