|
| 1 | +# Claude Viewer |
| 2 | + |
| 3 | +A modern web application for browsing and viewing Claude conversation session transcripts stored in the `.claude/projects` directory. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 📁 **File Tree Navigation**: Browse your Claude sessions organized by project directories |
| 8 | +- 💬 **Chat-Style Interface**: View conversations in a familiar chat format |
| 9 | +- 🌗 **Dark Mode Support**: Toggle between light and dark themes |
| 10 | +- 🔍 **Auto-Expand Navigation**: Direct links to sessions automatically expand the file tree |
| 11 | +- 📋 **Copy Session Paths**: Quickly copy JSONL file paths to clipboard |
| 12 | +- 📝 **Markdown Rendering**: Full markdown support with syntax highlighting |
| 13 | +- 🛠️ **Tool Visualization**: See tool calls and results in formatted blocks |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- Node.js 18.x or higher |
| 18 | +- Yarn package manager |
| 19 | +- Claude Code or Claude Desktop with session files in `~/.claude/projects/` |
| 20 | + |
| 21 | +## Installation |
| 22 | + |
| 23 | +1. Clone the repository: |
| 24 | +```bash |
| 25 | +git clone https://github.com/phpmypython/claude-viewer.git |
| 26 | +cd claude-viewer |
| 27 | +``` |
| 28 | + |
| 29 | +2. Install dependencies: |
| 30 | +```bash |
| 31 | +yarn install |
| 32 | +``` |
| 33 | + |
| 34 | +3. Run the development server: |
| 35 | +```bash |
| 36 | +yarn dev |
| 37 | +``` |
| 38 | + |
| 39 | +4. Open [http://localhost:3000](http://localhost:3000) in your browser |
| 40 | + |
| 41 | +## Session File Location |
| 42 | + |
| 43 | +By default, the application looks for Claude session files in: |
| 44 | +``` |
| 45 | +~/.claude/projects/ |
| 46 | +``` |
| 47 | + |
| 48 | +This is the standard location where Claude Code and Claude Desktop store conversation transcripts in JSONL format. |
| 49 | + |
| 50 | +## Usage |
| 51 | + |
| 52 | +### Browsing Sessions |
| 53 | +- Click on folders in the sidebar to expand/collapse them |
| 54 | +- Click on a session to view the conversation |
| 55 | +- Use the theme toggle button to switch between light and dark mode |
| 56 | + |
| 57 | +### Direct Links |
| 58 | +You can link directly to a specific session using URL parameters: |
| 59 | +``` |
| 60 | +http://localhost:3000/?session=<session-id> |
| 61 | +``` |
| 62 | + |
| 63 | +The application will automatically expand the file tree to show the selected session. |
| 64 | + |
| 65 | +### Copying File Paths |
| 66 | +When viewing a session, hover over it in the sidebar and click the copy icon to copy the full JSONL file path to your clipboard. |
| 67 | + |
| 68 | +## Development |
| 69 | + |
| 70 | +### Running Tests |
| 71 | +```bash |
| 72 | +# Run all tests |
| 73 | +yarn test |
| 74 | + |
| 75 | +# Run tests in watch mode |
| 76 | +yarn test:watch |
| 77 | + |
| 78 | +# Run tests with UI |
| 79 | +yarn test:ui |
| 80 | +``` |
| 81 | + |
| 82 | +### Building for Production |
| 83 | +```bash |
| 84 | +yarn build |
| 85 | +yarn start |
| 86 | +``` |
| 87 | + |
| 88 | +### Project Structure |
| 89 | +``` |
| 90 | +/app # Next.js app directory |
| 91 | + /api # API routes for reading sessions |
| 92 | + page.tsx # Main page component |
| 93 | +/components # React components |
| 94 | + Sidebar.tsx # File tree navigation |
| 95 | + ChatView.tsx # Conversation display |
| 96 | +/tests # Playwright E2E tests |
| 97 | +``` |
| 98 | + |
| 99 | +## Configuration |
| 100 | + |
| 101 | +The application uses sensible defaults and doesn't require configuration for most users. If your Claude sessions are stored in a different location, you'll need to modify the API routes to point to the correct directory. |
| 102 | + |
| 103 | +## Contributing |
| 104 | + |
| 105 | +Contributions are welcome! Please feel free to submit a Pull Request. |
| 106 | + |
| 107 | +## License |
| 108 | + |
| 109 | +MIT License - see LICENSE file for details |
| 110 | + |
| 111 | +## Acknowledgments |
| 112 | + |
| 113 | +Built with: |
| 114 | +- [Next.js](https://nextjs.org/) |
| 115 | +- [React](https://reactjs.org/) |
| 116 | +- [Tailwind CSS](https://tailwindcss.com/) |
| 117 | +- [react-markdown](https://github.com/remarkjs/react-markdown) |
| 118 | +- [Playwright](https://playwright.dev/) for testing |
0 commit comments