Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ ccx # launch TUI
ccx --version # print version
```

The Claude data directory is resolved in this order:
1. `--dir` flag
2. `CLAUDE_CONFIG_DIR` environment variable
3. `~/.claude` (default)

## Features

### Session Browser
Expand Down
3 changes: 3 additions & 0 deletions internal/session/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ var (
// ScanSessions scans for Claude Code sessions. If claudeDir is empty,
// defaults to ~/.claude.
func ScanSessions(claudeDir string) ([]Session, error) {
if claudeDir == "" {
claudeDir = os.Getenv("CLAUDE_CONFIG_DIR")
}
if claudeDir == "" {
home, err := os.UserHomeDir()
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions internal/tui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const (

// Config holds application configuration from CLI flags.
type Config struct {
ClaudeDir string // path to Claude data directory (e.g. ~/.claude)
TmuxEnabled bool // enable tmux integration (I, J, live modal)
TmuxAutoLive bool // auto-enter live session in same tmux window on startup
WorktreeDir string // subdirectory name for worktrees (default ".worktree")
Expand Down Expand Up @@ -1090,6 +1091,9 @@ func (a *App) deleteSession(sess session.Session) (tea.Model, tea.Cmd) {
a.copiedMsg = "Delete failed: " + err.Error()
return a, nil
}
os.RemoveAll(filepath.Join(filepath.Dir(sess.FilePath), sess.ID))
os.RemoveAll(filepath.Join(a.config.ClaudeDir, "file-history", sess.ID))
os.RemoveAll(filepath.Join(a.config.ClaudeDir, "tasks", sess.ID))

// Remove from in-memory list and update the list widget
idx := a.sessionList.Index()
Expand Down
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ func main() {
os.Exit(0)
}

if claudeDir == "" {
claudeDir = os.Getenv("CLAUDE_CONFIG_DIR")
}
if claudeDir == "" {
home, err := os.UserHomeDir()
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
claudeDir = home + "/.claude"
}
sessions, err := session.ScanSessions(claudeDir)
if err != nil {
fmt.Fprintf(os.Stderr, "Error scanning sessions: %v\n", err)
Expand All @@ -63,6 +74,7 @@ func main() {
}

app := tui.NewApp(sessions, tui.Config{
ClaudeDir: claudeDir,
TmuxEnabled: tmuxEnabled,
TmuxAutoLive: tmuxAutoLive,
WorktreeDir: worktreeDir,
Expand Down