Package Exports
- ccscope
- ccscope/src/CCScope.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ccscope) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ccscope ๐
Claude Code Scope - Interactive terminal browser for Claude Code conversation transcripts
Overview
ccscope (Claude Code Scope) is a powerful terminal-based application that allows you to browse, analyze, and explore your Claude Code conversation logs. It provides an intuitive interface for navigating through sessions, response times, and tool usage analysis.
Features
- ๐ Interactive Browsing: Navigate through sessions and conversations with vim-like keybindings
- ๐ Rich Analytics: View response times and tool usage statistics
- ๐ Full-text Search: Search across all conversations with highlighting, OR conditions, and regex support
- ๐ Search Results Navigation: Navigate search results with left/right keys when viewing from search
- ๐ Search & Filter: Find specific conversations or filter by project
- ๐ฑ Responsive Design: Adapts to your terminal size with wide and compact layouts
- ๐ง Tool Analysis: Detailed breakdown of tool usage and execution flow
- ๐ Session Metrics: Track conversation duration, response times, and productivity
- ๐ Session Resume: Resume Claude Code sessions directly from ccscope with 'r' key
- ๐ Collapsible Tool Output: Long tool outputs (>20 lines) are collapsed by default, toggle with Ctrl+R
Screenshots
Session List View
๐ 91 Sessions | โฑ๏ธ 10d 23h 19m Duration | ๐ฌ 1815 Convos | ๐ง 39.1k Tools | ๐ฏ 15.3m Tokens
๐ฝ Filters: None | ๐ Sort: Last Activity โ
No. ID Project Conv. Duration Tools Tokens Start Time End Time First Message
------------------------------------------------------------------------------------------------------------------------
โถ 1 4e8df9b8 ccscope 16 31m 25s 197 60.2k 07/21 00:48 07/21 01:45 ้ธๆๆฅญใฎToolsใใๅณโฆ
2 585c655b sms_proto 9 5h 41m 1.3k 934.8k 07/20 18:49 07/21 01:41 Please continue theโฆ
3 52ee85b2 ccscope 52 5h 16m 978 354.1k 07/19 20:57 07/21 00:34 ใคใฅใใฆ
4 5b09d466 sms_proto 12 5h 30m 878 956.8k 07/20 12:10 07/20 18:47 Please continue theโฆ
5 4d7a64c0 frontend 18 6h 1m 1.2k 1.0m 07/19 18:00 07/20 12:07 Please continue theโฆ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ/โ or k/j to select ยท Enter to view details ยท r resume ยท / full-text search ยท f filter ยท s sort ยท h help ยท q exit
Conversation Detail View
๐ฌ 22 Convos | โฑ๏ธ 4h 4m
Selected: [52ee85b2] ccscope
๐ File: /Users/taguchiu/.claude/projects/-Users-taguchiu-Documents-workspace-ccscope/52ee85b2c94a1ee604f8e1e58328ad7db75e7330.jsonl
โถ 1 ๐
07/19 20:57 โ 07/19 21:06 ๐ 8m 39s ๐ง 30 Help me refactor the ViewRenderer component...
2 ๐
07/19 21:06 โ 07/19 21:15 ๐ 8m 51s ๐ง 25 Add support for full-width character display...
3 ๐
07/19 21:15 โ 07/19 21:25 ๐ 9m 48s ๐ง 35 Implement virtual scrolling for large datasets...
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ/โ or k/j to select conversation ยท Enter to view detail ยท โ/โ or h/l switch session ยท r resume ยท s sort ยท Esc back ยท q exit
Full Detail View
[52ee85b2] ccscope [18-66/66] 100%
Conversation #15 of 22
========================================================================================================
๐ค USER [07/19 20:57]:
Help me refactor the ViewRenderer component...
๐ค ASSISTANT [07/19 21:06]:
I'll help you refactor the ViewRenderer component...
โบ Read(file: /src/ViewRenderer.js) [20:58]
โฟ File content...
... +45 lines (ctrl+r to expand)
โบ Edit(file: /src/ViewRenderer.js) [21:02]
โฟ Applied changes successfully
[Compact Continuation at 2024-07-19 21:25:30]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ/โ or k/j 5-line scroll ยท Space/b page down/up ยท g/G top/bottom ยท โ/โ or h/l prev/next conversation ยท r resume ยท Esc back ยท q exit
Installation
Global Installation (Recommended)
npm install -g ccscope
Once installed, you can run ccscope
from anywhere in your terminal.
Quick Start
# Install globally
npm install -g ccscope
# Run ccscope
ccscope
# Or run without installation using npx
npx ccscope@latest
# That's it! ccscope will automatically find your Claude Code transcripts
Local Installation
git clone https://github.com/taguchiu/ccscope.git
cd ccscope
npm install
npm link
Alternative Installation Methods
# Install from GitHub directly
npm install -g git+https://github.com/taguchiu/ccscope.git
# Install specific version
npm install -g ccscope@1.2.2
# Install locally for development
npm install ccscope
Usage
Basic Usage
# Interactive browser mode
ccscope
# Run with npx (no installation required)
npx ccscope
# Show statistics commands
ccscope daily # Daily conversation statistics
ccscope project # Project-grouped statistics
ccscope search "query" # Search across all conversations
# Options
ccscope --help # Show help
# Search examples
ccscope search "async await"
ccscope search "error or warning" # OR search
ccscope search --regex "import.*from" # Regex search
ccscope search --regex "\berror\b" # Word boundary search
Resume Claude Code Sessions
Press r
in any view to resume a Claude Code session:
- Executes
claude -r <session-id>
to continue the conversation
This feature allows you to seamlessly continue conversations discovered through ccscope.
Navigation
Session List View
โ/โ
ork/j
: Navigate up/downEnter
: View session conversationsr
: Resume session withclaude -r
f
: Filter by projects
: Sort sessions (last activity, duration, conversations, start time, project name)/
: Search sessionsh
or?
: Show helpq
: Exit
Conversation Detail View
โ/โ
ork/j
: Navigate conversationsโ/โ
orh/l
: Switch sessionsEnter
: View full conversation detailr
: Resume session withclaude -r
s
: Sort conversations (date/time, duration, tools)Esc
: Back to session list
Full Detail View
โ/โ
ork/j
: Scroll content (5-line increments)Space/b
orPgDn/PgUp
: Page down/upCtrl+F/Ctrl+B
: Page forward/back (vim-style)Ctrl+D/Ctrl+U
: Half-page down/upg/G
: Jump to top/bottomโ/โ
: Previous/next conversation (or navigate search results if from search)Ctrl+R
: Toggle all tool output expansion/collapser
: Resume session withclaude -r
Esc
: Back to conversation list
Search Results View
โ/โ
ork/j
: Navigate search resultsEnter
: View conversation detailEsc
: Back to session listq
: Exit application
Configuration
ccscope automatically discovers Claude Code transcripts in this directory:
~/.claude/projects/
Supported Formats
ccscope reads Claude Code transcript files in JSONL format (.jsonl
extension).
Development
Project Structure
ccscope/
โโโ bin/ # Executable scripts
โ โโโ ccscope # Main CLI entry point
โโโ src/ # Source code
โ โโโ services/ # Service classes
โ โ โโโ ContentExtractor.js
โ โ โโโ ConversationBuilder.js
โ โ โโโ FileDiscoveryService.js
โ โ โโโ ProjectExtractor.js
โ โ โโโ SessionStatisticsCalculator.js
โ โโโ utils/ # Utility functions
โ โ โโโ formatters.js
โ โโโ config.js # Configuration
โ โโโ CacheManager.js # Cache management
โ โโโ FastParser.js # Optimized JSONL parser
โ โโโ SessionManager.js
โ โโโ StateManager.js
โ โโโ ViewRenderer.js
โ โโโ InputHandler.js
โ โโโ ThemeManager.js
โ โโโ MouseEventFilter.js
โ โโโ CCScope.js
โโโ __tests__/ # Test files
โ โโโ helpers/ # Test utilities
โ โโโ *.test.js # Component tests
โโโ .github/ # GitHub Actions workflows
โ โโโ workflows/ # CI/CD pipelines
โโโ CLAUDE.md # Claude Code integration guide
โโโ package.json
โโโ jest.config.js # Jest configuration
โโโ README.md
โโโ README.ja.md
โโโ LICENSE
Architecture
ccscope follows a modular architecture:
- CCScope: Main application orchestrator
- SessionManager: Handles transcript discovery and parsing
- StateManager: Manages application state and navigation
- ViewRenderer: Handles UI rendering and display logic
- InputHandler: Processes keyboard input and key bindings
- ThemeManager: Manages color themes and text formatting
- MouseEventFilter: Prevents mouse event artifacts in terminal output
- CacheManager: Manages persistent caching for improved performance
- FastParser: Optimized JSONL parser for large transcript files
- ConversationBuilder: Builds conversation pairs and merges compact continuations
- ContentExtractor: Extracts and processes message content
- FileDiscoveryService: Discovers transcript files efficiently
- ProjectExtractor: Extracts project information from transcripts
- SessionStatisticsCalculator: Calculates session metrics and statistics
Testing
ccscope includes a comprehensive test suite built with Jest. All major components have unit tests to ensure reliability and maintainability.
Running Tests
# Install dependencies (including dev dependencies)
npm install
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage report
npm run test:coverage
Test Structure
__tests__/
โโโ helpers/ # Test utilities and mocks
โ โโโ testHelpers.js # Common test data and utilities
โ โโโ mockTerminal.js # Mock terminal interface
โโโ SessionManager.test.js
โโโ StateManager.test.js
โโโ ViewRenderer.test.js
โโโ InputHandler.test.js
โโโ MouseEventFilter.test.js
โโโ ThemeManager.test.js
โโโ setup.js # Jest setup configuration
Writing Tests
When contributing new features or fixes, please include tests:
- Unit tests for new functions/methods
- Integration tests for component interactions
- Edge case coverage
- Mock external dependencies (file system, terminal I/O)
Coverage Requirements
The project aims for:
- 80% overall code coverage
- 70% branch coverage
- 80% function coverage
Run npm run test:coverage
to check current coverage levels.
Continuous Integration
All pull requests are automatically tested via GitHub Actions:
- Tests run on multiple Node.js versions (14.x, 16.x, 18.x, 20.x)
- Tests run on multiple platforms (Ubuntu, macOS, Windows)
- Coverage reports are generated and checked against thresholds
- Security audits are performed on dependencies
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- ๐ Report Issues
- ๐ฌ Discussions
- ๐ฆ npm Package