跳到正文
DEV Community· dirk lüsebrink·· 3 小時前AI 評分59

作者發佈 ccctl,管理 Claude Code 工作階段與對話

I kept losing my Claude Code sessions, so I wrote ccctl

AI 導讀

作者把自用的 shell 輔助工具整合成 Go 程式 ccctl,管理 Claude Code 工作階段,提供工作階段列表與切換、跨專案對話搜尋、單屏介面及專案搬遷功能。

正文

I use Claude Code all day, which means a lot of sessions: one per project, sometimes three, spread over terminal windows, tabs, tmux panes and multiple screens. Two questions kept coming back. Where is that session I had? And didn't I already talk this through with Claude, a few weeks ago, in some other project?

So I started writing small shell helpers. They grew, they got slow on big sessions, and now they are a single Go binary: ccctl, Claude Code control.

Where is that session?

ccctl ps lists the running sessions, ccctl focus jumps into one

ccctl ps lists every running Claude Code session with its title and state. ccctl focus brings one to the front - the iTerm2 tab, the Terminal.app window or the tmux pane. Tab completion knows the running sessions by title, so I never type a session ID.

Didn't I already have a session on that?

ccctl find searches all sessions

ccctl find searches every conversation in every project. My own history is 1.5 GB from eight months of work, and a search takes about a second. No index yet - that comes next.

Or all of it in one place

ccctl ui: browse projects and sessions, resume one, jump to a running one

ccctl ui shows projects, sessions and the running ones on one screen. Enter resumes a session, or jumps to it while it runs. I really like k9s, so it works the same way, with :views, j/k and Enter.

The one I needed most

Renaming a project directory used to cost me its Claude Code history. ccctl move <dir> <new-path> renames the directory and takes its sessions, memory, settings and prompt history along. --dry-run shows the plan first, and it refuses while Claude Code still runs in there.

The honest part

ccctl is unofficial and not affiliated with Anthropic. It reads the files Claude Code writes under ~/.claude/, and those are not documented. A Claude Code update can change them, and then ccctl needs a fix. I test it with Claude Code 2.1.316 on macOS and Linux. No Windows.

Of course this was written with Claude Code, but I helped a little bit.

Try it

brew install crux/tap/ccctl
# or
go install github.com/crux/ccctl/cmd/ccctl@latest

Code, docs and releases: github.com/crux/ccctl. MIT licensed. Issues and ideas welcome - I use it every day, so I will see them.

來源:DEV Community · dev.to