Skip to main content

ccs/
lib.rs

1pub mod cli;
2pub mod recent;
3pub mod resume;
4pub mod search;
5pub mod session;
6pub mod tree;
7pub mod tui;
8pub mod update;
9
10pub fn get_search_paths() -> Vec<String> {
11    let mut search_paths = Vec::new();
12
13    if let Ok(custom_path) = std::env::var("CCFS_SEARCH_PATH") {
14        search_paths.push(custom_path);
15    } else {
16        // Claude Code CLI sessions
17        if let Some(cli_path) = dirs::home_dir()
18            .map(|h| h.join(".claude").join("projects"))
19            .and_then(|p| p.to_str().map(|s| s.to_string()))
20        {
21            search_paths.push(cli_path);
22        }
23
24        // Claude Desktop sessions (macOS)
25        if let Some(desktop_path) = dirs::home_dir()
26            .map(|h| h.join("Library/Application Support/Claude/local-agent-mode-sessions"))
27            .and_then(|p| p.to_str().map(|s| s.to_string()))
28        {
29            search_paths.push(desktop_path);
30        }
31
32        // Fallback if no paths found
33        if search_paths.is_empty() {
34            search_paths.push("~/.claude/projects".to_string());
35        }
36    }
37
38    search_paths
39}