| name | description |
|---|---|
claude-code-internals |
Reverse-engineer and explain Claude Code's internal architecture. Extract prompts, commands, data structures from the binary. Use when user asks about how Claude Code works internally, what prompts it uses, how features are implemented, or wants to extract/backup internal logic. Triggers: 'claude inside', 'how does claude code work', 'extract prompt', 'extract prompt', 'claude architecture', 'internals', 'binary'. |
Reverse-engineer Claude Code's architecture by extracting and analyzing its bundled JavaScript from the binary. Save findings to ~/obsidian-vault/reference/ for the user's review.
- Binary is the source of truth — Claude Code ships as a single binary with bundled JS. Use
stringsto extract. - Cache findings — Always save extracted prompts/structures to
~/obsidian-vault/reference/so they survive across sessions. - Deobfuscate — The JS is minified. Variable names are mangled. Read the logic, not the names.
- Version-stamp — Always note the Claude Code version in extracted docs.
CLAUDE_BIN=$(which claude)
CLAUDE_VERSION=$(claude --version 2>/dev/null || strings "$CLAUDE_BIN" | grep '"VERSION"' | head -1)# Search for keywords related to the feature
strings "$CLAUDE_BIN" | grep -i "keyword" | head -20
# Get surrounding context (the prompt text)
strings "$CLAUDE_BIN" | grep -B 5 -A 50 "exact phrase from feature"
# For longer extractions
strings "$CLAUDE_BIN" | grep -B 2 -A 200 "start of prompt text" | head -300# Commands are registered with type:"prompt" and name:"commandname"
strings "$CLAUDE_BIN" | grep 'type:"prompt",name:"'
strings "$CLAUDE_BIN" | grep 'description:".*".*progressMessage'# Main system prompt function
strings "$CLAUDE_BIN" | grep -A 100 'You are an interactive CLI tool'
# Tool descriptions
strings "$CLAUDE_BIN" | grep -A 20 'description:.*tool'# Settings, hooks, permissions
strings "$CLAUDE_BIN" | grep -A 30 'settings.json'
strings "$CLAUDE_BIN" | grep -A 30 'hooks'# How Claude Code talks to the API
strings "$CLAUDE_BIN" | grep -A 20 'anthropic.com'
strings "$CLAUDE_BIN" | grep -A 10 'model.*claude'| Path | Purpose |
|---|---|
~/.claude/settings.json |
User settings (permissions, hooks, model preferences) |
~/.claude/projects/{encoded-path}/ |
Per-project session data |
~/.claude/projects/{path}/*.jsonl |
Session transcripts (JSONL format) |
~/.claude/projects/{path}/{session-id}/ |
Session artifacts (tool results, subagent logs) |
~/.claude/usage-data/facets/{session-id}.json |
AI-analyzed session facets (from /insights) |
~/.claude/usage-data/session-meta/{session-id}.json |
Session metadata (duration, tools, tokens) |
~/.claude/usage-data/report.html |
Generated insights HTML report |
~/.claude/stats-cache.json |
Aggregate usage statistics |
~/.claude/telemetry/ |
Telemetry data |
~/.claude/history.jsonl |
Command history across all sessions |
~/.claude/skills/ |
User-defined skills |
Each line is a JSON object with a type field:
type: "user" — User message (content: string | array of content blocks)
type: "assistant" — Claude response (content: array with text/tool_use/thinking blocks)
type: "file-history-snapshot" — File state snapshot (has timestamp)
type: "progress" — Progress indicator
type: "queue-operation" — Internal queue management
type: "summary" — Conversation summary (from context compression)
{
"underlying_goal": "string",
"goal_categories": {"category": count},
"outcome": "fully_achieved|mostly_achieved|partially_achieved|not_achieved",
"user_satisfaction_counts": {"level": count},
"claude_helpfulness": "unhelpful|slightly_helpful|moderately_helpful|very_helpful|essential",
"session_type": "single_task|multi_task|iterative_refinement|exploration|quick_question",
"friction_counts": {"type": count},
"friction_detail": "string",
"primary_success": "none|fast_accurate_search|correct_code_edits|...",
"brief_summary": "string",
"session_id": "uuid"
}| Command | Description | Source |
|---|---|---|
/insights |
Session usage analysis + HTML report | builtin |
/help |
Help menu | builtin |
/clear |
Clear conversation | builtin |
/compact |
Compress context | builtin |
/config |
Open settings | builtin |
/cost |
Show token usage | builtin |
/doctor |
Diagnose issues | builtin |
/fast |
Toggle fast mode | builtin |
/init |
Initialize project CLAUDE.md | builtin |
/login |
Authenticate | builtin |
/logout |
Sign out | builtin |
/mcp |
MCP server management | builtin |
/memory |
Edit CLAUDE.md | builtin |
/model |
Switch model | builtin |
/permissions |
Manage tool permissions | builtin |
/pr-review |
Review a pull request | builtin |
/review |
Code review | builtin |
/status |
Show session info | builtin |
/terminal-setup |
Configure terminal integration | builtin |
/vim |
Toggle vim mode | builtin |
Include:
- Version — Claude Code version at extraction time
- Raw extraction — The actual extracted text/code
- Deobfuscated explanation — What each part does in plain language
- Usage notes — How this knowledge can be applied
- "How does context compression work?" → Search for
summary,compact,compress - "What's the system prompt?" → Search for
You are an interactive,SV8 - "How do hooks work?" → Search for
hooks,lifecycle,PreToolUse - "How does /review work?" → Search for
pr-review,review,diff - "How are MCP tools loaded?" → Search for
mcp,McpServer,tool_use - "What models are available?" → Search for
claude-opus,claude-sonnet,model - "How does permission system work?" → Search for
allowedTools,permission - "How does Task agent work?" → Search for
subagent,Task,agent