This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a CLI wrapper for Claude (Anthropic's AI assistant) that provides a terminal UI for managing multiple Claude sessions across multiple Git repositories. Built with TypeScript and Ink (React for CLI), it enables easy session management, repository management, Git worktree integration, and Claude CLI settings management through an interactive menu interface. The project uses tmux for terminal multiplexing and session management.
This project uses pnpm as the package manager and Biome for linting/formatting.
The project includes custom slash commands for Claude:
/publish <version>- Update version, commit, tag, publish to npm, and push (see.claude/commands/publish.md)
pnpm run build- Compile TypeScript to JavaScript (output indist/)pnpm run dev- Start TypeScript compiler in watch mode for developmentpnpm run start- Run the compiled application fromdist/index.js
pnpm test- Run all tests using Vitestpnpm test:watch- Run tests in watch modepnpm test:coverage- Generate test coverage report
pnpm run format- Format code using Biomepnpm run lint- Lint and auto-fix issues using Biomepnpm run check- Run Biome checks without auto-fixing
- Uses pnpm v10.11.0 as specified in packageManager field
- Workspace configuration in
pnpm-workspace.yamlwith built dependencies restriction - Published to npm as
@nomnel/cccc
- Target: ES2022 with ES modules (
"type": "module"in package.json) - Strict mode enabled with additional safety checks (
noUncheckedIndexedAccess,noImplicitReturns, etc.) - Source files in
src/, compiled output indist/ - Test files co-located with source files using
.test.ts(x)extension
- Uses Ink v3 - React-based framework for building CLI interfaces
- React 19.1.0 for component development
- Components located in
src/components/ - Main entry point:
src/index.tsx(interactive UI) - CLI entry point:
src/cli.tsx(command-line interface) - Binary entry point:
bin/cccc(dispatches to CLI or UI)
- Custom Hooks Pattern: Business logic extracted into reusable hooks
useSessionManager: Manages Claude session lifecycleuseEventListeners: Handles terminal event managementuseTerminalController: Controls terminal processes via tmux
- Functional Components: All React components are functional with hooks
- Type Safety: Comprehensive TypeScript types in
src/types.ts - Multi-Repository Support: Configuration stored in
~/.config/cccc/settings.json - CLI Command Handler: Separate CLI entry point at
src/cli.tsxfor repository management
- tmux: Terminal multiplexer for managing Claude CLI sessions (replaces node-pty)
strip-ansi: Handles ANSI escape sequences in terminal outputink-text-input: Provides text input component for terminal UI- Testing: Vitest with @testing-library/react and ink-testing-library
configUtils: Manages repository configuration in~/.config/cccc/settings.jsongitUtils: Git operations with support for multiple repositoriestmuxUtils: Tmux session management, pane control, and output monitoringsessionUtils: Session status detection and output filteringsettingsUtils: Claude CLI settings file management (supports multiple settings.*.json files)
- Uses Biome for formatting and linting with tab indentation
- Double quotes for JavaScript/TypeScript strings
- Import organization enabled
- Git integration enabled for VCS-aware operations
- All imports use
.jsextension (ES modules requirement)
bin/
└── cccc # Binary entry point
src/
├── cli.tsx # CLI command handler
├── index.tsx # Main interactive UI
├── types.ts # TypeScript type definitions
├── constants.ts # Application constants
├── utils.ts # General utility functions
├── test-setup.ts # Test configuration for Vitest
├── components/ # React components
│ ├── ExitConfirmation.tsx # Exit confirmation dialog
│ ├── Menu.tsx # Main menu component
│ ├── SessionSelector.tsx # Claude session selector
│ ├── SettingsSelector.tsx # Claude CLI settings selector
│ ├── WorktreeManager.tsx # Git worktree manager
│ └── WorktreeMenu.tsx # Worktree menu interface
├── hooks/ # Custom React hooks
│ ├── useSessionManager.ts
│ ├── useEventListeners.ts
│ └── useTerminalController.ts
└── utils/ # Utility functions
├── configUtils.ts # Repository configuration
├── gitUtils.ts # Git operations
├── sessionUtils.ts # Session management utilities
├── settingsUtils.ts # Settings file management
└── tmuxUtils.ts # Tmux integration
.claude/
└── commands/ # Custom Claude commands
└── publish.md # npm publish workflow