JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31
  • Score
    100M100P100Q31446F
  • License MIT

Claude Code Scope - Interactive terminal browser for Claude Code conversation transcripts

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 ๐Ÿ”

English | ๆ—ฅๆœฌ่ชž

Claude Code Scope - Interactive terminal browser for Claude Code conversation transcripts

npm version Downloads Node License

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

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.

Session List View

  • โ†‘/โ†“ or k/j: Navigate up/down
  • Enter: View session conversations
  • r: Resume session with claude -r
  • f: Filter by project
  • s: Sort sessions (last activity, duration, conversations, start time, project name)
  • /: Search sessions
  • h or ?: Show help
  • q: Exit

Conversation Detail View

  • โ†‘/โ†“ or k/j: Navigate conversations
  • โ†/โ†’ or h/l: Switch sessions
  • Enter: View full conversation detail
  • r: Resume session with claude -r
  • s: Sort conversations (date/time, duration, tools)
  • Esc: Back to session list

Full Detail View

  • โ†‘/โ†“ or k/j: Scroll content (5-line increments)
  • Space/b or PgDn/PgUp: Page down/up
  • Ctrl+F/Ctrl+B: Page forward/back (vim-style)
  • Ctrl+D/Ctrl+U: Half-page down/up
  • g/G: Jump to top/bottom
  • โ†/โ†’: Previous/next conversation (or navigate search results if from search)
  • Ctrl+R: Toggle all tool output expansion/collapse
  • r: Resume session with claude -r
  • Esc: Back to conversation list

Search Results View

  • โ†‘/โ†“ or k/j: Navigate search results
  • Enter: View conversation detail
  • Esc: Back to session list
  • q: 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:

  1. Unit tests for new functions/methods
  2. Integration tests for component interactions
  3. Edge case coverage
  4. 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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support