Skip to content

weiesky/cc-viewer

Repository files navigation

CC-Viewer

A Claude Code request monitoring system that captures and visualizes all API requests and responses from Claude Code in real time (raw text, unredacted). Helps developers monitor their context for review and troubleshooting during Vibe Coding sessions. The latest version of CC-Viewer also provides a server-deployed web programming solution and mobile programming tools. Feel free to use them in your own projects — more plugin features and cloud deployment support are coming in the future.

Check out the fun part — here's what you can see on mobile:

image

English | 简体中文 | 繁體中文 | 한국어 | 日本語 | Deutsch | Español | Français | Italiano | Dansk | Polski | Русский | العربية | Norsk | Português (Brasil) | ไทย | Türkçe | Українська

Usage

Installation

npm install -g cc-viewer --registry=https://registry.npmjs.org

Programming Mode

ccv is a drop-in replacement for claude — all arguments are passed through to claude while launching the Web Viewer.

ccv                    # == claude (interactive mode)
ccv -c                 # == claude --continue (continue last conversation)
ccv -r                 # == claude --resume (resume a conversation)
ccv -p "hello"         # == claude --print "hello" (print mode)
ccv --d                # == claude --dangerously-skip-permissions (shortcut)
ccv --model opus       # == claude --model opus

The author's most-used command is:

ccv -c --d             # == claude --continue --dangerously-skip-permissions

After launching in programming mode, a web page will open automatically.

You can use Claude directly from the web page while viewing the full request payloads and code changes.

Even better — you can even code from your mobile device!

Logger Mode

⚠️ If you still prefer using the native claude tool or VS Code extension, use this mode.

In this mode, launching claude or claude --dangerously-skip-permissions will automatically start a logging process that records request logs to ~/.claude/cc-viewer/yourproject/date.jsonl

Enable logger mode:

ccv -logger

When the console cannot print the specific port, the default first port is 127.0.0.1:7008. Multiple instances use sequential ports like 7009, 7010.

This command automatically detects how Claude Code is installed locally (NPM or Native Install) and adapts accordingly.

  • NPM version Claude Code: Automatically injects an interceptor script into Claude Code's cli.js.
  • Native version Claude Code: Automatically detects the claude binary, configures a local transparent proxy, and sets up a Zsh Shell Hook to forward traffic automatically.
  • NPM-installed Claude Code is the recommended approach for this project.

Uninstall logger mode:

ccv --uninstall

Troubleshooting

If you encounter issues starting cc-viewer, here is the ultimate troubleshooting approach:

Step 1: Open Claude Code in any directory.

Step 2: Give Claude Code the following instruction:

I have installed the cc-viewer npm package, but after running ccv it still doesn't work properly. Please check cc-viewer's cli.js and findcc.js, and adapt them to the local Claude Code deployment based on the specific environment. Keep the scope of changes as constrained as possible within findcc.js.

Letting Claude Code diagnose the issue itself is more effective than asking anyone or reading any documentation!

After the above instruction is completed, findcc.js will be updated. If your project frequently requires local deployment, or if forked code often needs to resolve installation issues, keeping this file lets you simply copy it next time. At this stage, many projects and companies using Claude Code are not deploying on Mac but rather on server-side hosted environments, so the author has separated findcc.js to make it easier to track cc-viewer source code updates going forward.

Other Commands

See:

ccv -h

Configuration Override

If you need to use a custom API endpoint (e.g., a corporate proxy), simply configure it in ~/.claude/settings.json or set the ANTHROPIC_BASE_URL environment variable. ccv will automatically detect and correctly forward requests.

Silent Mode

By default, ccv runs in silent mode when wrapping claude, keeping your terminal output clean and consistent with the native experience. All logs are captured in the background and can be viewed at http://localhost:7008.

Once configured, use the claude command as normal. Visit http://localhost:7008 to access the monitoring interface.

Features

Programming Mode

After launching with ccv, you can see:

image

You can view code diffs directly after editing:

image

While you can open files and code manually, manual coding is not recommended — that's old-school coding!

Mobile Programming

You can even scan a QR code to code from your mobile device:

image

Fulfill your imagination of mobile programming. There's also a plugin mechanism — if you need to customize for your coding habits, stay tuned for plugin hooks updates.

Logger Mode (View Complete Claude Code Sessions)

image
  • Captures all API requests from Claude Code in real time, ensuring raw text — not redacted logs (this is important!!!)
  • Automatically identifies and labels Main Agent and Sub Agent requests (subtypes: Plan, Search, Bash)
  • MainAgent requests support Body Diff JSON, showing collapsed differences from the previous MainAgent request (only changed/new fields)
  • Each request displays inline Token usage statistics (input/output tokens, cache creation/read, hit rate)
  • Compatible with Claude Code Router (CCR) and other proxy scenarios — falls back to API path pattern matching

Conversation Mode

Click the "Conversation Mode" button in the top-right corner to parse the Main Agent's complete conversation history into a chat interface:

image
  • Agent Team display is not yet supported
  • User messages are right-aligned (blue bubbles), Main Agent replies are left-aligned (dark bubbles)
  • thinking blocks are collapsed by default, rendered as Markdown — click to expand and view the thinking process; one-click translation is supported (feature is still unstable)
  • User selection messages (AskUserQuestion) are displayed in Q&A format
  • Bidirectional mode sync: switching to conversation mode auto-scrolls to the conversation corresponding to the selected request; switching back to raw mode auto-scrolls to the selected request
  • Settings panel: toggle default collapse state for tool results and thinking blocks
  • Mobile conversation browsing: in mobile CLI mode, tap the "Conversation Browse" button in the top bar to slide out a read-only conversation view for browsing the complete conversation history on mobile

Statistics Tool

The "Data Statistics" floating panel in the header area:

image
  • Displays cache creation/read counts and cache hit rate
  • Cache rebuild statistics: grouped by reason (TTL, system/tools/model changes, message truncation/modification, key changes) showing counts and cache_creation tokens
  • Tool usage statistics: displays call frequency for each tool sorted by number of calls
  • Skill usage statistics: displays call frequency for each skill sorted by number of calls
  • Supports teammate statistics
  • Concept help (?) icon: click to view built-in documentation for MainAgent, CacheRebuild, and each tool

Log Management

Via the CC-Viewer dropdown menu in the top-left corner: image

Log Compression Regarding logs, the author wants to clarify that the official Anthropic definitions have not been modified, ensuring log integrity. However, since individual log entries from the 1M Opus model can become extremely large in later stages, thanks to certain log optimizations for MainAgent, at least 66% size reduction is achieved without gzip. The parsing method for these compressed logs can be extracted from the current repository.

More Useful Features

image

You can quickly locate your prompts using the sidebar tools.


image

The interesting KV-Cache-Text feature lets you see exactly what Claude sees.


image

You can upload images and describe your needs — Claude's image understanding is incredibly powerful. And as you know, you can paste images directly with Ctrl+V, and your complete content will be displayed in the conversation.


image

You can customize plugins, manage all CC-Viewer processes, and CC-Viewer supports hot-switching to third-party APIs (yes, you can use GLM, Kimi, MiniMax, Qwen, DeepSeek — although the author considers them all quite weak at this point).


image

More features waiting to be discovered... For example: the system supports Agent Team, and has a built-in Code Reviewer. Codex Code Reviewer integration is coming soon (the author highly recommends using Codex to review Claude Code's code).

Auto-Update

CC-Viewer automatically checks for updates on startup (at most once every 4 hours). Within the same major version (e.g., 1.x.x -> 1.y.z), updates are applied automatically and take effect on the next restart. Cross-major-version updates only show a notification.

Auto-update follows Claude Code's global configuration in ~/.claude/settings.json. If Claude Code has auto-updates disabled (autoUpdates: false), CC-Viewer will also skip auto-updates.

Multi-language Support

CC-Viewer supports 18 languages, automatically switching based on system locale:

简体中文 | English | 繁體中文 | 한국어 | Deutsch | Español | Français | Italiano | Dansk | 日本語 | Polski | Русский | العربية | Norsk | Português (Brasil) | ไทย | Türkçe | Українська

License

MIT

About

A request monitoring system for Claude Code that captures and visualizes all API requests and responses in real time. Helps developers monitor their Context for reviewing and debugging during Vibe Coding.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors