claude-inspector

作者 kangraemin

Claude Code Prompt Mechanism Visualizer — Electron desktop app

119
Stars
17
Forks
HTML
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/kangraemin/claude-inspector

快速入门

使用 claude-inspector 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Claude Inspector

See what Claude Code actually sends to the API.

A local MITM proxy that intercepts Claude Code CLI traffic in real-time,
lets you inspect every JSON payload, and analyzes session flows with AI.

Install · Usage · AI Analysis · What You'll Learn

License: MIT GitHub release macOS

English | 한국어


Proxy — Anatomy view

Proxy — Request view with cost breakdown

Proxy — AI Analysis view


Install

Homebrew (Recommended)

brew install --cask kangraemin/tap/claude-inspector && sleep 2 && open -a "Claude Inspector"

Direct Download

Download the .dmg from the Releases page.

Upgrade / Uninstall

# Upgrade
brew update && brew upgrade --cask claude-inspector && sleep 2 && open -a "Claude Inspector"

# Uninstall
brew uninstall --cask claude-inspector

Proxy Mode

Intercept real Claude Code CLI traffic via a local MITM proxy.

Claude Code CLI  →  Inspector (localhost:9090)  →  api.anthropic.com

1. Click Start Proxy in the app
2. Run Claude Code through the proxy:

ANTHROPIC_BASE_URL=http://localhost:9090 claude

3. Every API request/response is captured in real-time.

4 Tabs

TabWhat it shows
AI AnalysisAI-powered session analysis — flow summary, Mermaid diagram, inline chat
RequestFull JSON request body, collapsible tree, token/cost breakdown
ResponseFull JSON response with tool_use results
AnatomyDetected mechanisms (CLAUDE.md, Skills, MCP, Sub-agents) as colored chips

AI Analysis

Select captured requests and let Claude (Sonnet) analyze the full session flow.

What It Produces

  • Step-by-step session summary — what happened, in what order, with mechanism explanations
  • MCP dynamic loading chain — how ToolSearch fetches schemas, how deferred tools become callable
  • Skill loading flow — how slash commands trigger <command-message> → Skill tool_use
  • Sub-agent patterns — which requests are main vs sub-agent, and how they relate
  • Mermaid flowchart — visual diagram of the internal mechanism flow
  • Clickable references — each step links to the actual Request, scrolling to the relevant tool_use

How to Use

  1. Capture some requests via the proxy
  2. Click the AI Analysis tab
  3. Select requests to analyze (click to toggle, Shift+click for range)
  4. Click Analyze Session Flow
  5. Watch real-time streaming as Claude processes the session
  6. Click any Request #N badge to jump to that request's tool_use in the JSON tree

Inline Chat

After analysis, ask Claude follow-up questions about the session. The chat understands the full analysis context.

Session Detection

Requests are automatically grouped by session using message content fingerprinting. Different sessions (main conversation, sub-agents, stop hooks) get different colored borders in the sidebar.


What You'll Learn

All discovered from real captured traffic. See what Claude Code hides from you.

1. CLAUDE.md is injected into every single request

You type hello. Claude Code silently prepends ~12KB before your message:

BlockWhat's insideSize
content[0]Available skills list~2KB
content[1]CLAUDE.md + rules + memory~10KB
content[2]What you actually typedfew bytes

Injection order: Global CLAUDE.md → Global rules → Project CLAUDE.md → Memory

This ~12KB payload is re-sent with every request. A 500-line CLAUDE.md quietly burns tokens on every API call. Keep it lean.

2. MCP tools are lazy-loaded — watch tools[] grow

Built-in tools (27) ship their full JSON schemas every request. MCP tools start as names only.

StepWhat happenstools[] count
Initial request27 built-in tools loaded27
Model calls ToolSearch("context7")Full schema for 2 MCP tools returned29
Model calls ToolSearch("til")6 more MCP tool schemas added35

Unused MCP tools never consume tokens. Watch tools[] grow as the model discovers what it needs.

3. Images are base64-encoded inline

When Claude Code reads a screenshot or image, it's base64-encoded and embedded directly in the JSON body:

{
  "type": "image",
  "source": {
    "type": "base64",
    "media_type": "image/png",
    "data": "iVBORw0KGgo..."
  }
}

A single screenshot can add hundreds of KB to the request payload. Inspector shows you the exact size.

4. Skill ≠ Command — completely different injection paths

Typing /something triggers one of three completely different mechanisms:

Local CommandUser SkillAssistant Skill
Example/mcp, /clear/commitSkill("finish")
Who triggersUserUserModel
Injection<local-command-stdout>Full prompt in user msgtool_usetool_result
Model seesResult onlyFull promptFull prompt

Commands run locally and only pass the result. Skills inject the entire prompt text — and it stays in every subsequent request until the session ends.

5. Previous messages pile up — use /clear often

Claude Code re-sends the entire messages[] array with every request:

TurnsApprox. cumulative transfer
1~15KB
10~200KB
30~1MB+

Most of it is old conversation you no longer need. Running /clear resets the context and drops the accumulated weight.

6. Sub-agents run in fully isolated contexts

When Claude Code spawns a sub-agent (via the Agent tool), it creates a completely separate API call:

Parent API callSub-agent API call
messages[]Full conversation historyOnly the task prompt — no parent history
CLAUDE.mdIncludedIncluded (independently)
tools[]All loaded toolsFresh set
ContextAccumulatedStarts from zero

Inspector captures both calls side by side, and AI Analysis automatically detects and labels sub-agent sessions.


Development

git clone https://github.com/kangraemin/claude-inspector.git
cd claude-inspector
npm install
npm start          # Dev mode
npm run test:unit  # Unit tests
npm run test:e2e   # E2E tests (Playwright)

Tech Stack

LayerWhatWhy
ElectronDesktop shell, IPCNative macOS titlebar, code-signed + notarized DMG
Vanilla JSZero frameworksEntire UI in a single index.html — no bundler, no React
Node http/httpsMITM proxyIntercepts Claude Code ↔ API traffic, reassembles SSE streams
Mermaid.jsFlowchart renderingAI Analysis mechanism diagrams
claude -pAI analysis engineSession flow analysis + inline chat via Claude Sonnet

Privacy: All proxy traffic stays on localhost. AI Analysis runs locally via claude -p (your own Claude Code CLI).

License

MIT

常见问题

What is claude-inspector?

claude-inspector is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by kangraemin. Claude Code Prompt Mechanism Visualizer — Electron desktop app. It has 119 GitHub stars.

Is claude-inspector safe to use?

claude-inspector returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.

How do I install claude-inspector?

Clone the repository with "git clone https://github.com/kangraemin/claude-inspector" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is claude-inspector written in?

claude-inspector is primarily written in HTML. It is open-source under kangraemin on GitHub, so you can review or fork the full source.

Are there alternatives to claude-inspector?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh claude-inspector against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情