This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Year: 2026
- Current iOS: iOS 26 / iPadOS 26
- Latest Devices: iPhone models through iPhone 17 series, iPad models with M4 chips and A17 Pro
This is an iOS application built with Xcode. Use standard Xcode commands to build, run, test, and verify changes when working in a macOS/Xcode environment:
- Build: Open
BisonNotes AI.xcodeprojin Xcode and build (⌘+B) - Run: Build and run on simulator or device (⌘+R)
- Test: Run unit tests with ⌘+U
- Clean: Clean build folder (⌘+Shift+K)
The project uses Swift Package Manager for dependencies, primarily AWS SDK for iOS and MarkdownUI for content formatting.
The app has migrated from legacy file-based storage to Core Data-only architecture. All data is now managed through Core Data entities:
- CoreDataManager: Central data access layer for all entities
- AppDataCoordinator: Unified coordinator for all data operations
- DataMigrationManager: Handles migration from legacy storage on first launch
- RecordingEntry: Core Data entity for audio recordings with metadata
- TranscriptEntry: Core Data entity for transcription data
- SummaryEntry: Core Data entity for AI-generated summaries
- Audio Recording →
AudioRecorderViewModel→ Core Data viaCoreDataManager - Transcription →
EnhancedTranscriptionManager→ Core Data - AI Processing → Various AI engines → Core Data
- Background Processing →
BackgroundProcessingManager→ Core Data
The app supports multiple AI engines:
- Apple Intelligence: Local processing using Apple frameworks
- OpenAI: GPT-4o models for transcription and summarization
- Google AI Studio: Gemini 2.5 models for AI processing
- AWS Bedrock: Claude models (Sonnet 4, Sonnet 4.5, Haiku 4.5) and Llama 4 Maverick
- Whisper: Local Whisper server for transcription
- Ollama: Local AI models for privacy-focused processing
- AWS Transcribe: Cloud-based transcription service
- EnhancedTranscriptionManager: Handles all transcription workflows
- RecordingWorkflowManager: Orchestrates recording → transcription → summary pipeline
- BackgroundProcessingManager: Manages async jobs and background tasks
- PerformanceOptimizer: Battery and memory-aware processing optimization
BisonNotes AI/
├── Models/ # Core Data models and managers
│ ├── CoreDataManager.swift
│ ├── AppDataCoordinator.swift
│ ├── DataMigrationManager.swift
│ └── RecordingWorkflowManager.swift
├── Views/ # SwiftUI views
│ ├── RecordingsView.swift
│ ├── AudioPlayerView.swift
│ ├── AITextView.swift # MarkdownUI-powered AI content rendering
│ └── DataMigrationView.swift
├── ViewModels/ # View model layer
├── OpenAI/ # OpenAI integration
├── AI Engines/ # Various AI service integrations
└── Background/ # Background processing
On first app launch, the DataMigrationManager automatically migrates legacy data from file-based storage to Core Data. This ensures seamless upgrades for existing users.
The app uses a sophisticated background processing system:
- Job queuing for transcription and AI processing
- Battery-aware processing optimization
- Progress tracking for long-running operations
- Error recovery and retry mechanisms
Always use CoreDataManager for data operations. Never access Core Data directly in views.
New AI engines should follow the existing pattern:
- Create service class (e.g.,
NewAIService.swift) - Add settings view (e.g.,
NewAISettingsView.swift) - Integrate with
EnhancedTranscriptionManageror appropriate manager - Add engine monitoring and error handling
The app includes comprehensive AWS Bedrock integration (AWS/AWSBedrockModels.swift):
- Claude 4.5 Haiku: Default model for fast, efficient processing (Standard tier)
- Model ID:
global.anthropic.claude-haiku-4-5-20251001-v1:0(global cross-region inference profile)
- Model ID:
- Claude Sonnet 4/4.5: Premium models for advanced reasoning and analysis
- Model IDs:
global.anthropic.claude-sonnet-4-20250514-v1:0,global.anthropic.claude-sonnet-4-5-20250929-v1:0
- Model IDs:
- Llama 4 Maverick: Meta's economy-tier model with 128K context window
- Model ID:
us.meta.llama4-maverick-17b-instruct-v1:0
- Model ID:
Important:
- Legacy model migration:
claude35Haikuautomatically migrates toclaude45Haiku - Security: Response validation includes 500KB max length and control character sanitization
- Model ID Formats:
- Cross-Region Inference Profiles: Claude and Llama models use
us.*,global.*,eu.*prefixes for cross-region routing - Cross-region profiles provide ~10% cost savings and higher throughput by routing requests to available regions
- Cross-Region Inference Profiles: Claude and Llama models use
Mac Catalyst was removed in Phase 4.3 of the native migration. The iOS target supports only iPhone and iPad destinations; the BisonNotes AI macOS scheme is the sole Mac product.
- AWS SDK for Swift accepts compatible 1.x releases from 1.7.46.
Package.resolvedlocks the reviewed checkout. The former exact 1.6.113 pin worked around an Xcode archive collision between native-macOS Smithy plugin host tools and Catalyst products staged into the sameUninstalledProducts/macosxpaths. With no Catalyst destination, that dual-variant collision cannot occur, so the project can consume current AWS service fixes and model updates without automatically crossing into a breaking 2.x release. - Keep
EXCLUDED_ARCHS = x86_64at the project level. BisonNotes remains Apple Silicon-only because MLX Swift requires Apple Silicon. The vendored llama xcframework still contains its upstream universal macOS slice, but the app does not ship an Intel product. - The native target consumes
Frameworks/llama.xcframework/macos-arm64_x86_64directly. Do not recreate or restore the deletedios-arm64-maccatalystslice.
Each slice's Modules/module.modulemap (e.g. ios-arm64/llama.framework/Modules/module.modulemap) ships with a link "c++" directive. Another SPM dependency (MLX-Swift) already links libc++, so leaving this in causes a Ignoring duplicate libraries: '-lc++' warning at link time. Delete the link "c++" line from every slice's modulemap. The framework binary itself records libc++ as a load dependency, so dyld still resolves it at runtime.
If the xcframework is rebuilt or updated from upstream, reapply this removal across all slices.
The historical Catalyst guards in the bisonbet/textual fork are no longer required by this app and can be dropped when that separate repository is next rebased.
For long-running operations, use BackgroundProcessingManager to queue jobs and track progress.
- Use
PerformanceOptimizerfor battery and memory-aware processing - Implement chunking for large audio files (>5 minutes)
- Use streaming processing for memory efficiency
All file operations should coordinate with Core Data to maintain data integrity. Use EnhancedFileManager for file operations.
For AI-generated content display:
- Use
AITextViewwith MarkdownUI for all AI summaries, transcripts, and formatted content - MarkdownUI handles headers, lists, bold text, links, and complex formatting automatically
- Text preprocessing in
AITextView.cleanTextForMarkdown()removes JSON artifacts and normalizes content - Supports all AI engines: OpenAI, Claude (Bedrock), Gemini, Apple Intelligence, etc.
BisonNotesAIApp.swift: App entry point with Core Data setupContentView.swift: Main tab interfaceModels/CoreDataManager.swift: Core Data access layerModels/AppDataCoordinator.swift: Unified data coordinationViews/AITextView.swift: MarkdownUI-powered content renderingEnhancedTranscriptionManager.swift: Transcription orchestrationBackgroundProcessingManager.swift: Background job managementAWS/AWSBedrockModels.swift: AWS Bedrock model definitions and API handlingFutureAIEngines.swift: AI engine implementations including AWS BedrockAISettingsView.swift: AI engine configuration UIBisonNotes_AI.xcdatamodeld/: Core Data model definitions