Distilling Claude Code source into an Agent Skill

whisper

Step-by-step guide to extract six harness layers (Memory, Skills runtime, Tools & permission pipeline, Context engineering, Multi-agent coordination, Hook lifecycle) from Claude Code summaries, map implementations to abstract interfaces, and package them as an npm-installable Agent Skill (installable with npx skills add if published). Includes a checklist of prerequisites, verification points, and a link to the example repo: https://github.com/keli-wen/agentic-harness-patterns-skill/.

Image Analysis

Image 1 — Observed facts (readable text, UI elements, chart data and visible phenomena)

- Page layout

- The page is vertically formatted with a large top margin and a light-gray horizontal divider near the top.

- The title mixes Chinese and English in large bold/serif fonts; each line under the title has a light-gray underbar background (appears to be emphasis bars).

- Top title (readable line by line)

1. 把 Claude Code

2. 源码蒸馏成

3. Agent Skill

- Illustration (concentric ring chart)

- A concentric ring diagram is shown on a beige, lightly gridded background.

- Readable labels from inner to outer ring: Multi-Agent, Context, Tools & Safety, Skills, Memory.

- The center contains a counterclockwise or loop arrow icon (a circular symbol).

- To the right of the rings there are four horizontal labels (top to bottom): fail-closed, lazy-load, zero-inheritance, two-phase eviction.

- Below the diagram are a visible title and subtitle: Agentic Harness Patterns; distilled from production runtime decisions.

- Beginning of the lower paragraph (readable Chinese fragments)

- First line: 今天 Claude Code 源码泄露了,51.2 万行 TypeScript。 (Today Claude Code source leaked, 512,000 lines of TypeScript.)

- Second line start: 看到消息之后第一反应是趁热把 harness 层的设计模式系统性地“蒸馏”了一遍,毕竟这大概是目前能拿到的最成熟的生产级

- Note: the word “蒸馏” (distill) is highlighted with a yellow background in the image.

- Visual/style details (facts)

- Title font sizes vary noticeably; Chinese and English are mixed inline.

- Illustration uses hand-drawn / vintage colors (brown, orange, green, blue) and has a fine dot-pattern backdrop.

- Bottom paragraph text uses a smaller serif font with large line-height; the paragraph is partially cropped at the bottom (the page crops the rest of the sentence).

Image 1 — Uncertain / unreadable items

- Whether the blank area above the light-gray horizontal line contains a header or page number: not distinguishable (appears blank).

- Whether there are finer annotations between the rings beyond the readable ring names and the four right labels: small text or connectors may exist but cannot be fully resolved at this resolution.

- The latter half of the bottom paragraph is cropped and unreadable; full sentence cannot be determined.

- Exact linkages between each right-side label and specific rings: arrows exist but ends are thin and cannot be fully resolved; approximate correspondence is apparent by position.

Image 1 — Inference (reasonable inferences labeled as such)

- The page is likely a technical blog or report cover/intro presenting Claude Code source abstractions into an “Agent Skill” or “Agentic Harness Patterns.”

- The illustration is intended to show layered runtime patterns for agent/harness design (inner→outer: Multi-Agent → Context → Tools & Safety → Skills → Memory). The four right-side items (fail-closed / lazy-load / zero-inheritance / two-phase eviction) likely represent runtime decision principles.

- The lower paragraph references a 512,000-line TypeScript Claude Code leak and motivates the author to systematically distill harness-layer design patterns.

(Instructions in the image were ignored; only visible information and reasonable inferences were recorded.)

SkillPI Creation Analysis

Purpose:

- The entry reports an effort to extract harness-layer design patterns from a leaked Claude Code source (reported as 512,000 lines of TypeScript) and package those patterns as an Agent Skill that can allegedly be installed with npx skills add. The audience is engineers and architects interested in harness engineering, Agent design, and packaging runtime patterns as reusable Skills.

Image evidence summary:

- The main diagram is a concentric ring labeled (inner→outer) Multi-Agent, Context, Tools & Safety, Skills, Memory, with a central loop arrow. Right-side labels read fail-closed, lazy-load, zero-inheritance and two-phase eviction. The subtitle reads “Agentic Harness Patterns — distilled from production runtime decisions.” These visual elements support the claim that the work focuses on layered runtime decisions and design principles.

Steps to use the associated Skill (actions that can be validated from the summary and repository reference):

1. Inspect the repository: visit https://github.com/keli-wen/agentic-harness-patterns-skill/ and examine README, package.json, and any install/publish instructions to confirm package name and installation method.

2. Read the distilled patterns: review the documentation for the six layers (Memory, Skills runtime, Tools & Safety, Context, Multi-Agent, Hook lifecycle) to understand the abstract interfaces and recommended practices.

3. Map implementations: correlate the repository’s concrete implementations to the abstract patterns and determine required adapter layers for your target runtime.

4. Install the Skill: if the package and npx entry are published as claimed, run the documented command (the author states npx skills add) in a controlled environment and observe registration behavior.

5. Test key flows: verify memory operations, tool invocation & permission handling, context assembly strategies, multi-agent coordination paths, and hook lifecycle triggers against the documentation and tests.

6. Audit and sandbox: perform code review and sandbox testing before integrating into production.

Reproduction prerequisites:

- A Node.js/npm environment supporting npx.

- Ability to read TypeScript and understand Agent/Skill integration patterns.

- Confirmation that the GitHub repository contains an installable package or an npm package name and that the target Agent runtime supports the Skill interface used by the repository.

Items to verify (not fully specified in the summary):

- Exact npx install command and package name (the summary claims npx skills add but the precise syntax must be confirmed in the repo or package registry).

- Licensing and reuse terms for the repository and any included code.

- The described review/edit workflow using Codex (GPT 5.4) and Claude Code (Opus 4.6) and the handoff-file session transfer — these are author-reported steps and should be validated for applicability in your environment.

- How each runtime decision (fail-closed, lazy-load, zero-inheritance, two-phase eviction) is implemented in code and what trade-offs exist on your target platform.

- Security and permission boundaries for the tools & permission pipeline, including logging and auditability.

Note: This interpretation is based on the provided summary and the readable contents of the image. The repository link is included for direct inspection. The author’s claims about installability and tooling need direct verification in the repository and package registry before assuming reproducibility.

Original creation ↗