GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Shengfu-Zhang/claude-code-public-package-extract: Research archive of the public npm package @anthropic-ai/claude-code v2.1.88, including the original package artifact and an extracted source tree.

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents/summary
.agents/summary
 
 
artifacts
artifacts
 
 
scripts
scripts
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.nojekyll
.nojekyll
 
 
AGENTS.md
AGENTS.md
 
 
README.md
README.md
 
 
README_ZH.md
README_ZH.md
 
 
index.html
index.html
 
 

Repository files navigation

Claude Code 2.1.88 — Public Package Source Extract

PS: I will publish deeper analysis and follow-up notes on my blog: shengfu-zhang.github.io. If this GitHub repo changes later, that site is where I plan to keep the long-form writeups indexed.

Attribution: Public rediscovery credit goes to Chaofan Shou (@Fried_rice) on X on March 31, 2026. This README also keeps visible credit to the broader public writeups that documented the package contents.

Important

This repository is unofficial and is not affiliated with Anthropic. The underlying Claude Code source remains Anthropic's proprietary work. This repo only preserves files extracted from the public npm package @anthropic-ai/claude-code version 2.1.88, plus light organization, path cleanup, and documentation. It is shared for research, reference, interoperability discussion, and education only. No ownership is claimed over Anthropic's code. If you are a rights holder and want any material removed, please contact the repository owner and it will be taken down promptly.

Language: English | 中文

Overview

This repository keeps together four things that are useful for studying the public Claude Code package:

  • the original npm tarball
  • a locally extracted source archive
  • a browsable src/ tree reconstructed from the distributed package artifacts
  • a generated documentation set for faster navigation and analysis

The goal is simple: make the public package easier to inspect without pretending this is an official upstream repository.

Repository Contents

Path Description Use it when
src/ Browsable extracted TypeScript source tree You want to read code directly on GitHub
artifacts/extracted/claude-code-2.1.88-src.zip Downloadable zip of the extracted source tree You want the extracted tree locally without rebuilding it
artifacts/original/claude-code-2.1.88.tgz Original npm package archive You want provenance, the published bundle, or to reproduce extraction
scripts/extract-sources.js Local helper script used during extraction work You want to rerun extraction from a local cli.js.map
.agents/summary/ Generated architecture and navigation docs You want a structured overview before digging into code
AGENTS.md Concise repo guide for coding agents You want the shortest useful entry point for repo-specific navigation

Current local extract:

  • src/ contains 1,902 files
  • 1,884 files are .ts / .tsx
  • the extracted JS/TS tree is about 514,587 lines
  • the local src/ directory is about 33 MB

Notes:

  • artifacts/extracted/claude-code-2.1.88-src.zip contains only the extracted source tree.
  • artifacts/original/claude-code-2.1.88.tgz contains the original bundled package, including cli.js, cli.js.map, and vendor/native binaries, so it is much larger.
  • Most people only need src/ or the extracted zip; the original .tgz is mainly for provenance and reproducibility.

Generated Documentation

This repo now includes a generated documentation set aimed at both humans and AI coding assistants:

  • .agents/summary/index.md is the primary knowledge-base index
  • .agents/summary/architecture.md, components.md, interfaces.md, data_models.md, workflows.md, and dependencies.md provide deeper breakdowns
  • .agents/summary/review_notes.md records extraction caveats and documentation gaps
  • AGENTS.md is the concise root-level navigation guide

If you want the fastest orientation path, start with AGENTS.md or .agents/summary/index.md, then jump into src/.

Interactive Teaching Console

This repo also includes a browser-based teaching artifact for understanding the runtime shape without reading the whole tree first:

  • index.html — GitHub Pages landing page for the demo
  • artifacts/demo/index.html — shorter demo entrypoint inside the demo directory
  • artifacts/demo/claude-code-loop-simulator.html — English teaching console
  • artifacts/demo/claude-code-loop-simulator.zh.html — Chinese entry point

What it now shows:

  • 10 guided replays covering direct answers, recursive tool use, skills/plugins, agent teams, permission denials, canceled tasks, intercepted slash-command input, compaction/continuation, tool-error recovery, and one final session that combines every branch in a sensible order
  • a guided workspace where Transcript is the first reading surface, Inspector is the second, and deeper debugger detail stays collapsed until you ask for it
  • a live Source Lens that fetches the real repo file around the active line and highlights the current seam
  • a scenario-specific File Guide that tells you what to open first, what can wait, and what is missing from the recovered extract
  • labeled reply payloads that explicitly show what the runtime is trying to emit at each beat

Suggested usage:

  1. If GitHub Pages is enabled for this repo, open the repo root URL for the landing page or /artifacts/demo/ for the demo shortcut. Both now resolve through index.html.
  2. For local use, serve the repo over a simple HTTP server, then open the teaching console in a browser. python3 -m http.server 8123 from the repo root is enough. If you double-click the HTML file or open it through a file browser with file://, Source Lens may fail because the browser blocks the live file fetch.
  3. Start with Plain Assistant Answer to learn the shortest path.
  4. Use Intercepted Input / Slash Command, Tool Loop And Recursion, Compaction And Continuation, and Tool Error And Recovery to learn the main runtime seams one by one.
  5. Open Everything Combined only after the smaller branches feel obvious.
  6. Read left first, then right: Transcript shows visible output, Inspector shows the owning seam, and Source Lens proves it in the actual file.

The console is a replay model, not live instrumentation. It is meant to teach shape and control flow, not to claim that every value shown came from a real captured session.

Why it is organized this way:

  • the teaching order follows the architecture: visible output first, wrapper ownership second, exact source proof third
  • QueryEngine plus queryLoop() are the durable center; the Ink/terminal shell is important, but replaceable
  • the demo intentionally treats the current REPL as one UX layer on top of a reusable conversation engine, because that is the most transferable mental model for building other surfaces
  • Source Lens and File Guide exist to tie each replay beat back to concrete files, including important extraction gaps such as src/types/message.js

Reading Strategy: Core Loop First

If your goal is architectural understanding, focus on the runtime center before spending much time on the terminal UX shell.

  • src/query.ts and src/QueryEngine.ts are the real center of gravity. That is where turns are wrapped, tool use is coordinated, and recursion happens.
  • src/screens/REPL.tsx is important for interaction details, but it is a replaceable surface layer. A web debugger, IDE panel, headless SDK surface, or another frontend could reuse the same engine without reusing the Ink UI.
  • Skills, plugins, permissions, and agent teams are best understood as side-paths wrapped around the same conversation engine, not as separate products.

In other words: the current UX layer is useful, but not sacred. The most reusable mental model is QueryEngine around queryLoop(), then everything else layered around that.

The teaching console follows that same rule on purpose: it starts from the replayed output, then reveals wrapper ownership, then points directly at the source seam. The terminal UI is shown as one layer in that stack, not as the architectural center.

Why This Repo Exists

  • The published package is much harder to inspect in bundled form.
  • Keeping the tarball, extracted tree, and helper script together makes analysis more reproducible.
  • The generated docs reduce the cold-start cost of navigating a large recovered source tree.
  • Longer architecture notes and follow-up analysis will live on my blog instead of turning this front page into a giant dump.

Quick Use

# inspect the extracted source tree
cd src

# read the concise repo guide
less ../AGENTS.md

# read the generated knowledge-base index
less ../.agents/summary/index.md

# inspect the original published package
tar -xzf artifacts/original/claude-code-2.1.88.tgz

# inspect the zipped extract
unzip -l artifacts/extracted/claude-code-2.1.88-src.zip | head

# rerun extraction from an unpacked package/cli.js.map
node scripts/extract-sources.js

Extraction Notes

The files here were reconstructed locally from publicly distributed package artifacts. In practice, that means:

  1. Start from the public npm package @anthropic-ai/claude-code 2.1.88.
  2. Recover source paths and file contents from the shipped bundle and source map data.
  3. Normalize the extracted paths into a regular source tree for browsing.

This is a research archive, not an official development checkout. Some internal-only or feature-gated code may still be absent from public artifacts.

Known Limitations Of This Extract

If you are using this repo for code reading or interoperability work, keep these constraints in mind:

  • This is not a normal upstream checkout. Standard authoring metadata such as package.json, lockfiles, and CI config is not present in the recovered tree.
  • Some recovered files look transformed rather than hand-authored, so they are reliable for behavior and dependencies but weaker as style precedent.
  • A central message-type source, src/types/message.js, is imported widely but missing from the extracted tree, so exact message-schema refactors should be treated cautiously.
  • Feature-gated, internal, native, or vendor-backed behavior may be only partially represented in src/, even when surrounding TypeScript call sites are present.

Important Disclaimer

  • Do not treat this repository as open source.
  • Do not reuse Anthropic's proprietary code in commercial products or closed redistributions.
  • Do not represent this archive as an official Anthropic repository.
  • The added README text, organization, and commentary are original editorial work; the product code itself is not.
  • Rights-holder removal requests will be honored promptly.

Credits

  • Anthropic for the original Claude Code product and publicly distributed npm package.
  • Chaofan Shou (@Fried_rice) for the March 31, 2026 X posts that drew renewed attention to the package contents.
  • Kuber Mehta for an early public repo writeup and blog post that helped document the issue and wider discussion:
    • Repository
    • Blog post

About

Research archive of the public npm package @anthropic-ai/claude-code v2.1.88, including the original package artifact and an extracted source tree.

shengfu-zhang.github.io

Topics

anthropicclaude-codenpmpackage-analysissoftware-archaeologysourcemaptypescript

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.