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).
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.
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.
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.
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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 131 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 133 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 236 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 238 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 338 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 340 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 375 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 377 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 446 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 448 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 481 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_example_s3_session_store.py | 483 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_example_s3_session_store.py | 50 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_example_s3_session_store.py | 52 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_example_s3_session_store.py | 96 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_example_s3_session_store.py | 98 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_example_s3_session_store.py | 509 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_example_s3_session_store.py | 511 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_example_s3_session_store.py | 579 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_example_s3_session_store.py | 581 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 68 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 70 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 114 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 116 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 267 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 269 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 465 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 467 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 599 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_mutations.py | 601 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_session_mutations.py | 25 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_session_mutations.py | 27 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_session_mutations.py | 534 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_session_mutations.py | 536 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 126 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 128 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 247 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 249 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 1132 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 1134 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 1598 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 1600 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 38 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 40 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 640 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 642 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 675 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 677 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 1486 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 1488 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 1623 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 1625 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 1716 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_sessions.py | 1718 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_store_conformance.py | 27 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_store_conformance.py | 29 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_store_conformance.py | 138 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_session_store_conformance.py | 140 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_mcp_large_output.py | 96 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tests/test_mcp_large_output.py | 98 | # --------------------------------------------------------------------------- | COMMENT |
| 164 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_task_compat.py | 10 | def test_spawn_and_wait_asyncio(self): | CODE |
| LOW | tests/test_task_compat.py | 68 | def test_done_callback_asyncio(self): | CODE |
| LOW | tests/test_task_compat.py | 99 | def test_exception_propagates_via_wait_asyncio(self): | CODE |
| LOW | tests/test_task_compat.py | 110 | def test_exception_propagates_via_wait_trio(self): | CODE |
| LOW | tests/test_task_compat.py | 121 | def test_unhandled_exception_logged_under_trio(self, caplog): | CODE |
| LOW⚡ | tests/test_task_compat.py | 179 | def test_contextvar_propagates_asyncio(self): | CODE |
| LOW⚡ | tests/test_task_compat.py | 182 | def test_contextvar_propagates_trio(self): | CODE |
| LOW⚡ | tests/test_task_compat.py | 187 | def test_cancel_from_different_task_trio(self): | CODE |
| LOW | tests/test_changelog.py | 12 | def test_changelog_starts_with_header(self): | CODE |
| LOW | tests/test_changelog.py | 18 | def test_changelog_has_valid_version_format(self): | CODE |
| LOW | tests/test_changelog.py | 34 | def test_changelog_has_bullet_points(self): | CODE |
| LOW | tests/test_changelog.py | 63 | def test_changelog_versions_in_descending_order(self): | CODE |
| LOW | tests/test_changelog.py | 79 | def test_changelog_no_empty_bullet_points(self): | CODE |
| LOW | tests/test_streaming_client.py | 48 | async def control_protocol_generator(): | CODE |
| LOW | tests/test_streaming_client.py | 110 | def _create_mock_transport_with_control_responses(): | CODE |
| LOW | tests/test_streaming_client.py | 130 | async def control_protocol_generator(): | CODE |
| LOW | tests/test_streaming_client.py | 162 | async def test_auto_connect_with_context_manager(self): | CODE |
| LOW | tests/test_streaming_client.py | 180 | async def test_manual_connect_disconnect(self): | CODE |
| LOW | tests/test_streaming_client.py | 202 | async def test_connect_with_string_prompt(self): | CODE |
| LOW | tests/test_streaming_client.py | 227 | async def test_connect_with_async_iterable(self): | CODE |
| LOW | tests/test_streaming_client.py | 285 | async def test_send_message_with_session_id(self): | CODE |
| LOW | tests/test_streaming_client.py | 312 | async def test_send_message_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 493 | async def test_interrupt_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 501 | async def test_reconnect_mcp_server(self): | CODE |
| LOW | tests/test_streaming_client.py | 533 | async def test_reconnect_mcp_server_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 574 | async def test_toggle_mcp_server_enabled_true(self): | CODE |
| LOW | tests/test_streaming_client.py | 605 | async def test_toggle_mcp_server_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 644 | async def test_stop_task_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 713 | async def control_protocol_generator(): | CODE |
| LOW | tests/test_streaming_client.py | 786 | async def test_get_mcp_status_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 841 | async def control_protocol_generator(): | CODE |
| LOW | tests/test_streaming_client.py | 892 | async def test_get_context_usage_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 923 | async def test_concurrent_send_receive(self): | CODE |
| LOW | tests/test_streaming_client.py | 1003 | async def test_query_with_async_iterable(self): | CODE |
| LOW | tests/test_streaming_client.py | 1105 | async def test_receive_messages_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 1114 | async def test_receive_response_not_connected(self): | CODE |
| LOW | tests/test_streaming_client.py | 1144 | async def test_disconnect_without_connect(self): | CODE |
| LOW | tests/test_streaming_client.py | 1152 | async def test_context_manager_with_exception(self): | CODE |
| LOW | tests/test_streaming_client.py | 1169 | async def test_receive_response_list_comprehension(self): | CODE |
| LOW⚡ | tests/test_example_s3_session_store.py | 137 | async def test_append_part_name_format_and_sortable() -> None: | CODE |
| LOW⚡ | tests/test_example_s3_session_store.py | 242 | async def test_load_null_when_empty(s3_client: Any) -> None: | CODE |
| LOW⚡ | tests/test_example_s3_session_store.py | 248 | async def test_load_sorts_and_concatenates() -> None: | CODE |
| LOW⚡ | tests/test_example_s3_session_store.py | 328 | async def test_load_skips_malformed_lines() -> None: | CODE |
| LOW⚡ | tests/test_example_s3_session_store.py | 344 | async def test_list_sessions_extracts_mtime() -> None: | CODE |
| LOW⚡ | tests/test_example_s3_session_store.py | 381 | async def test_delete_batch_deletes_parts() -> None: | CODE |
| LOW⚡ | tests/test_example_s3_session_store.py | 452 | async def test_list_subkeys_extracts_unique_subpaths() -> None: | CODE |
| LOW⚡ | tests/test_example_s3_session_store.py | 488 | async def test_prefix_normalization(raw_prefix: str) -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 115 | async def test_conformance_with_options_dataclass(s3_client: Any) -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 163 | async def test_append_two_instances_distinct_part_names() -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 178 | async def test_append_jsonl_serialization() -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 190 | async def test_append_same_ms_preserves_order(monkeypatch: pytest.MonkeyPatch) -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 213 | async def test_append_empty_is_noop() -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 223 | async def test_append_includes_subpath() -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 294 | async def test_load_excludes_subpath_parts() -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 361 | async def test_list_sessions_ignores_subagent_parts() -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 399 | async def test_delete_subpath_direct_only(s3_client: Any) -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 415 | async def test_delete_cascades_without_subpath(s3_client: Any) -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 430 | async def test_delete_surfaces_errors() -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 465 | async def test_list_subkeys_filters_traversal_segments() -> None: | CODE |
| LOW | tests/test_example_s3_session_store.py | 529 | async def test_materialize_round_trip( | CODE |
| 696 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_example_redis_session_store_live.py | 14 | CODE | |
| LOW | tests/test_example_s3_session_store.py | 9 | CODE | |
| LOW | tests/test_session_mutations.py | 3 | CODE | |
| LOW | tests/test_sessions.py | 3 | CODE | |
| LOW | tests/test_session_store_conformance.py | 8 | CODE | |
| LOW | tests/test_example_redis_session_store.py | 12 | CODE | |
| LOW | tests/test_session_store_anyio.py | 8 | CODE | |
| LOW | tests/test_session_summary.py | 8 | CODE | |
| LOW | tests/test_session_resume.py | 3 | CODE | |
| LOW | tests/test_session_helpers_store.py | 8 | CODE | |
| LOW | tests/test_example_s3_session_store_live.py | 12 | CODE | |
| LOW | tests/test_example_postgres_session_store.py | 14 | CODE | |
| LOW | tests/test_session_import.py | 3 | CODE | |
| LOW | tests/test_transcript_mirror.py | 6 | CODE | |
| LOW | tests/test_types.py | 441 | CODE | |
| LOW | tests/test_types.py | 441 | CODE | |
| LOW | tests/test_types.py | 441 | CODE | |
| LOW | tests/test_types.py | 441 | CODE | |
| LOW | tests/test_types.py | 441 | CODE | |
| LOW | examples/hooks.py | 16 | CODE | |
| LOW | examples/include_partial_messages.py | 18 | CODE | |
| LOW | examples/include_partial_messages.py | 18 | CODE | |
| LOW | examples/include_partial_messages.py | 18 | CODE | |
| LOW | examples/include_partial_messages.py | 18 | CODE | |
| LOW | examples/include_partial_messages.py | 18 | CODE | |
| LOW | examples/session_stores/postgres_session_store.py | 65 | CODE | |
| LOW | examples/session_stores/redis_session_store.py | 50 | CODE | |
| LOW | examples/session_stores/s3_session_store.py | 45 | CODE | |
| LOW | scripts/check_pypi_quota.py | 10 | CODE | |
| LOW | scripts/build_wheel.py | 27 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 21 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 21 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 21 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 21 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 21 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 28 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 29 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 40 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 40 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 41 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 42 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 54 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 55 | CODE | |
| 106 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_task_compat.py | 205 | except Exception as e: # pragma: no cover - failure path | CODE |
| MEDIUM | tests/test_task_compat.py | 201 | def cancel_in_other_task(): | CODE |
| LOW | tests/test_transport.py | 1684 | except Exception as e: | CODE |
| LOW | tests/test_transport.py | 1752 | except Exception as e: | CODE |
| MEDIUM | tests/test_query.py | 665 | def close_in_other_task(): | CODE |
| LOW | tests/test_query.py | 574 | except Exception as e: | CODE |
| LOW | tests/test_query.py | 668 | except Exception as e: | CODE |
| LOW | e2e-tests/test_dynamic_control.py | 91 | except Exception as e: | CODE |
| LOW⚡ | examples/streaming_mode_ipython.py | 163 | except Exception as e: | CODE |
| MEDIUM⚡ | examples/streaming_mode_ipython.py | 164 | print(f"Error: {e}") | CODE |
| MEDIUM | examples/setting_sources.py | 193 | print(f"Error: Unknown example '{example_name}'") | CODE |
| MEDIUM | examples/hooks.py | 339 | print(f"Error: Unknown example '{example_name}'") | CODE |
| MEDIUM | examples/stderr_callback_example.py | 19 | print(f"Error detected: {message}") | CODE |
| LOW | examples/streaming_mode.py | 407 | except Exception as e: | CODE |
| LOW | examples/streaming_mode.py | 465 | except Exception as e: | CODE |
| MEDIUM | examples/streaming_mode.py | 510 | print(f"Error: Unknown example '{example_name}'") | CODE |
| MEDIUM | scripts/download_cli.py | 106 | print(f"Error downloading CLI after 3 attempts: {last_err}", file=sys.stderr) | CODE |
| MEDIUM | scripts/download_cli.py | 125 | print("Error: Could not find installed Claude CLI binary", file=sys.stderr) | CODE |
| MEDIUM | scripts/build_wheel.py | 52 | print(f"Error: {description} failed", file=sys.stderr) | CODE |
| LOW | scripts/build_wheel.py | 266 | except Exception as e: | CODE |
| LOW | .github/workflows/build-and-publish.yml | 118 | except Exception as exc: | CODE |
| LOW | src/claude_agent_sdk/_internal/session_resume.py | 304 | except Exception as e: # noqa: BLE001 - surface adapter failures with context | CODE |
| LOW | src/claude_agent_sdk/_internal/session_resume.py | 411 | except Exception: | CODE |
| LOW | src/claude_agent_sdk/_internal/session_resume.py | 429 | except Exception: | CODE |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 591 | except Exception: | CODE |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 795 | except Exception: | CODE |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 868 | except Exception: | CODE |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 1164 | except Exception: | CODE |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 1548 | except Exception as e: # noqa: BLE001 - adapter is user code | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 169 | except Exception as e: # pragma: no cover - buffer-full edge case | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 328 | except Exception as e: | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 489 | except Exception as e: | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 716 | except Exception as e: | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 842 | except Exception as e: | CODE |
| LOW | …laude_agent_sdk/_internal/transcript_mirror_batcher.py | 110 | except Exception as e: # pragma: no cover - defensive | CODE |
| LOW | …laude_agent_sdk/_internal/transcript_mirror_batcher.py | 131 | except Exception as e: # pragma: no cover - defensive | CODE |
| LOW | …laude_agent_sdk/_internal/transcript_mirror_batcher.py | 143 | except Exception as cb_err: # pragma: no cover - defensive | CODE |
| LOW | …laude_agent_sdk/_internal/transcript_mirror_batcher.py | 203 | except Exception as e: # noqa: BLE001 - adapter is user code | CODE |
| LOW | src/claude_agent_sdk/_internal/session_mutations.py | 535 | except Exception: | CODE |
| LOW | src/claude_agent_sdk/_internal/session_mutations.py | 649 | except Exception: | CODE |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 522 | except Exception: # noqa: BLE001 - best-effort tracing must never break connect() | CODE |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 574 | except Exception as e: | CODE |
| LOW⚡ | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 596 | except Exception: | CODE |
| LOW⚡ | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 613 | except Exception: | CODE |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 744 | except Exception as e: | CODE |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 814 | except Exception: | CODE |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 860 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_streaming_client.py | 1010 | # Create a simple test script that validates stdin and outputs a result | COMMENT |
| MEDIUM | tests/test_streaming_client.py | 1129 | # Create a new mock transport for each call | COMMENT |
| MEDIUM⚡ | tests/test_sessions.py | 447 | # Create a non-UUID .jsonl file | COMMENT |
| MEDIUM | tests/test_sessions.py | 526 | # Create a real directory so realpath works | COMMENT |
| MEDIUM | tests/test_sdk_mcp_integration.py | 198 | # Create an SDK server | COMMENT |
| MEDIUM | tests/test_sdk_mcp_integration.py | 257 | # Create a tool that returns both text and image content | COMMENT |
| MEDIUM | tests/test_transport.py | 1658 | # Create a real subprocess that consumes stdin (cross-platform) | COMMENT |
| MEDIUM | tests/test_transport.py | 1712 | # Create a real subprocess that consumes stdin (cross-platform) | COMMENT |
| MEDIUM | tests/test_transport.py | 1980 | # Create a large agent definition (50KB prompt) | COMMENT |
| MEDIUM | e2e-tests/test_structured_output.py | 72 | # Define a schema with nested structure | COMMENT |
| MEDIUM | e2e-tests/test_agents_and_settings.py | 158 | # Create a temporary project with a filesystem agent | COMMENT |
| MEDIUM | e2e-tests/test_agents_and_settings.py | 163 | # Create a test agent file | COMMENT |
| MEDIUM | e2e-tests/test_agents_and_settings.py | 218 | # Create a temporary project with local settings | COMMENT |
| MEDIUM | e2e-tests/test_agents_and_settings.py | 254 | # Create a temporary project with a slash command | COMMENT |
| MEDIUM | e2e-tests/test_agents_and_settings.py | 296 | # Create a temporary project with local settings | COMMENT |
| MEDIUM | examples/streaming_mode_ipython.py | 101 | # Create a background task to consume messages | COMMENT |
| MEDIUM | examples/mcp_calculator.py | 142 | # Create the calculator server with all tools | COMMENT |
| MEDIUM | examples/streaming_mode.py | 145 | # Create a background task to consume messages | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_changelog.py | 34 | CODE | |
| LOW | tests/test_streaming_client.py | 26 | CODE | |
| LOW | tests/test_streaming_client.py | 110 | CODE | |
| LOW | tests/test_streaming_client.py | 48 | CODE | |
| LOW | tests/test_streaming_client.py | 130 | CODE | |
| LOW | tests/test_streaming_client.py | 253 | CODE | |
| LOW | tests/test_streaming_client.py | 285 | CODE | |
| LOW | tests/test_streaming_client.py | 320 | CODE | |
| LOW | tests/test_streaming_client.py | 386 | CODE | |
| LOW | tests/test_streaming_client.py | 463 | CODE | |
| LOW | tests/test_streaming_client.py | 501 | CODE | |
| LOW | tests/test_streaming_client.py | 541 | CODE | |
| LOW | tests/test_streaming_client.py | 574 | CODE | |
| LOW | tests/test_streaming_client.py | 613 | CODE | |
| LOW | tests/test_streaming_client.py | 652 | CODE | |
| LOW | tests/test_streaming_client.py | 794 | CODE | |
| LOW | tests/test_streaming_client.py | 923 | CODE | |
| LOW | tests/test_streaming_client.py | 1169 | CODE | |
| LOW | tests/test_streaming_client.py | 713 | CODE | |
| LOW | tests/test_streaming_client.py | 841 | CODE | |
| LOW | tests/test_streaming_client.py | 933 | CODE | |
| LOW | tests/test_streaming_client.py | 1179 | CODE | |
| LOW | tests/test_option_warnings.py | 303 | CODE | |
| LOW | tests/test_option_warnings.py | 318 | CODE | |
| LOW | examples/mcp_calculator.py | 100 | CODE | |
| LOW | examples/filesystem_agents.py | 28 | CODE | |
| LOW | examples/filesystem_agents.py | 43 | CODE | |
| LOW | examples/tools_option.py | 16 | CODE | |
| LOW | examples/tools_option.py | 45 | CODE | |
| LOW | examples/tools_option.py | 74 | CODE | |
| LOW | examples/streaming_mode_trio.py | 23 | CODE | |
| LOW | examples/streaming_mode.py | 36 | CODE | |
| LOW | examples/streaming_mode.py | 176 | CODE | |
| LOW | examples/streaming_mode.py | 301 | CODE | |
| LOW | examples/streaming_mode.py | 347 | CODE | |
| LOW | examples/streaming_mode.py | 427 | CODE | |
| LOW | examples/session_stores/s3_session_store.py | 344 | CODE | |
| LOW | scripts/build_wheel.py | 114 | CODE | |
| LOW | scripts/build_wheel.py | 199 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 311 | CODE | |
| LOW | src/claude_agent_sdk/__init__.py | 456 | CODE | |
| LOW | src/claude_agent_sdk/types.py | 139 | CODE | |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 229 | CODE | |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 259 | CODE | |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 739 | CODE | |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 844 | CODE | |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 1134 | CODE | |
| LOW | src/claude_agent_sdk/_internal/sessions.py | 1578 | CODE | |
| LOW | src/claude_agent_sdk/_internal/session_summary.py | 51 | CODE | |
| LOW | src/claude_agent_sdk/_internal/query.py | 172 | CODE | |
| LOW | src/claude_agent_sdk/_internal/query.py | 247 | CODE | |
| LOW | src/claude_agent_sdk/_internal/query.py | 375 | CODE | |
| LOW | src/claude_agent_sdk/_internal/query.py | 548 | CODE | |
| LOW | src/claude_agent_sdk/_internal/message_parser.py | 35 | CODE | |
| LOW | …laude_agent_sdk/_internal/transcript_mirror_batcher.py | 149 | CODE | |
| LOW | src/claude_agent_sdk/_internal/session_mutations.py | 504 | CODE | |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 190 | CODE | |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 282 | CODE | |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 473 | CODE | |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 624 | CODE | |
| 1 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/claude_agent_sdk/__init__.py | 176 | Decorator for defining MCP tools with type safety. Creates a tool that can be used with SDK MCP servers. The tool r | STRING |
| HIGH | src/claude_agent_sdk/__init__.py | 314 | Create an in-process MCP server that runs within your Python application. Unlike external MCP servers that run as s | STRING |
| HIGH | src/claude_agent_sdk/_internal/sessions.py | 1584 | List sessions from a :class:`SessionStore`. Async, store-backed counterpart to :func:`list_sessions`. Loads each | STRING |
| HIGH | src/claude_agent_sdk/_internal/sessions.py | 1807 | List subagent IDs for a session from a :class:`SessionStore`. Async, store-backed counterpart to :func:`list_subage | STRING |
| HIGH | src/claude_agent_sdk/_internal/message_parser.py | 36 | Parse message from CLI output into typed Message objects. Args: data: Raw message dictionary from CLI | STRING |
| HIGH | src/claude_agent_sdk/_internal/session_mutations.py | 246 | Fork a session into a new branch with fresh UUIDs. Copies transcript messages from the source session into a new se | STRING |
| HIGH | src/claude_agent_sdk/_internal/session_mutations.py | 892 | Fork a session into a new branch with fresh UUIDs via a :class:`SessionStore`. Async, store-backed counterpart to : | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/hooks.py | 32 | logger = logging.getLogger(__name__) | CODE |
| LOW | scripts/update_version.py | 9 | def update_version(new_version: str) -> None: | CODE |
| LOW | scripts/update_cli_version.py | 9 | def update_cli_version(new_version: str) -> None: | CODE |
| LOW | scripts/build_wheel.py | 57 | def update_version(version: str) -> None: | CODE |
| LOW | src/claude_agent_sdk/client.py | 323 | async def set_permission_mode(self, mode: PermissionMode) -> None: | CODE |
| LOW | src/claude_agent_sdk/client.py | 350 | async def set_model(self, model: str | None = None) -> None: | CODE |
| LOW | src/claude_agent_sdk/__init__.py | 154 | logger = logging.getLogger(__name__) | CODE |
| LOW | src/claude_agent_sdk/__init__.py | 527 | __all__ = [ | CODE |
| LOW | src/claude_agent_sdk/_internal/session_resume.py | 44 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | src/claude_agent_sdk/_internal/sessions.py | 26 | logger = logging.getLogger(__name__) | CODE |
| LOW | src/claude_agent_sdk/_internal/session_summary.py | 25 | __all__ = ["fold_session_summary", "summary_entry_to_sdk_info"] | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 39 | logger = logging.getLogger(__name__) | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 142 | def set_transcript_mirror_batcher(self, batcher: "TranscriptMirrorBatcher") -> None: | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 735 | async def set_permission_mode(self, mode: PermissionMode) -> None: | CODE |
| LOW | src/claude_agent_sdk/_internal/query.py | 744 | async def set_model(self, model: str | None) -> None: | CODE |
| LOW | src/claude_agent_sdk/_internal/session_import.py | 25 | __all__ = ["import_session_to_store"] | CODE |
| LOW | src/claude_agent_sdk/_internal/_task_compat.py | 28 | logger = logging.getLogger(__name__) | CODE |
| LOW | src/claude_agent_sdk/_internal/message_parser.py | 32 | logger = logging.getLogger(__name__) | CODE |
| LOW | …laude_agent_sdk/_internal/transcript_mirror_batcher.py | 25 | logger = logging.getLogger(__name__) | CODE |
| LOW | src/claude_agent_sdk/_internal/session_store.py | 20 | __all__ = [ | CODE |
| LOW | src/claude_agent_sdk/_internal/transport/__init__.py | 87 | __all__ = ["Transport"] | CODE |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 28 | logger = logging.getLogger(__name__) | CODE |
| LOW | src/claude_agent_sdk/testing/__init__.py | 9 | __all__ = ["run_session_store_conformance"] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_example_redis_session_store_live.py | 102 | # The harness calls make_store() once per contract for isolation. Give | COMMENT |
| LOW | tests/test_streaming_client.py | 1080 | # On Unix, just use the script directly | STRING |
| MEDIUM⚡ | tests/test_example_redis_session_store.py | 81 | # Conformance harness | COMMENT |
| MEDIUM⚡ | tests/test_example_postgres_session_store.py | 119 | # Conformance harness | COMMENT |
| MEDIUM⚡ | tests/test_example_postgres_session_store.py | 126 | # The harness calls make_store() once per contract for isolation. Give | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | examples/setting_sources.py | 0 | run all examples or a specific example based on command line argument. | STRING |
| HIGH | examples/hooks.py | 0 | run all examples or a specific example based on command line argument. | STRING |
| HIGH | examples/streaming_mode.py | 0 | run all examples or a specific example based on command line argument. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_streaming_client.py | 54 | # Check if initialization was requested | COMMENT |
| LOW | tests/test_sessions.py | 1377 | # Set mtime to Feb 2026 (well after the Jan timestamp) | COMMENT |
| LOW | e2e-tests/test_sdk_mcp_tools.py | 48 | # Check if the actual Python function was called | COMMENT |
| LOW | examples/streaming_mode_ipython.py | 113 | # Check if we got a result after interrupt | COMMENT |
| LOW | examples/max_budget_usd.py | 71 | # Check if budget was exceeded | COMMENT |
| LOW | scripts/build_wheel.py | 206 | # Check if we have a bundled CLI - if so, retag the wheel as platform-specific | COMMENT |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 214 | # Check if settings is a JSON string or a file path | COMMENT |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 224 | # Read the file | COMMENT |
| LOW | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 564 | # Check if the error comes from the working directory or the CLI | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH⚡ | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 605 | for line in framer.push(chunk): | CODE |
| HIGH | …claude_agent_sdk/_internal/transport/subprocess_cli.py | 784 | for line in framer.push(chunk): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/claude_agent_sdk/_internal/sessions.py | 441 | # User-set title (customTitle) wins over AI-generated title (aiTitle). | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_session_resume.py | 732 | CODE | |
| MEDIUM | tests/test_client.py | 353 | CODE | |
| MEDIUM | src/claude_agent_sdk/client.py | 114 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | examples/streaming_mode_ipython.py | 82 | # Don't forget to disconnect when done | COMMENT |
| MEDIUM | examples/plugin_example.py | 28 | # In production, you can use any path to your plugin directory | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | e2e-tests/README.md | 14 | export ANTHROPIC_API_KEY="your-api-key-here" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | e2e-tests/test_stderr_callback.py | 21 | # and since CLI 2.1.193 the CLI refuses to honor project-scoped grants from | COMMENT |
| LOW | scripts/test-docker.sh | 1 | #!/bin/bash | COMMENT |
| LOW | .github/workflows/claude-code-review.yml | 61 | # - For test files: Coverage, edge cases, and test quality | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/test-docker.sh | 5 | # Usage: | COMMENT |
| LOW | scripts/gh.sh | 7 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_sessions.py | 53 | CODE |