Repository Analysis

anthropics/claude-agent-sdk-python

45.1 Strong AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of anthropics/claude-agent-sdk-python, a Python project with 7,623 GitHub stars. SynthScan v2.0 examined 41,016 lines of code across 124 source files, recording 1334 pattern matches distributed across 19 syntactic categories. The overall adjusted score of 45.1 places this repository in the Strong AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

45.1
Adjusted Score
45.1
Raw Score
100%
Time Factor
2026-07-14
Last Push
7.6K
Stars
Python
Language
41.0K
Lines of Code
124
Files
1.3K
Pattern Hits
2026-07-14
Scan Date
0.11
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 14MEDIUM 260LOW 1060

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 1334 distinct pattern matches across 19 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators224 hits · 820 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_example_s3_session_store.py131# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py133# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py236# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py238# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py338# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py340# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py375# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py377# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py446# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py448# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py481# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py483# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py50# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py52# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py96# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py98# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py509# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py511# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py579# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_example_s3_session_store.py581# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py68# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py70# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py114# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py116# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py267# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py269# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py465# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py467# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py599# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py601# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py25# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py27# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py534# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_mutations.py536# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py126# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py128# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py247# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py249# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1132# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1134# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1598# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1600# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py38# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py40# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py640# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py642# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py675# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py677# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1486# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1488# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1623# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1625# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1716# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1718# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_store_conformance.py27# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_store_conformance.py29# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_store_conformance.py138# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_session_store_conformance.py140# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mcp_large_output.py96# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_mcp_large_output.py98# ---------------------------------------------------------------------------COMMENT
164 more matches not shown…
Hyper-Verbose Identifiers756 hits · 623 pts
SeverityFileLineSnippetContext
LOWtests/test_task_compat.py10 def test_spawn_and_wait_asyncio(self):CODE
LOWtests/test_task_compat.py68 def test_done_callback_asyncio(self):CODE
LOWtests/test_task_compat.py99 def test_exception_propagates_via_wait_asyncio(self):CODE
LOWtests/test_task_compat.py110 def test_exception_propagates_via_wait_trio(self):CODE
LOWtests/test_task_compat.py121 def test_unhandled_exception_logged_under_trio(self, caplog):CODE
LOWtests/test_task_compat.py179 def test_contextvar_propagates_asyncio(self):CODE
LOWtests/test_task_compat.py182 def test_contextvar_propagates_trio(self):CODE
LOWtests/test_task_compat.py187 def test_cancel_from_different_task_trio(self):CODE
LOWtests/test_changelog.py12 def test_changelog_starts_with_header(self):CODE
LOWtests/test_changelog.py18 def test_changelog_has_valid_version_format(self):CODE
LOWtests/test_changelog.py34 def test_changelog_has_bullet_points(self):CODE
LOWtests/test_changelog.py63 def test_changelog_versions_in_descending_order(self):CODE
LOWtests/test_changelog.py79 def test_changelog_no_empty_bullet_points(self):CODE
LOWtests/test_streaming_client.py48 async def control_protocol_generator():CODE
LOWtests/test_streaming_client.py110def _create_mock_transport_with_control_responses():CODE
LOWtests/test_streaming_client.py130 async def control_protocol_generator():CODE
LOWtests/test_streaming_client.py162 async def test_auto_connect_with_context_manager(self):CODE
LOWtests/test_streaming_client.py180 async def test_manual_connect_disconnect(self):CODE
LOWtests/test_streaming_client.py202 async def test_connect_with_string_prompt(self):CODE
LOWtests/test_streaming_client.py227 async def test_connect_with_async_iterable(self):CODE
LOWtests/test_streaming_client.py285 async def test_send_message_with_session_id(self):CODE
LOWtests/test_streaming_client.py312 async def test_send_message_not_connected(self):CODE
LOWtests/test_streaming_client.py493 async def test_interrupt_not_connected(self):CODE
LOWtests/test_streaming_client.py501 async def test_reconnect_mcp_server(self):CODE
LOWtests/test_streaming_client.py533 async def test_reconnect_mcp_server_not_connected(self):CODE
LOWtests/test_streaming_client.py574 async def test_toggle_mcp_server_enabled_true(self):CODE
LOWtests/test_streaming_client.py605 async def test_toggle_mcp_server_not_connected(self):CODE
LOWtests/test_streaming_client.py644 async def test_stop_task_not_connected(self):CODE
LOWtests/test_streaming_client.py713 async def control_protocol_generator():CODE
LOWtests/test_streaming_client.py786 async def test_get_mcp_status_not_connected(self):CODE
LOWtests/test_streaming_client.py841 async def control_protocol_generator():CODE
LOWtests/test_streaming_client.py892 async def test_get_context_usage_not_connected(self):CODE
LOWtests/test_streaming_client.py923 async def test_concurrent_send_receive(self):CODE
LOWtests/test_streaming_client.py1003 async def test_query_with_async_iterable(self):CODE
LOWtests/test_streaming_client.py1105 async def test_receive_messages_not_connected(self):CODE
LOWtests/test_streaming_client.py1114 async def test_receive_response_not_connected(self):CODE
LOWtests/test_streaming_client.py1144 async def test_disconnect_without_connect(self):CODE
LOWtests/test_streaming_client.py1152 async def test_context_manager_with_exception(self):CODE
LOWtests/test_streaming_client.py1169 async def test_receive_response_list_comprehension(self):CODE
LOWtests/test_example_s3_session_store.py137async def test_append_part_name_format_and_sortable() -> None:CODE
LOWtests/test_example_s3_session_store.py242async def test_load_null_when_empty(s3_client: Any) -> None:CODE
LOWtests/test_example_s3_session_store.py248async def test_load_sorts_and_concatenates() -> None:CODE
LOWtests/test_example_s3_session_store.py328async def test_load_skips_malformed_lines() -> None:CODE
LOWtests/test_example_s3_session_store.py344async def test_list_sessions_extracts_mtime() -> None:CODE
LOWtests/test_example_s3_session_store.py381async def test_delete_batch_deletes_parts() -> None:CODE
LOWtests/test_example_s3_session_store.py452async def test_list_subkeys_extracts_unique_subpaths() -> None:CODE
LOWtests/test_example_s3_session_store.py488async def test_prefix_normalization(raw_prefix: str) -> None:CODE
LOWtests/test_example_s3_session_store.py115async def test_conformance_with_options_dataclass(s3_client: Any) -> None:CODE
LOWtests/test_example_s3_session_store.py163async def test_append_two_instances_distinct_part_names() -> None:CODE
LOWtests/test_example_s3_session_store.py178async def test_append_jsonl_serialization() -> None:CODE
LOWtests/test_example_s3_session_store.py190async def test_append_same_ms_preserves_order(monkeypatch: pytest.MonkeyPatch) -> None:CODE
LOWtests/test_example_s3_session_store.py213async def test_append_empty_is_noop() -> None:CODE
LOWtests/test_example_s3_session_store.py223async def test_append_includes_subpath() -> None:CODE
LOWtests/test_example_s3_session_store.py294async def test_load_excludes_subpath_parts() -> None:CODE
LOWtests/test_example_s3_session_store.py361async def test_list_sessions_ignores_subagent_parts() -> None:CODE
LOWtests/test_example_s3_session_store.py399async def test_delete_subpath_direct_only(s3_client: Any) -> None:CODE
LOWtests/test_example_s3_session_store.py415async def test_delete_cascades_without_subpath(s3_client: Any) -> None:CODE
LOWtests/test_example_s3_session_store.py430async def test_delete_surfaces_errors() -> None:CODE
LOWtests/test_example_s3_session_store.py465async def test_list_subkeys_filters_traversal_segments() -> None:CODE
LOWtests/test_example_s3_session_store.py529async def test_materialize_round_trip(CODE
696 more matches not shown…
Unused Imports166 hits · 105 pts
SeverityFileLineSnippetContext
LOWtests/test_example_redis_session_store_live.py14CODE
LOWtests/test_example_s3_session_store.py9CODE
LOWtests/test_session_mutations.py3CODE
LOWtests/test_sessions.py3CODE
LOWtests/test_session_store_conformance.py8CODE
LOWtests/test_example_redis_session_store.py12CODE
LOWtests/test_session_store_anyio.py8CODE
LOWtests/test_session_summary.py8CODE
LOWtests/test_session_resume.py3CODE
LOWtests/test_session_helpers_store.py8CODE
LOWtests/test_example_s3_session_store_live.py12CODE
LOWtests/test_example_postgres_session_store.py14CODE
LOWtests/test_session_import.py3CODE
LOWtests/test_transcript_mirror.py6CODE
LOWtests/test_types.py441CODE
LOWtests/test_types.py441CODE
LOWtests/test_types.py441CODE
LOWtests/test_types.py441CODE
LOWtests/test_types.py441CODE
LOWexamples/hooks.py16CODE
LOWexamples/include_partial_messages.py18CODE
LOWexamples/include_partial_messages.py18CODE
LOWexamples/include_partial_messages.py18CODE
LOWexamples/include_partial_messages.py18CODE
LOWexamples/include_partial_messages.py18CODE
LOWexamples/session_stores/postgres_session_store.py65CODE
LOWexamples/session_stores/redis_session_store.py50CODE
LOWexamples/session_stores/s3_session_store.py45CODE
LOWscripts/check_pypi_quota.py10CODE
LOWscripts/build_wheel.py27CODE
LOWsrc/claude_agent_sdk/__init__.py21CODE
LOWsrc/claude_agent_sdk/__init__.py21CODE
LOWsrc/claude_agent_sdk/__init__.py21CODE
LOWsrc/claude_agent_sdk/__init__.py21CODE
LOWsrc/claude_agent_sdk/__init__.py21CODE
LOWsrc/claude_agent_sdk/__init__.py28CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py29CODE
LOWsrc/claude_agent_sdk/__init__.py40CODE
LOWsrc/claude_agent_sdk/__init__.py40CODE
LOWsrc/claude_agent_sdk/__init__.py41CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py42CODE
LOWsrc/claude_agent_sdk/__init__.py54CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
106 more matches not shown…
Excessive Try-Catch Wrapping47 hits · 56 pts
SeverityFileLineSnippetContext
LOWtests/test_task_compat.py205 except Exception as e: # pragma: no cover - failure pathCODE
MEDIUMtests/test_task_compat.py201def cancel_in_other_task():CODE
LOWtests/test_transport.py1684 except Exception as e:CODE
LOWtests/test_transport.py1752 except Exception as e:CODE
MEDIUMtests/test_query.py665def close_in_other_task():CODE
LOWtests/test_query.py574 except Exception as e:CODE
LOWtests/test_query.py668 except Exception as e:CODE
LOWe2e-tests/test_dynamic_control.py91 except Exception as e:CODE
LOWexamples/streaming_mode_ipython.py163except Exception as e:CODE
MEDIUMexamples/streaming_mode_ipython.py164 print(f"Error: {e}")CODE
MEDIUMexamples/setting_sources.py193 print(f"Error: Unknown example '{example_name}'")CODE
MEDIUMexamples/hooks.py339 print(f"Error: Unknown example '{example_name}'")CODE
MEDIUMexamples/stderr_callback_example.py19 print(f"Error detected: {message}")CODE
LOWexamples/streaming_mode.py407 except Exception as e:CODE
LOWexamples/streaming_mode.py465 except Exception as e:CODE
MEDIUMexamples/streaming_mode.py510 print(f"Error: Unknown example '{example_name}'")CODE
MEDIUMscripts/download_cli.py106 print(f"Error downloading CLI after 3 attempts: {last_err}", file=sys.stderr)CODE
MEDIUMscripts/download_cli.py125 print("Error: Could not find installed Claude CLI binary", file=sys.stderr)CODE
MEDIUMscripts/build_wheel.py52 print(f"Error: {description} failed", file=sys.stderr)CODE
LOWscripts/build_wheel.py266 except Exception as e:CODE
LOW.github/workflows/build-and-publish.yml118 except Exception as exc:CODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py304 except Exception as e: # noqa: BLE001 - surface adapter failures with contextCODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py411 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py429 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py591 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py795 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py868 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py1164 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py1548 except Exception as e: # noqa: BLE001 - adapter is user codeCODE
LOWsrc/claude_agent_sdk/_internal/query.py169 except Exception as e: # pragma: no cover - buffer-full edge caseCODE
LOWsrc/claude_agent_sdk/_internal/query.py328 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py489 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py716 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py842 except Exception as e:CODE
LOW…laude_agent_sdk/_internal/transcript_mirror_batcher.py110 except Exception as e: # pragma: no cover - defensiveCODE
LOW…laude_agent_sdk/_internal/transcript_mirror_batcher.py131 except Exception as e: # pragma: no cover - defensiveCODE
LOW…laude_agent_sdk/_internal/transcript_mirror_batcher.py143 except Exception as cb_err: # pragma: no cover - defensiveCODE
LOW…laude_agent_sdk/_internal/transcript_mirror_batcher.py203 except Exception as e: # noqa: BLE001 - adapter is user codeCODE
LOWsrc/claude_agent_sdk/_internal/session_mutations.py535 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/session_mutations.py649 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py522 except Exception: # noqa: BLE001 - best-effort tracing must never break connect()CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py574 except Exception as e:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py596 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py613 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py744 except Exception as e:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py814 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py860 except Exception:CODE
Self-Referential Comments18 hits · 56 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_streaming_client.py1010 # Create a simple test script that validates stdin and outputs a resultCOMMENT
MEDIUMtests/test_streaming_client.py1129 # Create a new mock transport for each callCOMMENT
MEDIUMtests/test_sessions.py447 # Create a non-UUID .jsonl fileCOMMENT
MEDIUMtests/test_sessions.py526 # Create a real directory so realpath worksCOMMENT
MEDIUMtests/test_sdk_mcp_integration.py198 # Create an SDK serverCOMMENT
MEDIUMtests/test_sdk_mcp_integration.py257 # Create a tool that returns both text and image contentCOMMENT
MEDIUMtests/test_transport.py1658 # Create a real subprocess that consumes stdin (cross-platform)COMMENT
MEDIUMtests/test_transport.py1712 # Create a real subprocess that consumes stdin (cross-platform)COMMENT
MEDIUMtests/test_transport.py1980 # Create a large agent definition (50KB prompt)COMMENT
MEDIUMe2e-tests/test_structured_output.py72 # Define a schema with nested structureCOMMENT
MEDIUMe2e-tests/test_agents_and_settings.py158 # Create a temporary project with a filesystem agentCOMMENT
MEDIUMe2e-tests/test_agents_and_settings.py163 # Create a test agent fileCOMMENT
MEDIUMe2e-tests/test_agents_and_settings.py218 # Create a temporary project with local settingsCOMMENT
MEDIUMe2e-tests/test_agents_and_settings.py254 # Create a temporary project with a slash commandCOMMENT
MEDIUMe2e-tests/test_agents_and_settings.py296 # Create a temporary project with local settingsCOMMENT
MEDIUMexamples/streaming_mode_ipython.py101 # Create a background task to consume messagesCOMMENT
MEDIUMexamples/mcp_calculator.py142 # Create the calculator server with all toolsCOMMENT
MEDIUMexamples/streaming_mode.py145 # Create a background task to consume messagesCOMMENT
Deep Nesting61 hits · 46 pts
SeverityFileLineSnippetContext
LOWtests/test_changelog.py34CODE
LOWtests/test_streaming_client.py26CODE
LOWtests/test_streaming_client.py110CODE
LOWtests/test_streaming_client.py48CODE
LOWtests/test_streaming_client.py130CODE
LOWtests/test_streaming_client.py253CODE
LOWtests/test_streaming_client.py285CODE
LOWtests/test_streaming_client.py320CODE
LOWtests/test_streaming_client.py386CODE
LOWtests/test_streaming_client.py463CODE
LOWtests/test_streaming_client.py501CODE
LOWtests/test_streaming_client.py541CODE
LOWtests/test_streaming_client.py574CODE
LOWtests/test_streaming_client.py613CODE
LOWtests/test_streaming_client.py652CODE
LOWtests/test_streaming_client.py794CODE
LOWtests/test_streaming_client.py923CODE
LOWtests/test_streaming_client.py1169CODE
LOWtests/test_streaming_client.py713CODE
LOWtests/test_streaming_client.py841CODE
LOWtests/test_streaming_client.py933CODE
LOWtests/test_streaming_client.py1179CODE
LOWtests/test_option_warnings.py303CODE
LOWtests/test_option_warnings.py318CODE
LOWexamples/mcp_calculator.py100CODE
LOWexamples/filesystem_agents.py28CODE
LOWexamples/filesystem_agents.py43CODE
LOWexamples/tools_option.py16CODE
LOWexamples/tools_option.py45CODE
LOWexamples/tools_option.py74CODE
LOWexamples/streaming_mode_trio.py23CODE
LOWexamples/streaming_mode.py36CODE
LOWexamples/streaming_mode.py176CODE
LOWexamples/streaming_mode.py301CODE
LOWexamples/streaming_mode.py347CODE
LOWexamples/streaming_mode.py427CODE
LOWexamples/session_stores/s3_session_store.py344CODE
LOWscripts/build_wheel.py114CODE
LOWscripts/build_wheel.py199CODE
LOWsrc/claude_agent_sdk/__init__.py311CODE
LOWsrc/claude_agent_sdk/__init__.py456CODE
LOWsrc/claude_agent_sdk/types.py139CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py229CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py259CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py739CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py844CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py1134CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py1578CODE
LOWsrc/claude_agent_sdk/_internal/session_summary.py51CODE
LOWsrc/claude_agent_sdk/_internal/query.py172CODE
LOWsrc/claude_agent_sdk/_internal/query.py247CODE
LOWsrc/claude_agent_sdk/_internal/query.py375CODE
LOWsrc/claude_agent_sdk/_internal/query.py548CODE
LOWsrc/claude_agent_sdk/_internal/message_parser.py35CODE
LOW…laude_agent_sdk/_internal/transcript_mirror_batcher.py149CODE
LOWsrc/claude_agent_sdk/_internal/session_mutations.py504CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py190CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py282CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py473CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py624CODE
1 more matches not shown…
Docstring Block Structure7 hits · 35 pts
SeverityFileLineSnippetContext
HIGHsrc/claude_agent_sdk/__init__.py176Decorator for defining MCP tools with type safety. Creates a tool that can be used with SDK MCP servers. The tool rSTRING
HIGHsrc/claude_agent_sdk/__init__.py314Create an in-process MCP server that runs within your Python application. Unlike external MCP servers that run as sSTRING
HIGHsrc/claude_agent_sdk/_internal/sessions.py1584List sessions from a :class:`SessionStore`. Async, store-backed counterpart to :func:`list_sessions`. Loads each STRING
HIGHsrc/claude_agent_sdk/_internal/sessions.py1807List subagent IDs for a session from a :class:`SessionStore`. Async, store-backed counterpart to :func:`list_subageSTRING
HIGHsrc/claude_agent_sdk/_internal/message_parser.py36 Parse message from CLI output into typed Message objects. Args: data: Raw message dictionary from CLI STRING
HIGHsrc/claude_agent_sdk/_internal/session_mutations.py246Fork a session into a new branch with fresh UUIDs. Copies transcript messages from the source session into a new seSTRING
HIGHsrc/claude_agent_sdk/_internal/session_mutations.py892Fork a session into a new branch with fresh UUIDs via a :class:`SessionStore`. Async, store-backed counterpart to :STRING
Modern Structural Boilerplate23 hits · 23 pts
SeverityFileLineSnippetContext
LOWexamples/hooks.py32logger = logging.getLogger(__name__)CODE
LOWscripts/update_version.py9def update_version(new_version: str) -> None:CODE
LOWscripts/update_cli_version.py9def update_cli_version(new_version: str) -> None:CODE
LOWscripts/build_wheel.py57def update_version(version: str) -> None:CODE
LOWsrc/claude_agent_sdk/client.py323 async def set_permission_mode(self, mode: PermissionMode) -> None:CODE
LOWsrc/claude_agent_sdk/client.py350 async def set_model(self, model: str | None = None) -> None:CODE
LOWsrc/claude_agent_sdk/__init__.py154logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/__init__.py527__all__ = [CODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py44logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py26logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/_internal/session_summary.py25__all__ = ["fold_session_summary", "summary_entry_to_sdk_info"]CODE
LOWsrc/claude_agent_sdk/_internal/query.py39logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/_internal/query.py142 def set_transcript_mirror_batcher(self, batcher: "TranscriptMirrorBatcher") -> None:CODE
LOWsrc/claude_agent_sdk/_internal/query.py735 async def set_permission_mode(self, mode: PermissionMode) -> None:CODE
LOWsrc/claude_agent_sdk/_internal/query.py744 async def set_model(self, model: str | None) -> None:CODE
LOWsrc/claude_agent_sdk/_internal/session_import.py25__all__ = ["import_session_to_store"]CODE
LOWsrc/claude_agent_sdk/_internal/_task_compat.py28logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/_internal/message_parser.py32logger = logging.getLogger(__name__)CODE
LOW…laude_agent_sdk/_internal/transcript_mirror_batcher.py25logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/_internal/session_store.py20__all__ = [CODE
LOWsrc/claude_agent_sdk/_internal/transport/__init__.py87__all__ = ["Transport"]CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py28logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/testing/__init__.py9__all__ = ["run_session_store_conformance"]CODE
AI Slop Vocabulary5 hits · 17 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_example_redis_session_store_live.py102 # The harness calls make_store() once per contract for isolation. GiveCOMMENT
LOWtests/test_streaming_client.py1080 # On Unix, just use the script directlySTRING
MEDIUMtests/test_example_redis_session_store.py81# Conformance harnessCOMMENT
MEDIUMtests/test_example_postgres_session_store.py119# Conformance harnessCOMMENT
MEDIUMtests/test_example_postgres_session_store.py126 # The harness calls make_store() once per contract for isolation. GiveCOMMENT
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHexamples/setting_sources.py0run all examples or a specific example based on command line argument.STRING
HIGHexamples/hooks.py0run all examples or a specific example based on command line argument.STRING
HIGHexamples/streaming_mode.py0run all examples or a specific example based on command line argument.STRING
Redundant / Tautological Comments9 hits · 13 pts
SeverityFileLineSnippetContext
LOWtests/test_streaming_client.py54 # Check if initialization was requestedCOMMENT
LOWtests/test_sessions.py1377 # Set mtime to Feb 2026 (well after the Jan timestamp)COMMENT
LOWe2e-tests/test_sdk_mcp_tools.py48 # Check if the actual Python function was calledCOMMENT
LOWexamples/streaming_mode_ipython.py113 # Check if we got a result after interruptCOMMENT
LOWexamples/max_budget_usd.py71 # Check if budget was exceededCOMMENT
LOWscripts/build_wheel.py206 # Check if we have a bundled CLI - if so, retag the wheel as platform-specificCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py214 # Check if settings is a JSON string or a file pathCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py224 # Read the fileCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py564 # Check if the error comes from the working directory or the CLICOMMENT
Cross-Language Confusion2 hits · 12 pts
SeverityFileLineSnippetContext
HIGH…claude_agent_sdk/_internal/transport/subprocess_cli.py605 for line in framer.push(chunk):CODE
HIGH…claude_agent_sdk/_internal/transport/subprocess_cli.py784 for line in framer.push(chunk):CODE
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHsrc/claude_agent_sdk/_internal/sessions.py441 # User-set title (customTitle) wins over AI-generated title (aiTitle).COMMENT
Dead Code3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_session_resume.py732CODE
MEDIUMtests/test_client.py353CODE
MEDIUMsrc/claude_agent_sdk/client.py114CODE
Slop Phrases2 hits · 5 pts
SeverityFileLineSnippetContext
LOWexamples/streaming_mode_ipython.py82# Don't forget to disconnect when doneCOMMENT
MEDIUMexamples/plugin_example.py28 # In production, you can use any path to your plugin directoryCOMMENT
Magic Placeholder Names1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHe2e-tests/README.md14export ANTHROPIC_API_KEY="your-api-key-here"CODE
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippetContext
LOWe2e-tests/test_stderr_callback.py21 # and since CLI 2.1.193 the CLI refuses to honor project-scoped grants fromCOMMENT
LOWscripts/test-docker.sh1#!/bin/bashCOMMENT
LOW.github/workflows/claude-code-review.yml61 # - For test files: Coverage, edge cases, and test qualityCOMMENT
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippetContext
LOWscripts/test-docker.sh5# Usage:COMMENT
LOWscripts/gh.sh7# Usage:COMMENT
AI Structural Patterns1 hit · 0 pts
SeverityFileLineSnippetContext
LOWtests/test_sessions.py53CODE