UNPKG

claude-usage-tracker

Version:

Advanced analytics for Claude Code usage with cost optimization, conversation length analysis, and rate limit tracking

45 lines 1.54 kB
import type { UsageEntry } from "./types.js"; export interface BudgetPrediction { currentSpend: number; projectedMonthlySpend: number; daysUntilBudgetExhausted: number; confidenceLevel: number; trendDirection: "increasing" | "decreasing" | "stable"; recommendations: string[]; } export interface UsageAnomaly { type: "cost_spike" | "efficiency_drop" | "unusual_pattern"; severity: "low" | "medium" | "high"; description: string; detectedAt: Date; metric: number; baseline: number; deviation: number; } export interface ModelSuggestion { currentModel: string; suggestedModel: string; potentialSavings: number; confidence: number; reasoning: string; conversationContext: string; } export declare class PredictiveAnalyzer { private readonly ANOMALY_THRESHOLD; predictBudgetBurn(entries: UsageEntry[], monthlyBudget?: number): BudgetPrediction; detectUsageAnomalies(entries: UsageEntry[]): UsageAnomaly[]; generateModelSuggestions(entries: UsageEntry[]): ModelSuggestion[]; private getEntriesInRange; private getDailyCosts; private calculateStandardDeviation; private calculatePredictionConfidence; private generateBudgetRecommendations; private getConversationEfficiency; private getWeekendUsage; private getWeekdayUsage; private groupByConversation; private inferCodeContext; private calculateComplexityScore; private getSuggestionForConversation; } //# sourceMappingURL=predictive-analytics.d.ts.map