CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

anthropics/claude-code

Scanned commit b486776a2e dated 2026-09-21 — last upstream commit. Generated by codevetter 1.12.0 on 2026-09-22.

github.com/anthropics/claude-code ↗ · 1421 files · 3.4 MB

Claude Code [![npm]](https://www.npmjs.com/package/@anthropic-ai/claude-code) [npm]: https://img.shields.io/npm/v/@anthropic-ai/claude-code.svg?style=flat-square Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and

Deep analysis by cli:grok via the grok CLI on 2026-09-22 (431s) — every claim below links to its cited source files.

Overview

This checkout is the public GitHub surface of Anthropic Claude Code (an agentic terminal/IDE coding tool), not the closed CLI binary. It publishes four built-in function-hook mods the CLI seats inside the engine (diff, telemetry, agents-md, sec-default), thirteen marketplace plugins of slash commands, agents, skills, and classic shell/Python hooks, plus enterprise examples and the Actions that triage, dedupe, and auto-close issues on anthropics/claude-code. What is distinctive is the mods layer: TypeScript register(on) modules typed against a generated claude-code declaration, tested with claude plugin test, and explicitly not listed in the marketplace.

System map

There is no package.json and no CLI source in this tree. The product is installed separately; this repo holds plugins, the source of four mods that ship inside the binary, Bun scripts for GitHub issue lifecycle, and reference deployments. Runtime for mods is the Claude Code function-hook host (no DOM, no Node). CI typechecks mods with tsc and optionally runs claude plugin test. GitHub workflows call anthropics/claude-code-action with Workload Identity Federation rather than a static API key.

Feature catalog

User-visible behaviour splits three ways. Built-in mods add /diff, AGENTS.md instruction loading, first-party analytics, and an organization security default. Marketplace plugins add slash commands, skills, and classic hooks (security review, hookify rules, Ralph loops, commit/PR workflows, feature-dev, code review). GitHub-side features are /triage-issue, /dedupe, scheduled sweep/lock/autoclose, and @claude on issues and PRs.

All 16 feature catalog claims →

Data flow

Mod data never touches the network except telemetry's batch POST and security-guidance's model call. Instruction files, diffs, and settings move through the engine nouns $.fs, $.session, $.settings, $.process, $.store, and $.ui. Plugin hooks speak JSON on stdin/stdout. Issue bots speak the GitHub REST API with GITHUB_TOKEN and, separately, Statsig. Identity for analytics is read from ~/.claude.json (or CLAUDE_CONFIG_DIR) and account fields are only kept on an internal build.

All 14 data flow claims →

Behavior traces

Three product flows and two repo-ops flows are fully readable in-tree. Session start for agents-md only logs and then waits for prompt.context. /diff binds a host, registers the command, probes git lazily, and draws on ui.render. Telemetry attaches in engine.create and flushes on a timer or session.end. A new GitHub issue fans out to triage, dedupe, and an optional repository_dispatch. A file edit under security-guidance is pattern-matched before any LLM call.

Testing signals

Automated tests exist only for the four mods and only under the Claude Code plugin test host, not Jest, Vitest, or pytest. CI typechecks always and runs tests only when the installed CLI advertises claude plugin test. Plugins, Bun issue scripts, Python hooks, and workflows have no unit tests in this repo. Diff has broad pure-function coverage; telemetry and sec-default cover their registers; agents-md has a single register suite.

Risk map

The highest-impact code is the security-guidance Python hook (sends diffs to a model, shells out, writes under the home directory), telemetry (credentialed POST plus a shell probe and a read of .claude.json), and the GitHub workflows that let non-writers invoke Claude and that close issues. sec-default fails closed and can block every user-tier tool.register when policy cannot be read. Plugin and script paths are effectively untested. The function-hook API is marked early access.

All 14 risk map claims →

Extension points

New product behaviour is supposed to arrive as a plugin (markdown command, agent, skill, or hooks.json command) registered in marketplace.json, or as another event subscription inside a mod's register. The engine nouns are extended by declaration merging on EngineInterface. Diff reserves a compile-time probe set for non-git VCS. security-guidance and hookify are the two user-file extension mechanisms. Organizations move sec-default by listing prependPlugins.

Contributor handoff

Edit one mod or one plugin at a time. Read that mod's README and register.ts before its leaves; the leaves are tiny single-export files. Do not hand-edit mods/types/claude-code.d.ts. Typecheck with tsc -p mods/tsconfig.json and test with claude plugin test if the CLI supports it. Never treat plugins/ and mods/ as the same system. Issue scripts share scripts/issue-lifecycle.ts and must keep the gh.sh allowlist. The hook API is early access.

Languages

LanguageFilesShare of source
TypeScript118397%
Markdown111docs/config
JSON35docs/config
Python212%
Shell212%
YAML19docs/config

Start reading here

Probable source entrypoint: mods/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

mods/ (1192 files) plugins/ (149 files) Script/ (1 files)

Source layout — mods/

PathFiles
mods/diff/53
mods/types/1

Repository structure

Top-level pathFiles
mods/1192
plugins/149
examples/38
.github/19
scripts/8
.claude/3
.devcontainer/3
.claude-plugin/1

Docs found: LICENSE.mdREADME.md

CI & config entrypoints

Structural health signals

Average score 8.1/10 across 96 analyzed source files; 6 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history