feat(claudbg-28ao): move db and tui history into ~/.claude/claudbg/ subdirectory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Elijah Voigt 2 months ago
parent b4c22d905c
commit 8af7089734

@ -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.

@ -33,10 +33,13 @@ pub async fn open_db(path: &PathBuf, clear: bool) -> crate::error::Result<DbHand
Ok(handle)
}
/// Returns the default database path: `~/.claude/claudbg.db`.
/// Returns the default database path: `~/.claude/claudbg/claudbg.db`.
pub fn default_db_path() -> 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}"
);
}
}

@ -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<PathBuf> {
let home = std::env::var("HOME").ok()?;
Some(
PathBuf::from(home)
.join(".claude")
.join("claudbg")
.join("claudbg.tui.history"),
)
}

Loading…
Cancel
Save