Autonomous AI development loop for Claude Code with intelligent exit detection
This report presents the forensic synthetic code analysis of frankbria/ralph-claude-code, a Shell project with 9,535 GitHub stars. SynthScan v2.0 examined 30,648 lines of code across 84 source files, recording 227 pattern matches distributed across 12 syntactic categories. The overall adjusted score of 14.7 places this repository in the Low 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 227 distinct pattern matches across 12 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 | ralph_enable.sh | 36 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 38 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 53 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 55 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 113 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 115 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 185 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 187 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 266 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 268 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 349 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 351 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 403 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 405 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 477 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 479 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 552 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable.sh | 554 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_import.sh | 65 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_import.sh | 67 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_import.sh | 248 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_import.sh | 250 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_loop.sh | 1018 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_loop.sh | 1020 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_loop.sh | 1337 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_loop.sh | 1339 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 44 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 46 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 63 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 65 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 126 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 128 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 223 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 225 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 278 | # ============================================================================= | COMMENT |
| MEDIUM | ralph_enable_ci.sh | 280 | # ============================================================================= | COMMENT |
| MEDIUM | tests/helpers/fixtures.bash | 389 | # ============================================================================= | COMMENT |
| MEDIUM | tests/helpers/fixtures.bash | 391 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 6 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 8 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 141 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 143 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 291 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 293 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 400 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 402 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 514 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 516 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 595 | # ============================================================================= | COMMENT |
| MEDIUM | lib/task_sources.sh | 597 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 14 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 16 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 161 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 163 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 369 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 371 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 462 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 464 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 495 | # ============================================================================= | COMMENT |
| MEDIUM | lib/wizard_utils.sh | 497 | # ============================================================================= | COMMENT |
| 20 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ralph_queue.sh | 1 | #!/bin/bash | COMMENT |
| LOW | migrate_to_ralph_folder.sh | 1 | #!/bin/bash | COMMENT |
| LOW | ralph_enable.sh | 1 | #!/bin/bash | COMMENT |
| LOW | ralph_import.sh | 61 | COMMENT | |
| LOW | ralph_import.sh | 101 | if command -v jq &>/dev/null && jq empty "$output_file" 2>/dev/null; then | COMMENT |
| LOW | ralph_import.sh | 121 | # PARSED_HAS_ERRORS - "true"/"false" indicating errors | COMMENT |
| LOW | ralph_import.sh | 181 | } | COMMENT |
| LOW | ralph_import.sh | 281 | } | COMMENT |
| LOW | ralph_import.sh | 561 | COMMENT | |
| LOW | ralph_import.sh | 661 | if [[ "$match_count" -eq 0 ]]; then | COMMENT |
| LOW | ralph_import.sh | 841 | # $1 (json_file) - File containing issue JSON from fetch_github_issue | COMMENT |
| LOW | ralph_import.sh | 1021 | COMMENT | |
| LOW | ralph_loop.sh | 1 | #!/bin/bash | COMMENT |
| LOW | ralph_loop.sh | 261 | printf '0' | COMMENT |
| LOW | ralph_loop.sh | 281 | # - SESSION_EXPIRY_HOURS (mapped to CLAUDE_SESSION_EXPIRY_HOURS) | COMMENT |
| LOW | ralph_loop.sh | 1241 | current_time=$(date +%s) | COMMENT |
| LOW | ralph_loop.sh | 1741 | return 0 | COMMENT |
| LOW | ralph_enable_ci.sh | 1 | #!/bin/bash | COMMENT |
| LOW | tools/inspect-allowed-tools.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | tests/test_error_detection.sh | 1 | #!/bin/bash | COMMENT |
| LOW | tests/test_stuck_loop_detection.sh | 1 | #!/bin/bash | COMMENT |
| LOW | tests/e2e/helpers/e2e_helper.bash | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | .github/workflows/docker-publish.yml | 1 | # Publish the default ralph-sandbox image to GHCR (Issue #298) | COMMENT |
| LOW | .github/workflows/triage-incoming-issues.lock.yml | 1 | # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"a52f9dd3f548b72d0f16ca928d98958867378af0afe8f9b540d1ea6725e | COMMENT |
| LOW | .github/workflows/triage-incoming-issues.lock.yml | 21 | # Not all edits will cause changes to this file. | COMMENT |
| LOW | .github/workflows/triage-incoming-issues.lock.yml | 781 | # - Edit | COMMENT |
| LOW | .github/workflows/triage-incoming-issues.lock.yml | 801 | # - Write(/tmp/gh-aw/agent/*) | COMMENT |
| LOW | .github/workflows/triage-incoming-issues.lock.yml | 821 | # - mcp__github__get_release_by_tag | COMMENT |
| LOW | .github/workflows/triage-incoming-issues.lock.yml | 841 | # - mcp__github__list_starred_repositories | COMMENT |
| LOW | .github/workflows/triage-incoming-issues.lock.yml | 1321 | run: npm install -g @anthropic-ai/claude-code@2.1.156 | COMMENT |
| LOW | lib/task_sources.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | lib/task_sources.sh | 21 | COMMENT | |
| LOW | lib/task_sources.sh | 141 | # ============================================================================= | COMMENT |
| LOW | lib/task_sources.sh | 161 | COMMENT | |
| LOW | lib/task_sources.sh | 181 | # 0 - Success | COMMENT |
| LOW | lib/task_sources.sh | 281 | # Newline-separated list of label names | COMMENT |
| LOW | lib/task_sources.sh | 361 | } | COMMENT |
| LOW | lib/task_sources.sh | 401 | # TASK NORMALIZATION | COMMENT |
| LOW | lib/task_sources.sh | 521 | # $1 (sources) - Space-separated list of sources: beads, github, prd | COMMENT |
| LOW | lib/issue_analyzer.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | lib/issue_analyzer.sh | 21 | # +15 Implementation guidance keywords (implement/architecture/steps/...) | COMMENT |
| LOW | lib/queue_manager.sh | 1 | #!/bin/bash | COMMENT |
| LOW | lib/github_lifecycle.sh | 1 | #!/bin/bash | COMMENT |
| LOW | lib/wizard_utils.sh | 21 | # $1 (prompt) - The question to ask | COMMENT |
| LOW | lib/wizard_utils.sh | 61 | echo -e "${WIZARD_YELLOW}Please answer yes (y) or no (n)${WIZARD_NC}" >&2 | COMMENT |
| LOW | lib/wizard_utils.sh | 101 | # | COMMENT |
| LOW | lib/wizard_utils.sh | 161 | # ============================================================================= | COMMENT |
| LOW | lib/wizard_utils.sh | 221 | # | COMMENT |
| LOW | lib/sync.sh | 1 | #!/bin/bash | COMMENT |
| LOW | lib/sync.sh | 21 | # | COMMENT |
| LOW | lib/response_analyzer.sh | 81 | # `Bash(mvn *)` is configured. | COMMENT |
| LOW | lib/response_analyzer.sh | 101 | # _base_command_in_allowed_tools — does CLAUDE_ALLOWED_TOOLS permit ARBITRARY | COMMENT |
| LOW | lib/response_analyzer.sh | 261 | COMMENT | |
| LOW | lib/response_analyzer.sh | 661 | COMMENT | |
| LOW | lib/response_analyzer.sh | 821 | COMMENT | |
| LOW | lib/sandbox_docker.sh | 1 | #!/bin/bash | COMMENT |
| LOW | lib/sandbox_docker.sh | 21 | # logged). Without an API key, the host's ~/.claude/.credentials.json is | COMMENT |
| LOW | lib/sandbox_docker.sh | 201 | rm -f "$tmp" | COMMENT |
| LOW | lib/enable_core.sh | 61 | # ============================================================================= | COMMENT |
| LOW | lib/enable_core.sh | 121 | is_ralph_enabled() { | COMMENT |
| 8 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | migrate_to_ralph_folder.sh | 41 | # Check if project is already migrated | COMMENT |
| LOW⚡ | migrate_to_ralph_folder.sh | 45 | # Check if .ralph/ directory exists with key files | COMMENT |
| LOW⚡ | migrate_to_ralph_folder.sh | 55 | # Check if project needs migration (has old-style structure) | COMMENT |
| LOW | migrate_to_ralph_folder.sh | 284 | # Check if already migrated | COMMENT |
| LOW | migrate_to_ralph_folder.sh | 290 | # Check if needs migration | COMMENT |
| LOW | uninstall.sh | 38 | # Check if Ralph is installed by verifying commands or home directory exist | COMMENT |
| LOW | ralph_import.sh | 89 | # Check if file starts with { or [ (JSON indicators) | COMMENT |
| LOW | ralph_import.sh | 138 | # Check if jq is available | COMMENT |
| LOW | ralph_loop.sh | 448 | # Check if tmux is available | COMMENT |
| LOW | ralph_loop.sh | 800 | # Check if we can make another call | COMMENT |
| LOW | ralph_loop.sh | 905 | # Check if we should gracefully exit | COMMENT |
| LOW | ralph_loop.sh | 1279 | # Check if session has expired | COMMENT |
| LOW | ralph_loop.sh | 1554 | # Check if prompt file exists | COMMENT |
| LOW | ralph_loop.sh | 2263 | # Check if commits were made (HEAD changed) | COMMENT |
| LOW | ralph_loop.sh | 2614 | # Check if this is a Ralph project directory | COMMENT |
| LOW | ralph_loop.sh | 2619 | # Check if this looks like a partial Ralph project | COMMENT |
| LOW | create_files.sh | 114 | # Check if we can make another call | COMMENT |
| LOW | create_files.sh | 170 | # Check if we should gracefully exit | COMMENT |
| LOW | create_files.sh | 267 | # Check if prompt file exists | COMMENT |
| LOW | lib/circuit_breaker.sh | 37 | # Check if state file exists and is valid JSON | COMMENT |
| LOW | lib/circuit_breaker.sh | 139 | # Check if circuit breaker allows execution | COMMENT |
| LOW | lib/circuit_breaker.sh | 193 | # Check if Claude reported files modified (may differ from git diff if already committed) | COMMENT |
| LOW | lib/circuit_breaker.sh | 210 | # Check if Claude is asking questions (Issue #190 Bug 2) | COMMENT |
| LOW | lib/circuit_breaker.sh | 437 | # Check if loop should halt (used in main loop) | COMMENT |
| LOW | lib/task_sources.sh | 22 | # Check if bd command exists | COMMENT |
| LOW | lib/task_sources.sh | 49 | # Check if beads is available | COMMENT |
| LOW | lib/task_sources.sh | 157 | # Check if authenticated | COMMENT |
| LOW | lib/task_sources.sh | 162 | # Check if in a git repo with GitHub remote | COMMENT |
| LOW | lib/task_sources.sh | 197 | # Check if GitHub is available | COMMENT |
| LOW | lib/task_sources.sh | 388 | # Check if ralph-import is available for full conversion | COMMENT |
| LOW | lib/response_analyzer.sh | 160 | # Check if file starts with { or [ (JSON indicators) | COMMENT |
| LOW | lib/response_analyzer.sh | 215 | # Check if JSON is an array (Claude CLI array format) | COMMENT |
| LOW | lib/response_analyzer.sh | 578 | # Check if commits were made (HEAD changed) | COMMENT |
| LOW | lib/response_analyzer.sh | 772 | # Check if commits were made (HEAD changed) | COMMENT |
| LOW | lib/response_analyzer.sh | 988 | # Check if same errors appear in all recent outputs | COMMENT |
| LOW | lib/response_analyzer.sh | 1103 | # Check if the stored session should be resumed | COMMENT |
| LOW | lib/response_analyzer.sh | 1153 | # Check if session is still valid (less than expiration time) | COMMENT |
| LOW | lib/enable_core.sh | 403 | # Check if in git repo | COMMENT |
| LOW | lib/enable_core.sh | 410 | # Check if GitHub | COMMENT |
| LOW | lib/timeout_utils.sh | 52 | # Check if a timeout command is available on this system | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | CLAUDE.md | 42 | - **github_lifecycle.sh** — GitHub issue lifecycle management backing `ralph --github-issue` (Issue #73). `parse_issue_r | CODE |
| MEDIUM⚡ | CLAUDE.md | 43 | - **sandbox_docker.sh** — Docker sandbox execution backing `ralph --sandbox docker` (Issue #74). Containerizes only the | CODE |
| MEDIUM⚡ | CLAUDE.md | 44 | - **sandbox_e2b.sh** + **e2b_helper.py** — E2B cloud sandbox execution backing `ralph --sandbox e2b` (Issue #75). Same h | CODE |
| MEDIUM | lib/github_lifecycle.sh | 16 | # permission) is logged and returns non-zero, but the orchestration helpers | COMMENT |
| MEDIUM | lib/github_lifecycle.sh | 343 | # --- orchestration (always returns 0: graceful degradation) ----------------- | COMMENT |
| MEDIUM | lib/sandbox_docker.sh | 5 | # on the host. Ralph's orchestration (loop control, rate limiting, circuit | COMMENT |
| MEDIUM | lib/sandbox_e2b.sh | 5 | # the host. Ralph's orchestration (loop control, rate limiting, circuit | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | install.sh | 138 | # Create the main ralph command | COMMENT |
| MEDIUM | ralph_loop.sh | 130 | CREATE_PR="${CREATE_PR:-false}" # Create a PR on completion | CODE |
| MEDIUM | ralph_loop.sh | 132 | DRAFT_PR="${DRAFT_PR:-false}" # Create the PR as a draft | CODE |
| MEDIUM | create_files.sh | 13 | # Create main scripts | COMMENT |
| MEDIUM | tests/e2e/helpers/e2e_helper.bash | 36 | # Create a complete temp Ralph project + mock claude CLI, and cd into it. | COMMENT |
| MEDIUM | lib/queue_manager.sh | 47 | # Create the queue file if absent (idempotent); recreate it if corrupt. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/e2b_helper.py | 63 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 81 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 97 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 114 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 154 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 179 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 212 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 229 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 245 | except Exception as exc: | CODE |
| LOW | lib/e2b_helper.py | 255 | except Exception as exc: | CODE |
| MEDIUM | lib/e2b_helper.py | 60 | def _connect(sandbox_id): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/e2e/helpers/e2e_helper.bash | 4 | # Unlike unit/integration tests (which source functions), this harness runs | COMMENT |
| MEDIUM | tests/e2e/helpers/e2e_helper.bash | 25 | # (Linux: `timeout`; macOS: `gtimeout` from Homebrew coreutils). The harness | COMMENT |
| MEDIUM | .github/workflows/test.yml | 127 | # Run all unit tests under kcov for comprehensive coverage | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/user-guide/01-quick-start.md | 11 | ## Step 1: Create Your Project | COMMENT |
| LOW | docs/user-guide/01-quick-start.md | 22 | ## Step 2: Enable Ralph | COMMENT |
| LOW | docs/user-guide/01-quick-start.md | 65 | ## Step 3: Customize Your Requirements | COMMENT |
| LOW | docs/user-guide/01-quick-start.md | 89 | ## Step 4: Define Your Tasks | COMMENT |
| LOW | docs/user-guide/01-quick-start.md | 113 | ## Step 5: Start Ralph | COMMENT |
| LOW | docs/user-guide/01-quick-start.md | 139 | ## Step 6: Review the Results | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | README.md | 489 | GitHub issues vary widely in detail. During import, Ralph scores the issue 0–100 for implementation readiness (acceptanc | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | lib/e2b_helper.py | 226 | sandbox.commands.run("touch %s && rm -f %s %s %s" % ( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ralph_enable.sh | 6 | # Usage: | COMMENT |
| LOW | ralph_enable_ci.sh | 6 | # Usage: | COMMENT |
| LOW | tools/inspect-allowed-tools.sh | 11 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | install.sh | 355 | echo "⚠️ Don't forget to add $INSTALL_DIR to your PATH (see above)" | CODE |