RepoTrust

Windy3f3f3f3f/claude-code-from-scratch

Build your own Claude Code from scratch. 🔍 Claude Code 开源了 50 万行代码,读不动?用 ~5000 行 TypeScript / Python 从零复现核心架构,11 章分步教程带你理解 coding agent 精髓

https://github.com/Windy3f3f3f3f/claude-code-from-scratch · commit acc4c34f062b · scored 2026-11-14 · scoring prov-4+qual-2+sec-2

RepoTrust ai badge RepoTrust quality badge RepoTrust security badge

Dispute this score or request a re-score Full report JSON

Scores

Pillar Score Signal Confidence Coverage
AI provenance (estimated AI-generated share) 0 possible 64% 100%
Code quality 52 weak 90% 100%
Security 62 weak 85% 100%

AI provenance

Weak signals consistent with AI-assisted development.

Month Lines added Attributed to AI
2026-03 1,386 0%
2026-04 13,621 0%
2026-05 32 0%
2026-07 7,916 0%
2026-10 145 0%

Evidence

AI provenance describes how code was produced; it is not a quality judgment. Unless attribution is explicit, these are signals consistent with AI generation, not proof. Squash/rebase workflows, imported code, and rewritten history reduce accuracy.

Code quality

Code quality is weak: test-to-source ratio 0.14, no CI test run detected; 25% of function code in complex or long functions; 5% duplicated lines. Weakest area: type safety.

Area Score
Complexity (lizard) 47
Duplication 76
Code smells (Opengrep) 67
Tests and CI 31
Documentation 65
Type safety 30
Process (Scorecard review/maintenance) n/a

Most complex functions:

Security

Security posture is weak: 9 known vulnerabilities in 3 dependencies; 11 high-severity SAST findings. Weakest area: posture.

Area Score
Secrets (gitleaks, tree + history) 97
Static analysis (Opengrep) 32
Vulnerable dependencies (OSV) 79
CI workflows (zizmor) n/a
Posture (policy, updates, signing, lockfiles) 0
OpenSSF Scorecard n/a

Top findings

Severity Finding Location
high opengrep/python.lang.security.audit.dangerous-asyncio-create-exec-audit: Detected 'create_subprocess_exec' function without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'. [confidence low] python/mini_claude/mcp_client.py:41
high opengrep/python.lang.security.audit.dangerous-asyncio-create-exec-tainted-env-args: Detected 'create_subprocess_exec' function with user controlled data. You may consider using 'shlex.escape()'. [confidence low] python/mini_claude/mcp_client.py:41
high opengrep/python.lang.security.audit.dangerous-subprocess-use-audit: Detected subprocess function 'run' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'. [confidence low] python/mini_claude/tools.py:356
high opengrep/python.lang.security.audit.dangerous-subprocess-use-audit: Detected subprocess function 'run' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'. [confidence low] python/mini_claude/tools.py:428
high opengrep/python.lang.security.audit.subprocess-shell-true: Found 'subprocess' function 'run' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead. [confidence medium] python/mini_claude/tools.py:430
high opengrep/javascript.lang.security.detect-child-process: Detected calls to child_process from a function argument input. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed. [confidence low] src/tools.ts:500
high opengrep/python.lang.security.audit.dangerous-subprocess-use-audit: Detected subprocess function 'Popen' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'. [confidence low] steps/canonical/py/mcp_client.py:15
high opengrep/python.lang.security.audit.dangerous-subprocess-use-audit: Detected subprocess function 'run' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'. [confidence low] steps/canonical/py/tools.py:209
high opengrep/python.lang.security.audit.subprocess-shell-true: Found 'subprocess' function 'run' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead. [confidence medium] steps/canonical/py/tools.py:209
high opengrep/javascript.lang.security.detect-child-process: Detected calls to child_process from a function argument command. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed. [confidence low] steps/canonical/ts/mcp.ts:14
high opengrep/javascript.lang.security.detect-child-process: Detected calls to child_process from a function argument input. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed. [confidence low] steps/canonical/ts/tools.ts:209
high osv/GHSA-3jxr-9vmj-r5cp: [email protected] (npm) is affected by GHSA-3jxr-9vmj-r5cp package-lock.json
high osv/GHSA-6j4f-fj2g-mc7p: [email protected] (npm) is affected by GHSA-6j4f-fj2g-mc7p package-lock.json
high osv/GHSA-mh99-v99m-4gvg: [email protected] (npm) is affected by GHSA-mh99-v99m-4gvg package-lock.json
high osv/GHSA-qhr7-859c-m2p7: [email protected] (npm) is affected by GHSA-qhr7-859c-m2p7 package-lock.json
high osv/GHSA-rgw5-rvv9-x895: [email protected] (npm) is affected by GHSA-rgw5-rvv9-x895 package-lock.json
medium opengrep/python.lang.security.audit.dynamic-urllib-use-detected: Detected a dynamic value being used with urllib. urllib supports 'file://' schemes, so a dynamic value controlled by a malicious actor may allow them to read arbitrary files. Audit uses of urllib calls to ensure user data cannot control the URLs, or consider using the 'requests' library instead. [confidence low] python/mini_claude/tools.py:460
medium opengrep/javascript.lang.security.audit.path-traversal.path-join-resolve-traversal: Detected possible user input going into a path.join or path.resolve function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first. [confidence low] src/agent.ts:1324
medium opengrep/javascript.lang.security.audit.detect-non-literal-fs-filename: Detected that function argument toolName has entered the fs module. An attacker could potentially control the location of this file, to include going backwards in the directory with '../'. To address this, ensure that user-controlled variables in file paths are validated. [confidence low] src/agent.ts:1325
medium opengrep/javascript.lang.security.html-in-template-string: This template literal looks like HTML and has interpolated variables. These variables are not HTML-encoded by default. If the variables contain HTML tags, these may be interpreted by the browser, resulting in cross-site scripting (XSS). [confidence low] src/autonomy.ts:461
medium opengrep/javascript.lang.security.audit.detect-non-literal-fs-filename: Detected that function argument filePath has entered the fs module. An attacker could potentially control the location of this file, to include going backwards in the directory with '../'. To address this, ensure that user-controlled variables in file paths are validated. [confidence low] src/mcp.ts:260
medium opengrep/javascript.lang.security.audit.detect-non-literal-fs-filename: Detected that function argument filePath has entered the fs module. An attacker could potentially control the location of this file, to include going backwards in the directory with '../'. To address this, ensure that user-controlled variables in file paths are validated. [confidence low] src/mcp.ts:262
medium opengrep/javascript.lang.security.audit.detect-non-literal-fs-filename: Detected that function argument a has entered the fs module. An attacker could potentially control the location of this file, to include going backwards in the directory with '../'. To address this, ensure that user-controlled variables in file paths are validated. [confidence low] src/memory.ts:83
medium opengrep/javascript.lang.security.audit.path-traversal.path-join-resolve-traversal: Detected possible user input going into a path.join or path.resolve function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first. [confidence low] src/memory.ts:83
medium opengrep/javascript.lang.security.audit.detect-non-literal-fs-filename: Detected that function argument b has entered the fs module. An attacker could potentially control the location of this file, to include going backwards in the directory with '../'. To address this, ensure that user-controlled variables in file paths are validated. [confidence low] src/memory.ts:84

Static signals only: the scorer never runs the project's code. Secret findings are pattern matches that were not verified, and secret values are never stored.

Repository profile

Language Lines
Python 6,649
TypeScript 6,498
JavaScript 2,421
Shell 109

Embed a badge

Maintainers can show these in a README. Badges update when the repository is re-scored.

[![RepoTrust ai](https://repotrust.synapticcyber.com/badge/github.com/Windy3f3f3f3f/claude-code-from-scratch/ai.svg)](https://repotrust.synapticcyber.com/r/github.com/Windy3f3f3f3f/claude-code-from-scratch/)
[![RepoTrust quality](https://repotrust.synapticcyber.com/badge/github.com/Windy3f3f3f3f/claude-code-from-scratch/quality.svg)](https://repotrust.synapticcyber.com/r/github.com/Windy3f3f3f3f/claude-code-from-scratch/)
[![RepoTrust security](https://repotrust.synapticcyber.com/badge/github.com/Windy3f3f3f3f/claude-code-from-scratch/security.svg)](https://repotrust.synapticcyber.com/r/github.com/Windy3f3f3f3f/claude-code-from-scratch/)