AI Slop Code RIsk Monitor

anthropics/claude-agent-sdk-python

42.1 High pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for anthropics/claude-agent-sdk-python, a Python project with 8,247 GitHub stars. SynthScan examined 52,715 lines of code across 149 source files, recording 1697 pattern matches distributed across 20 syntactic categories. The legacy adjusted pattern signal is 42.1 (High pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

42.1
Adjusted Signal
42.1
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
8.2K
Stars
Python
Language
52.7K
Lines of Code
149
Files
1.7K
Pattern Hits
2026-10-12
Scan Date
0.29
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 61.9/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 1153 finding(s).

Hallucinated Dependency & Supply Chain Risk 12.8/100 · LOW

Are imports declared and package/API names verified? 204 finding(s).

Agent Over-Engineering Ratio 83.2/100 · CRITICAL

Are wrappers, guards, and repeated structures necessary? 1369 finding(s).

PR Review Velocity Impact 90.1/100 · CRITICAL

Which changes need focused human review? 1697 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 43MEDIUM 264LOW 1390

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 1697 distinct pattern matches across 20 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers1026 hits · 820 pts
SeverityFileLineSnippetContext
LOWtests/test_task_compat.py10 def test_spawn_and_wait_asyncio(self):CODE
LOW⚡tests/test_task_compat.py104 def test_cancelled_waiter_asyncio(self):CODE
LOW⚡tests/test_task_compat.py107 def test_cancelled_waiter_trio(self):CODE
LOW⚡tests/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
LOW⚡tests/test_task_compat.py223 def test_contextvar_propagates_asyncio(self):CODE
LOW⚡tests/test_task_compat.py226 def test_contextvar_propagates_trio(self):CODE
LOW⚡tests/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
LOW⚡tests/test_example_s3_session_store.py137async def test_append_part_name_format_and_sortable() -> None:CODE
LOW⚡tests/test_example_s3_session_store.py242async def test_load_null_when_empty(s3_client: Any) -> None:CODE
LOW⚡tests/test_example_s3_session_store.py248async def test_load_sorts_and_concatenates() -> None:CODE
LOW⚡tests/test_example_s3_session_store.py328async def test_load_skips_malformed_lines() -> None:CODE
LOW⚡tests/test_example_s3_session_store.py344async def test_list_sessions_extracts_mtime() -> None:CODE
LOW⚡tests/test_example_s3_session_store.py381async def test_delete_batch_deletes_parts() -> None:CODE
LOW⚡tests/test_example_s3_session_store.py452async def test_list_subkeys_extracts_unique_subpaths() -> None:CODE
LOW⚡tests/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
966 more matches not shown…
Decorative Section Separators224 hits · 809 pts
SeverityFileLineSnippetContext
MEDIUM⚡tests/test_example_s3_session_store.py131# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py133# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py236# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py238# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py338# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py340# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py375# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py377# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py446# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py448# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_example_s3_session_store.py481# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/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
MEDIUM⚡tests/test_session_mutations.py68# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_mutations.py70# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_mutations.py114# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_mutations.py116# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_mutations.py267# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_mutations.py269# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_mutations.py465# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_mutations.py467# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_mutations.py599# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/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
MEDIUM⚡tests/test_sessions.py126# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_sessions.py128# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_sessions.py247# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_sessions.py249# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_sessions.py1145# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_sessions.py1147# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_sessions.py1611# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/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
MEDIUM⚡tests/test_session_store_conformance.py27# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_store_conformance.py29# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_store_conformance.py138# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_session_store_conformance.py140# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_mcp_large_output.py96# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_mcp_large_output.py98# ---------------------------------------------------------------------------COMMENT
164 more matches not shown…
Empty Error Handlers27 hits · 135 pts
SeverityFileLineSnippetContext
HIGHtests/test_streaming_client.py73except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py150except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py99except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py309except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py336except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py381except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py447except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py517except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py557except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py598except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py629except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py668except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py772except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py900except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py986except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_streaming_client.py1232except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHtests/test_option_warnings.py336except (json.JSONDecodeError, KeyError, AttributeError):CODE
HIGHsrc/claude_agent_sdk/_internal/session_resume.py449except (json.JSONDecodeError, ValueError):CODE
HIGHsrc/claude_agent_sdk/_internal/sessions.py182except OSError:CODE
HIGHsrc/claude_agent_sdk/_internal/sessions.py497except ValueError:CODE
HIGHsrc/claude_agent_sdk/_internal/sessions.py1154except OSError:CODE
HIGHsrc/claude_agent_sdk/_internal/sessions.py1733except NotImplementedError:CODE
HIGHsrc/claude_agent_sdk/_internal/sessions.py1581except ValueError:CODE
HIGHsrc/claude_agent_sdk/_internal/session_mutations.py521except OSError:CODE
HIGH…claude_agent_sdk/_internal/transport/subprocess_cli.py949except anyio.ClosedResourceError:CODE
HIGH…claude_agent_sdk/_internal/transport/subprocess_cli.py1129except anyio.ClosedResourceError:CODE
HIGH…claude_agent_sdk/_internal/transport/subprocess_cli.py1217except Exception:CODE
Unused Imports200 hits · 122 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.py776CODE
LOWtests/test_types.py776CODE
LOWtests/test_types.py776CODE
LOWtests/test_types.py776CODE
LOWtests/test_types.py776CODE
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.py39CODE
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
140 more matches not shown…
Excessive Try-Catch Wrapping57 hits · 68 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.py2042 except Exception as e:CODE
LOWtests/test_transport.py2110 except Exception as e:CODE
MEDIUMtests/test_query.py1893def close_in_other_task():CODE
LOWtests/test_query.py1802 except Exception as e:CODE
LOWtests/test_query.py1896 except Exception as e:CODE
LOWe2e-tests/test_dynamic_control.py92 except Exception as e:CODE
LOWe2e-tests/test_run_end.py148 except Exception as e: # noqa: BLE001 - re-raised below unless skippedCODE
LOW⚡examples/streaming_mode_ipython.py163except Exception as e:CODE
MEDIUM⚡examples/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.py64 print(f"Error: {description} failed", file=sys.stderr)CODE
MEDIUMscripts/build_wheel.py258 print(f"Error: cannot recompress the wheel: {reason}", file=sys.stderr)CODE
LOWscripts/build_wheel.py537 except Exception as e:CODE
LOW.github/workflows/build-and-publish.yml169 except Exception as exc:CODE
LOWsrc/claude_agent_sdk/__init__.py640 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.py306 except Exception as e: # pragma: no cover - buffer-full edge caseCODE
LOWsrc/claude_agent_sdk/_internal/query.py512 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py694 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py777 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py1117 except Exception as e:CODE
LOWsrc/claude_agent_sdk/_internal/query.py1132 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.py934 except Exception:CODE
LOW⚡…claude_agent_sdk/_internal/transport/subprocess_cli.py951 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py850 except Exception: # noqa: BLE001 - best-effort tracing must never break connect()CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py912 except Exception as e:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py1082 except Exception as e:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py1152 except Exception:CODE
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py1217 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
MEDIUM⚡tests/test_sessions.py447 # Create a non-UUID .jsonl fileCOMMENT
MEDIUMtests/test_sessions.py526 # Create a real directory so realpath worksCOMMENT
MEDIUMtests/test_transport.py2016 # Create a real subprocess that consumes stdin (cross-platform)COMMENT
MEDIUMtests/test_transport.py2070 # Create a real subprocess that consumes stdin (cross-platform)COMMENT
MEDIUMtests/test_transport.py2338 # 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 Nesting65 hits · 45 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.py157CODE
LOWscripts/build_wheel.py316CODE
LOWscripts/build_wheel.py466CODE
LOW.github/scripts/check_workflow_hardening.py233CODE
LOWsrc/claude_agent_sdk/__init__.py477CODE
LOWsrc/claude_agent_sdk/types.py163CODE
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.py309CODE
LOWsrc/claude_agent_sdk/_internal/query.py388CODE
LOWsrc/claude_agent_sdk/_internal/query.py577CODE
LOWsrc/claude_agent_sdk/_internal/query.py870CODE
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
5 more matches not shown…
Docstring Block Structure8 hits · 40 pts
SeverityFileLineSnippetContext
HIGHsrc/claude_agent_sdk/query.py17 Query Claude Code for one-shot or unidirectional streaming interactions. This function is ideal for simple, stSTRING
HIGHsrc/claude_agent_sdk/__init__.py283Decorator 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__.py520Create 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.py69def update_version(version: str) -> None:CODE
LOWsrc/claude_agent_sdk/client.py314 async def set_permission_mode(self, mode: PermissionMode) -> None:CODE
LOWsrc/claude_agent_sdk/client.py341 async def set_model(self, model: str | None = None) -> None:CODE
LOWsrc/claude_agent_sdk/__init__.py198logger = logging.getLogger(__name__)CODE
LOWsrc/claude_agent_sdk/__init__.py648__all__ = [CODE
LOWsrc/claude_agent_sdk/_internal/session_resume.py51logger = logging.getLogger(__name__)CODE
LOW⚡src/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.py278 def set_transcript_mirror_batcher(self, batcher: "TranscriptMirrorBatcher") -> None:CODE
LOWsrc/claude_agent_sdk/_internal/query.py796 async def set_permission_mode(self, mode: PermissionMode) -> None:CODE
LOWsrc/claude_agent_sdk/_internal/query.py805 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.py34logger = 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.py943 for line in framer.push(chunk):CODE
HIGH…claude_agent_sdk/_internal/transport/subprocess_cli.py1122 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
MEDIUM⚡tests/test_example_redis_session_store.py81# Conformance harnessCOMMENT
MEDIUM⚡tests/test_example_postgres_session_store.py119# Conformance harnessCOMMENT
MEDIUM⚡tests/test_example_postgres_session_store.py126 # The harness calls make_store() once per contract for isolation. GiveCOMMENT
Over-Commented Block16 hits · 16 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/egress-firewall.yaml1# Hosts that jobs on GitHub's egress-firewall runner (runs-on: ubuntu-24.04-firewall)COMMENT
LOW.github/workflows/claude-code-review.yml61 # Review this PR focusing on:COMMENT
LOW.github/workflows/claude.yml61COMMENT
LOW.github/scripts/run-e2e-firewalled-macos.sh1#!/usr/bin/env bashCOMMENT
LOWsrc/claude_agent_sdk/client.py101 # Auto-connect with empty async iterable if no prompt is providedCOMMENT
LOWsrc/claude_agent_sdk/types.py1301 "MessageOrigin",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.py241 # takes up after the run ended swaps in a fresh event (_reopen_run).COMMENT
LOWsrc/claude_agent_sdk/_internal/query.py261 self._run_final = FalseCOMMENT
LOWsrc/claude_agent_sdk/_internal/query.py541 # CLI reports an error result during startup (e.g. a refusedCOMMENT
LOWsrc/claude_agent_sdk/_internal/message_parser.py261 uuid=data["uuid"],COMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py41# Asks the CLI for `session_state_changed` frames marked `sdk_host_only`, whichCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py261COMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py381 # Classify EVERY path component, not only the final one. Win32 opensCOMMENT
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.py473 # Check if we have a bundled CLI - if so, retag the wheel as platform-specificCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py497 # Check if settings is a JSON string or a file pathCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py507 # Read the fileCOMMENT
LOW…claude_agent_sdk/_internal/transport/subprocess_cli.py902 # Check if the error comes from the working directory or the CLICOMMENT
Dead Code5 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_query.py1741CODE
MEDIUMtests/test_query.py1748CODE
MEDIUMtests/test_session_resume.py919CODE
MEDIUMtests/test_client.py451CODE
MEDIUMsrc/claude_agent_sdk/client.py107CODE
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
LOW⚡examples/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__.py236CODE
LOWsrc/claude_agent_sdk/_internal/query.py157CODE