diff --git a/.beans/claudbg-28ao--move-claudbgdb-and-claudbgtuihistory-to-claudeclau.md b/.beans/claudbg-28ao--move-claudbgdb-and-claudbgtuihistory-to-claudeclau.md index ffaf9d9..548e2e4 100644 --- a/.beans/claudbg-28ao--move-claudbgdb-and-claudbgtuihistory-to-claudeclau.md +++ b/.beans/claudbg-28ao--move-claudbgdb-and-claudbgtuihistory-to-claudeclau.md @@ -1,10 +1,11 @@ --- # claudbg-28ao title: Move claudbg.db and claudbg.tui.history to ~/.claude/claudbg/ -status: todo +status: in-progress type: task +priority: normal created_at: 2026-04-01T16:47:11Z -updated_at: 2026-04-01T16:47:11Z +updated_at: 2026-04-01T17:12:21Z --- Move the claudbg.db database file and claudbg.tui.history filter history file from ~/.claude/ into a dedicated ~/.claude/claudbg/ subdirectory to reduce clutter in the ~/.claude/ root. diff --git a/src/db/connection.rs b/src/db/connection.rs index d1959c2..f920e2f 100644 --- a/src/db/connection.rs +++ b/src/db/connection.rs @@ -33,10 +33,13 @@ pub async fn open_db(path: &PathBuf, clear: bool) -> crate::error::Result PathBuf { let home = std::env::var("HOME").unwrap_or_else(|_| ".".to_string()); - PathBuf::from(home).join(".claude").join("claudbg.db") + PathBuf::from(home) + .join(".claude") + .join("claudbg") + .join("claudbg.db") } #[cfg(test)] @@ -78,11 +81,14 @@ mod tests { assert!(path.exists(), "db file should exist after clear+open"); } - /// `default_db_path` returns a path ending in `.claude/claudbg.db`. + /// `default_db_path` returns a path ending in `.claude/claudbg/claudbg.db`. #[test] fn default_db_path_suffix() { let p = default_db_path(); let s = p.to_string_lossy(); - assert!(s.ends_with(".claude/claudbg.db"), "unexpected path: {s}"); + assert!( + s.ends_with(".claude/claudbg/claudbg.db"), + "unexpected path: {s}" + ); } } diff --git a/src/tui/state.rs b/src/tui/state.rs index 4f33eab..98ce81b 100644 --- a/src/tui/state.rs +++ b/src/tui/state.rs @@ -197,12 +197,13 @@ pub struct AppState { } impl AppState { - /// Return the path to the filter history file: `~/.claude/claudbg.tui.history`. + /// Return the path to the filter history file: `~/.claude/claudbg/claudbg.tui.history`. fn history_file_path() -> Option { let home = std::env::var("HOME").ok()?; Some( PathBuf::from(home) .join(".claude") + .join("claudbg") .join("claudbg.tui.history"), ) }