claude-conversation-manager
Version:
A CLI tool for managing Claude Code conversation history with parsing and i18n support
81 lines (80 loc) • 1.92 kB
TypeScript
export interface ConversationSummary {
type: 'summary';
summary: string;
leafUuid: string;
}
export interface ConversationMessage {
parentUuid?: string | null;
isSidechain?: boolean;
userType?: string;
cwd?: string;
sessionId: string;
version?: string;
gitBranch?: string;
type: 'user' | 'assistant';
message: {
role: 'user' | 'assistant';
content: Array<{
type: string;
text: string;
}> | string;
model?: string;
usage?: {
input_tokens: number;
output_tokens: number;
cache_creation_input_tokens?: number;
cache_read_input_tokens?: number;
};
};
isMeta?: boolean;
uuid: string;
timestamp: string;
}
export interface ConversationMetadata {
id: string;
projectPath: string;
workingDirectory: string;
summary: string;
messageCount: number;
fileSize: number;
created: Date;
modified: Date;
isCorrupted: boolean;
corruptionReason?: string;
gitBranch?: string;
}
export interface ConversationFile {
filePath: string;
metadata: ConversationMetadata;
messages: ConversationMessage[];
summary?: ConversationSummary;
}
export interface ManagerConfig {
claudeConfigPath: string;
projectsPath: string;
backupPath: string;
maxBackups: number;
autoBackup: boolean;
}
export interface SearchOptions {
keyword?: string;
project?: string;
dateFrom?: Date;
dateTo?: Date;
minSize?: number;
maxSize?: number;
corrupted?: boolean;
hasGitBranch?: boolean;
}
export interface ExportOptions {
format: 'markdown' | 'json' | 'text';
includeMetadata: boolean;
outputPath?: string;
}
export interface BackupInfo {
timestamp: Date;
filename: string;
size: number;
conversationCount: number;
projectPaths: string[];
}