Repository Analysis

anthropics/claude-agent-sdk-python

41.8 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,997 GitHub stars. SynthScan v2.0 examined 48,490 lines of code across 137 source files, recording 1564 pattern matches distributed across 19 syntactic categories. The overall adjusted score of 41.8 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).

41.8
Adjusted Score
41.8
Raw Score
100%
Time Factor
2026-08-28
Last Push
8.0K
Stars
Python
Language
48.5K
Lines of Code
137
Files
1.6K
Pattern Hits
2026-08-29
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 15MEDIUM 263LOW 1286

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 1564 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.py1145# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1147# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1611# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1613# ---------------------------------------------------------------------------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.py1499# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1501# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1636# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1638# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1729# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_sessions.py1731# ---------------------------------------------------------------------------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 Identifiers955 hits · 775 pts
SeverityFileLineSnippetContext
LOWtests/test_task_compat.py10 def test_spawn_and_wait_asyncio(self):CODE
LOWtests/test_task_compat.py104 def test_cancelled_waiter_asyncio(self):CODE
LOWtests/test_task_compat.py107 def test_cancelled_waiter_trio(self):CODE
LOWtests/test_task_compat.py112 def test_done_callback_asyncio(self):CODE
LOWtests/test_task_compat.py143 def test_exception_propagates_via_wait_asyncio(self):CODE
LOWtests/test_task_compat.py154 def test_exception_propagates_via_wait_trio(self):CODE
LOWtests/test_task_compat.py165 def test_unhandled_exception_logged_under_trio(self, caplog):CODE
LOWtests/test_task_compat.py223 def test_contextvar_propagates_asyncio(self):CODE
LOWtests/test_task_compat.py226 def test_contextvar_propagates_trio(self):CODE
LOWtests/test_task_compat.py231 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_forward_subagent_text_sent_in_initialize(self):CODE
LOWtests/test_streaming_client.py256 async def test_connect_with_async_iterable(self):CODE
LOWtests/test_streaming_client.py314 async def test_send_message_with_session_id(self):CODE
LOWtests/test_streaming_client.py341 async def test_send_message_not_connected(self):CODE
LOWtests/test_streaming_client.py522 async def test_interrupt_not_connected(self):CODE
LOWtests/test_streaming_client.py530 async def test_reconnect_mcp_server(self):CODE
LOWtests/test_streaming_client.py562 async def test_reconnect_mcp_server_not_connected(self):CODE
LOWtests/test_streaming_client.py603 async def test_toggle_mcp_server_enabled_true(self):CODE
LOWtests/test_streaming_client.py634 async def test_toggle_mcp_server_not_connected(self):CODE
LOWtests/test_streaming_client.py673 async def test_stop_task_not_connected(self):CODE
LOWtests/test_streaming_client.py742 async def control_protocol_generator():CODE
LOWtests/test_streaming_client.py815 async def test_get_mcp_status_not_connected(self):CODE
LOWtests/test_streaming_client.py870 async def control_protocol_generator():CODE
LOWtests/test_streaming_client.py921 async def test_get_context_usage_not_connected(self):CODE
LOWtests/test_streaming_client.py952 async def test_concurrent_send_receive(self):CODE
LOWtests/test_streaming_client.py1032 async def test_query_with_async_iterable(self):CODE
LOWtests/test_streaming_client.py1134 async def test_receive_messages_not_connected(self):CODE
LOWtests/test_streaming_client.py1143 async def test_receive_response_not_connected(self):CODE
LOWtests/test_streaming_client.py1173 async def test_disconnect_without_connect(self):CODE
LOWtests/test_streaming_client.py1181 async def test_context_manager_with_exception(self):CODE
LOWtests/test_streaming_client.py1198 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
895 more matches not shown…
Unused Imports174 hits · 109 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.py35CODE
LOWsrc/claude_agent_sdk/__init__.py32CODE
LOWsrc/claude_agent_sdk/__init__.py32CODE
LOWsrc/claude_agent_sdk/__init__.py32CODE
LOWsrc/claude_agent_sdk/__init__.py32CODE
LOWsrc/claude_agent_sdk/__init__.py32CODE
LOWsrc/claude_agent_sdk/__init__.py32CODE
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__.py53CODE
LOWsrc/claude_agent_sdk/__init__.py53CODE
LOWsrc/claude_agent_sdk/__init__.py54CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py55CODE
LOWsrc/claude_agent_sdk/__init__.py67CODE
114 more matches not shown…
Excessive Try-Catch Wrapping55 hits · 65 pts
SeverityFileLineSnippetContext
LOWtests/test_task_compat.py249 except Exception as e: # pragma: no cover - failure pathCODE
MEDIUMtests/test_task_compat.py245def cancel_in_other_task():CODE
LOWtests/test_sdk_mcp_integration.py578 except Exception as e:CODE
LOWtests/test_sdk_mcp_integration.py1734 except Exception as e:CODE
LOWtests/test_transport.py1969 except Exception as e:CODE
LOWtests/test_transport.py2037 except Exception as e:CODE
MEDIUMtests/test_query.py1259def close_in_other_task():CODE
LOWtests/test_query.py1168 except Exception as e:CODE
LOWtests/test_query.py1262 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/update_cli_version.py70 print(f"Error: {exc}", file=sys.stderr)CODE
MEDIUMscripts/download_cli.py181 print(f"Error: could not run the install command: {e}", file=sys.stderr)CODE
MEDIUMscripts/download_cli.py316 print("Error: Could not find installed Claude CLI binary", file=sys.stderr)CODE
MEDIUMscripts/download_cli.py366 print(f"Error: {exc}", file=sys.stderr)CODE
MEDIUMscripts/build_wheel.py60 print(f"Error: {description} failed", file=sys.stderr)CODE
LOWscripts/build_wheel.py305 except Exception as e:CODE
LOW.github/workflows/build-and-publish.yml118 except Exception as exc:CODE
LOWsrc/claude_agent_sdk/__init__.py614 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py311 except Exception as e: # noqa: BLE001 - surface adapter failures with contextCODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py506 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py524 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.py1169 except Exception:CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py1642 except Exception as e: # noqa: BLE001 - adapter is user codeCODE
LOWsrc/claude_agent_sdk/_internal/query.py228 except Exception as e: # pragma: no cover - buffer-full edge caseCODE
LOWsrc/claude_agent_sdk/_internal/query.py405 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py586 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py669 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py877 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py891 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/sdk_mcp_bridge.py163 except Exception as e:CODE
MEDIUMsrc/claude_agent_sdk/_internal/sdk_mcp_bridge.py139def _run(self) -> None: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.py914 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py931 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py840 except Exception: # noqa: BLE001 - best-effort tracing must never break connect()CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py892 except Exception as e:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py1062 except Exception as e:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py1132 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py1178 except Exception:CODE
Self-Referential Comments16 hits · 50 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_streaming_client.py1039 # Create a simple test script that validates stdin and outputs a resultCOMMENT
MEDIUMtests/test_streaming_client.py1158 # 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_transport.py1943 # Create a real subprocess that consumes stdin (cross-platform)COMMENT
MEDIUMtests/test_transport.py1997 # Create a real subprocess that consumes stdin (cross-platform)COMMENT
MEDIUMtests/test_transport.py2265 # 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 Nesting63 hits · 44 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.py282CODE
LOWtests/test_streaming_client.py314CODE
LOWtests/test_streaming_client.py349CODE
LOWtests/test_streaming_client.py415CODE
LOWtests/test_streaming_client.py492CODE
LOWtests/test_streaming_client.py530CODE
LOWtests/test_streaming_client.py570CODE
LOWtests/test_streaming_client.py603CODE
LOWtests/test_streaming_client.py642CODE
LOWtests/test_streaming_client.py681CODE
LOWtests/test_streaming_client.py823CODE
LOWtests/test_streaming_client.py952CODE
LOWtests/test_streaming_client.py1198CODE
LOWtests/test_streaming_client.py742CODE
LOWtests/test_streaming_client.py870CODE
LOWtests/test_streaming_client.py962CODE
LOWtests/test_streaming_client.py1208CODE
LOWtests/test_sdk_mcp_integration.py1463CODE
LOWtests/test_option_warnings.py303CODE
LOWtests/test_option_warnings.py318CODE
LOWe2e-tests/test_forward_subagent_text.py43CODE
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.py153CODE
LOWscripts/build_wheel.py238CODE
LOWsrc/claude_agent_sdk/__init__.py451CODE
LOWsrc/claude_agent_sdk/types.py142CODE
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.py1139CODE
LOWsrc/claude_agent_sdk/_internal/sessions.py1672CODE
LOWsrc/claude_agent_sdk/_internal/session_summary.py51CODE
LOWsrc/claude_agent_sdk/_internal/query.py231CODE
LOWsrc/claude_agent_sdk/_internal/query.py308CODE
LOWsrc/claude_agent_sdk/_internal/query.py469CODE
LOWsrc/claude_agent_sdk/_internal/query.py762CODE
LOWsrc/claude_agent_sdk/_internal/message_parser.py50CODE
LOWsrc/claude_agent_sdk/_internal/sdk_mcp_bridge.py289CODE
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.py465CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py562CODE
3 more matches not shown…
Docstring Block Structure7 hits · 35 pts
SeverityFileLineSnippetContext
HIGHsrc/claude_agent_sdk/__init__.py257Decorator 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__.py494Create 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.py1678List sessions from a :class:`SessionStore`. Async, store-backed counterpart to :func:`list_sessions`. Loads each STRING
HIGHsrc/claude_agent_sdk/_internal/sessions.py1901List subagent IDs for a session from a :class:`SessionStore`. Async, store-backed counterpart to :func:`list_subageSTRING
HIGHsrc/claude_agent_sdk/_internal/message_parser.py51 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 Boilerplate24 hits · 24 pts
SeverityFileLineSnippetContext
LOWexamples/hooks.py32logger = logging.getLogger(__name__)CODE
LOWscripts/update_version.py9def update_version(new_version: str) -> None:CODE
LOWscripts/update_cli_version.py22def update_cli_version(new_version: str, version_path: Path | None = None) -> None:CODE
LOWscripts/build_wheel.py65def update_version(version: str) -> None:CODE
LOWsrc/claude_agent_sdk/client.py284 async def set_permission_mode(self, mode: PermissionMode) -> None:CODE
LOWsrc/claude_agent_sdk/client.py311 async def set_model(self, model: str | None = None) -> None:CODE
LOWsrc/claude_agent_sdk/__init__.py172logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/__init__.py622__all__ = [CODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py51logger = 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.py36logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/_internal/query.py201 def set_transcript_mirror_batcher(self, batcher: "TranscriptMirrorBatcher") -> None:CODE
LOWsrc/claude_agent_sdk/_internal/query.py688 async def set_permission_mode(self, mode: PermissionMode) -> None:CODE
LOWsrc/claude_agent_sdk/_internal/query.py697 async def set_model(self, model: str | None) -> None:CODE
LOWsrc/claude_agent_sdk/_internal/session_import.py26__all__ = ["import_session_to_store"]CODE
LOWsrc/claude_agent_sdk/_internal/_task_compat.py29logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/_internal/message_parser.py34logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/_internal/sdk_mcp_bridge.py41logger = 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.py33logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/testing/__init__.py9__all__ = ["run_session_store_conformance"]CODE
Cross-Language Confusion3 hits · 18 pts
SeverityFileLineSnippetContext
HIGHtests/test_download_cli.py86 ("1.0.0 && id", None),CODE
HIGH…claude_agent_sdk/_internal/transport/subprocess_cli.py923 for line in framer.push(chunk):CODE
HIGH…claude_agent_sdk/_internal/transport/subprocess_cli.py1102 for line in framer.push(chunk):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.py1109 # 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.py1390 # 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.py245 # Check if we have a bundled CLI - if so, retag the wheel as platform-specificCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py489 # Check if settings is a JSON string or a file pathCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py499 # Read the fileCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py882 # Check if the error comes from the working directory or the CLICOMMENT
Over-Commented Block12 hits · 12 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
LOWsrc/claude_agent_sdk/types.py1061 "fromSession": str,COMMENT
LOWsrc/claude_agent_sdk/_internal/query.py41# This mirrors the set the CLI itself holds a result back for, which isCOMMENT
LOWsrc/claude_agent_sdk/_internal/query.py181 # in flight) so the stdin-closing waiter can wake; see #1088 andCOMMENT
LOWsrc/claude_agent_sdk/_internal/query.py361COMMENT
LOWsrc/claude_agent_sdk/_internal/query.py441 # exception rides along so receive_messages() re-raises it as-isCOMMENT
LOWsrc/claude_agent_sdk/_internal/message_parser.py261 uuid=data["uuid"],COMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py261 # spawn) or an extensionless wrapper script from a git-bash /COMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py361COMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py381 # simulation lands on some other name. Refusing whenever ANYCOMMENT
Dead Code5 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_query.py1107CODE
MEDIUMtests/test_query.py1114CODE
MEDIUMtests/test_session_resume.py919CODE
MEDIUMtests/test_client.py353CODE
MEDIUMsrc/claude_agent_sdk/client.py95CODE
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
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
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippetContext
LOWscripts/test-docker.sh5# Usage:COMMENT
LOWscripts/gh.sh7# Usage:COMMENT
AI Structural Patterns3 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/test_sessions.py53CODE
LOWsrc/claude_agent_sdk/__init__.py210CODE
LOWsrc/claude_agent_sdk/_internal/query.py113CODE