claude-usage-tracker
Version:
Advanced analytics for Claude Code usage with cost optimization, conversation length analysis, and rate limit tracking
48 lines • 1.45 kB
TypeScript
export interface LiveStats {
todayTotal: number;
todayCost: number;
weekTotal: number;
weekCost: number;
lastConversationCost: number;
lastConversationModel: string;
burnRate: number;
totalConversationsToday: number;
averageCostPerConversation: number;
lastUpdated: Date;
}
export interface ConversationEvent {
conversationId: string;
model: string;
cost: number;
tokens: number;
timestamp: Date;
efficiency: "high" | "medium" | "low";
}
export declare class UsageWatcher {
private lastStats;
private watchers;
private isWatching;
private updateInterval;
private conversationHistory;
private lastProcessedTime;
private dataLoader;
private allEntries;
private tokenHistory;
private hourlyUsage;
private dailyCosts;
private fiveMinuteTokens;
startWatching(callback: (stats: LiveStats, recentConversations: ConversationEvent[]) => void): Promise<void>;
private handleFileChange;
private calculateEfficiency;
private updateStats;
stopWatching(): void;
formatLiveDisplay(stats: LiveStats, recentConversations: ConversationEvent[]): string;
private formatTokens;
private getTimeAgo;
private getModelUsageDistribution;
private initializeTokenHistory;
private initializeDailyCosts;
private updateFiveMinuteTokens;
private calculateProjections;
}
//# sourceMappingURL=watch-monitor.d.ts.map