pub struct ClaudeConvo { /* private fields */ }Expand description
High-level interface for reading Claude conversations.
This is the primary entry point for most use cases. It provides convenient methods for reading conversations, listing projects, and accessing conversation history.
§Example
use toolpath_claude::ClaudeConvo;
let manager = ClaudeConvo::new();
// List all projects
let projects = manager.list_projects()?;
// Read a conversation
let convo = manager.read_conversation(
"/Users/alex/project",
"session-uuid"
)?;
println!("Conversation has {} messages", convo.message_count());Implementations§
Source§impl ClaudeConvo
impl ClaudeConvo
Sourcepub fn with_resolver(resolver: PathResolver) -> Self
pub fn with_resolver(resolver: PathResolver) -> Self
Creates a ClaudeConvo manager with a custom path resolver.
This is useful for testing or when working with non-standard paths.
§Example
use toolpath_claude::{ClaudeConvo, PathResolver};
let resolver = PathResolver::new()
.with_home("/custom/home")
.with_claude_dir("/custom/.claude");
let manager = ClaudeConvo::with_resolver(resolver);Sourcepub fn resolver(&self) -> &PathResolver
pub fn resolver(&self) -> &PathResolver
Returns a reference to the path resolver.
Sourcepub fn read_conversation(
&self,
project_path: &str,
session_id: &str,
) -> Result<Conversation>
pub fn read_conversation( &self, project_path: &str, session_id: &str, ) -> Result<Conversation>
Sourcepub fn read_conversation_metadata(
&self,
project_path: &str,
session_id: &str,
) -> Result<ConversationMetadata>
pub fn read_conversation_metadata( &self, project_path: &str, session_id: &str, ) -> Result<ConversationMetadata>
Reads conversation metadata without loading the full content.
This is more efficient when you only need basic information about a conversation.
Sourcepub fn list_conversations(&self, project_path: &str) -> Result<Vec<String>>
pub fn list_conversations(&self, project_path: &str) -> Result<Vec<String>>
Lists all conversation session IDs for a project.
Sourcepub fn list_conversation_metadata(
&self,
project_path: &str,
) -> Result<Vec<ConversationMetadata>>
pub fn list_conversation_metadata( &self, project_path: &str, ) -> Result<Vec<ConversationMetadata>>
Lists metadata for all conversations in a project.
Results are sorted by last activity (most recent first).
Sourcepub fn list_projects(&self) -> Result<Vec<String>>
pub fn list_projects(&self) -> Result<Vec<String>>
Lists all projects that have conversations.
Returns the original project paths (e.g., “/Users/alex/project”).
Sourcepub fn read_history(&self) -> Result<Vec<HistoryEntry>>
pub fn read_history(&self) -> Result<Vec<HistoryEntry>>
Reads the global history file.
The history file contains a record of all queries across all projects.
Sourcepub fn claude_dir_path(&self) -> Result<PathBuf>
pub fn claude_dir_path(&self) -> Result<PathBuf>
Returns the path to the Claude directory.
Sourcepub fn conversation_exists(
&self,
project_path: &str,
session_id: &str,
) -> Result<bool>
pub fn conversation_exists( &self, project_path: &str, session_id: &str, ) -> Result<bool>
Checks if a specific conversation exists.
Sourcepub fn project_exists(&self, project_path: &str) -> bool
pub fn project_exists(&self, project_path: &str) -> bool
Checks if a project directory exists.
Sourcepub fn query<'a>(&self, conversation: &'a Conversation) -> ConversationQuery<'a>
pub fn query<'a>(&self, conversation: &'a Conversation) -> ConversationQuery<'a>
Creates a query builder for a conversation.
Sourcepub fn query_history<'a>(&self, history: &'a [HistoryEntry]) -> HistoryQuery<'a>
pub fn query_history<'a>(&self, history: &'a [HistoryEntry]) -> HistoryQuery<'a>
Creates a query builder for history entries.
Sourcepub fn read_all_conversations(
&self,
project_path: &str,
) -> Result<Vec<Conversation>>
pub fn read_all_conversations( &self, project_path: &str, ) -> Result<Vec<Conversation>>
Reads all conversations for a project.
Returns a vector of conversations sorted by last activity.
Sourcepub fn most_recent_conversation(
&self,
project_path: &str,
) -> Result<Option<Conversation>>
pub fn most_recent_conversation( &self, project_path: &str, ) -> Result<Option<Conversation>>
Gets the most recent conversation for a project.
Sourcepub fn find_conversations_with_text(
&self,
project_path: &str,
search_text: &str,
) -> Result<Vec<Conversation>>
pub fn find_conversations_with_text( &self, project_path: &str, search_text: &str, ) -> Result<Vec<Conversation>>
Finds conversations that contain specific text.
Trait Implementations§
Source§impl Clone for ClaudeConvo
impl Clone for ClaudeConvo
Source§fn clone(&self) -> ClaudeConvo
fn clone(&self) -> ClaudeConvo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more