mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-31 16:49:07 +08:00
- Reduce file size by 53% while keeping essential info - Add session tracking requirements for plan mode - Add Must Follow Rules section with conditional ast-grep usage - Consolidate architecture to multi-file concepts only Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
2.2 KiB
2.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Development Commands
- Install:
yarn install - Development:
yarn dev- Runs Electron app in development mode - Debug:
yarn debug- Starts with debugging enabled, use chrome://inspect - Build Check:
yarn build:check- REQUIRED before commits (lint + test + typecheck) - Test:
yarn test- Run all tests (Vitest) - Single Test:
yarn test:mainoryarn test:renderer - Lint:
yarn lint- Fix linting issues and run typecheck
Architecture
Electron Structure
- Main Process (
src/main/): Node.js backend with services (MCP, Knowledge, Storage, etc.) - Renderer Process (
src/renderer/): React UI with Redux state management - Preload Scripts (
src/preload/): Secure IPC bridge
Key Components
- AI Core (
src/renderer/src/aiCore/): Middleware pipeline for multiple AI providers - Services (
src/main/services/): MCPService, KnowledgeService, WindowService, etc. - Build System: Electron-Vite with experimental rolldown-vite, yarn workspaces
Logging
import { loggerService } from '@logger'
const logger = loggerService.withContext('moduleName')
// Renderer: loggerService.initWindowSource('windowName') first
logger.info('message', CONTEXT)
Session Tracking
When working in plan mode, Claude Code MUST:
-
Create Session File: Create a markdown file in
.sessions/folder with format:YYYY-MM-DD-HH-MM-SS-<feature-name>.md -
Track Progress: After each code patch or significant change, update the session file with:
- What was changed
- Files modified
- Decisions made
- Next steps
-
Keep Updated: The session file must remain current throughout the entire development session
Must Follow Rules
- Search Code: Use
ast-grepfor code pattern searches if available, otherwise usergorgrepfor text-based searches - UI Components: Use HeroUI for new components - antd and styled-components are PROHIBITED
- Quality Gate: Run
yarn build:checkbefore any commits - Session Documentation: Maintain session tracking file when in plan mode