Marketplace

claude-code-internals

This skill should be used when the user asks to "explore claude code source", "find internal features", "investigate cli.js", "check beta headers", "discover hidden settings", or mentions "minified code analysis", "anthropic-beta headers", "context management internals".

$ Installer

git clone https://github.com/jongwony/cc-plugin /tmp/cc-plugin && cp -r /tmp/cc-plugin/claude-code-internals/skills/claude-code-internals ~/.claude/skills/cc-plugin

// tip: Run this command in your terminal to install the skill


name: claude-code-internals description: >- This skill should be used when the user asks to "explore claude code source", "find internal features", "investigate cli.js", "check beta headers", "discover hidden settings", or mentions "minified code analysis", "anthropic-beta headers", "context management internals". context: fork

Claude Code Internals Explorer

Analyze Claude Code's minified source to understand internal behavior and discover features.

Important Caveats

  • Minified code: Variable names are obfuscated (e.g., UnB, cT0)
  • Version-specific: Findings may change between versions
  • Unofficial: Discovered features may be unsupported/unstable
  • Token-intensive: Mitigated via subagent delegation (see Workflow Phase 0)

Quick Start

  1. Delegate exploration to Explore subagent:
Task tool (subagent_type: Explore)
Prompt: "Run ${CLAUDE_PLUGIN_ROOT}/scripts/find_installation.sh,
        then search for [keyword] in cli.js. Report file paths and matching lines."
  1. Analyze findings in main context (subagent returns summary)

  2. Iterate with follow-up delegation if deeper investigation needed

Workflow

0. Delegate Context Gathering

Principle: Initial exploration consumes tokens in subagent context, preserving main context for analysis.

Call Task tool with:

  • subagent_type: Explore
  • prompt: Specify search target and expected output format

Example delegation:

Find Claude Code installation path using ${CLAUDE_PLUGIN_ROOT}/scripts/find_installation.sh.
Then search for patterns related to [feature] in cli.js.
Return: installation path, version, matching lines with context.

The subagent will:

  1. Execute shell scripts and grep commands
  2. Filter and summarize findings
  3. Return structured results to main context

Main agent then performs interpretation and decision-making.

1. Locate Source

Run scripts/find_installation.sh to find:

  • cli.js path (minified JavaScript source, ~9.9MB)
  • Current version
  • Binary location

Typical path: ~/.npm/_npx/*/node_modules/@anthropic-ai/claude-code/cli.js

2. Choose Investigation Type

GoalApproach
Specific featureSearch for known keywords
New version changesCompare with known-features.md, check release notes
Hidden settingsSearch for setting patterns
Beta featuresSearch for beta headers

3. Search Strategies

For minified code, search string literals (not variable names).

Quick example:

grep -E "anthropic-beta|context-management" cli.js

See references/search-patterns.md for comprehensive patterns by category.

4. Analyze Findings

When you find relevant code:

  1. Note line numbers with grep -n "pattern" cli.js
  2. Extract surrounding context with sed -n 'LINE-10,LINE+10p' cli.js
  3. Trace related code by searching for adjacent strings
  4. Compare findings with references/known-features.md

5. Document Discoveries

Update references/known-features.md with:

  • New features found
  • Changed defaults/thresholds
  • New beta headers
  • Corrected information

Common Investigations

TaskApproach
Check feature enabledgrep -n "feature_name" cli.js -> examine conditional logic
Find default valuesSee references/search-patterns.md Settings section
Discover new commandsSee references/search-patterns.md Commands section
Compare release notesSearch mentioned features -> compare with references/known-features.md

Resources

  • scripts/find_installation.sh: Locate Claude Code installation
  • references/search-patterns.md: Comprehensive grep patterns by category
  • references/known-features.md: Baseline of known features for comparison

Resource Map

ResourcePathLoad When
Known features baselinereferences/known-features.mdComparing with new discoveries
Search pattern libraryreferences/search-patterns.mdInvestigating specific category
Installation finderscripts/find_installation.shStarting investigation

Tips

  1. Start narrow: Search specific terms before broad exploration
  2. Use line numbers: -n flag helps locate code for context reading
  3. Chain searches: Find one string, search nearby for related code
  4. Save findings: Update known-features.md to track discoveries
  5. Version awareness: Note version when documenting findings