This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
CheekAI is an AI-generated text detection desktop application built with Rust/Tauri backend and Vue 3 frontend. It analyzes documents (DOCX, TXT) to detect AI-generated content using multiple AI providers (GLM, Deepseek).
# Run the application (development)
npm run tauri dev
# Build for production
npm run tauri build
# Install dependencies
npm install
cd src-tauri && cargo build
# Check Rust code
cd src-tauri && cargo check
# Run Rust tests
cd src-tauri && cargo testBackend (Rust/Tauri) - src-tauri/
src/main.rs- Application entry pointsrc/lib.rs- Tauri command registrationsrc/api/detect.rs- Detection commands (detect_text, detect_dual_mode, preprocess_file)src/api/config.rs- Configuration commands (get_config, save_config, API key management)src/services/detection/- Detection module (refactored into submodules):segment_builder.rs- Builds detection segments from text blocksaggregation.rs- Aggregates segment results, contrast sharpeningcomparison.rs- Compares paragraph and sentence detection resultsdual_mode.rs- Dual mode detection entry pointllm_analyzer.rs- LLM-based text analysis
src/services/text_processor.rs- Text normalization, sentence splitting, token estimationsrc/services/providers.rs- AI provider integration (GLM/Deepseek API calls)src/services/config_store.rs- Configuration storagesrc/models/mod.rs- Data structures and types
Frontend (Vue 3/TypeScript) - src/
src/App.vue- Main application component (orchestrates child components)src/main.ts- Vue app entry pointsrc/components/- UI Components:TitleBar.vue- Window title bar with controlsControlPanel.vue- Detection settings and controlsTextInput.vue- Text input areaResultsPanel.vue- Detection results displaySettingsModal.vue- API key configuration modalLoadingMask.vue- Loading overlay
src/composables/- Vue composition functions:useDetection.ts- Detection logic and stateuseProviders.ts- Provider and API key managementuseFileHandler.ts- File upload handlinguseWindow.ts- Window control functions
src/types/- TypeScript type definitionssrc/styles/- CSS styles and variables
detect_text- Single text detection with full analysisdetect_dual_mode- Dual mode detection (paragraph + sentence level)preprocess_file- File preprocessing (DOCX, TXT extraction)get_config/save_config- Configuration managementget_providers- Available AI providersstore_api_key/get_api_key/delete_api_key- API key management
- Text preprocessing (normalization, language detection)
- Chunking with overlap
- Segment-level analysis (LLM judgment, perplexity, stylometry)
- Aggregation with thresholds (low: 0.65, medium: 0.75, high: 0.85, veryHigh: 0.90)
- Decision derivation (pass/review/flag)
GLM_API_KEY/DEEPSEEK_API_KEY- API keysCHEEKAI_GLM_API_KEY/CHEEKAI_DEEPSEEK_API_KEY- Alternative API key env vars
- Rust: snake_case for functions/variables, CamelCase for structs, 4-space indent
- TypeScript/Vue: camelCase for functions/variables, PascalCase for components
- UI strings are in Chinese - preserve when editing
- Tauri commands use
#[tauri::command]attribute