cc kit as a sourced ~/.config/claudedo/cc.sh (bash+zsh, forced explicit names). opt-in rc autostart guarded by CLAUDEDO_AUTOSTART + an optional systemd user unit. install.sh is idempotent: WSL audio deps, ~/.asoundrc pulse shim, audio verify, model prime, and source-line rc wiring with backups. Signed-off-by: disqualifier <dev@disqualifier.me>
68 lines
2.0 KiB
Bash
68 lines
2.0 KiB
Bash
# claudedo cc kit — claude-code-in-tmux session helpers.
|
|
# POSIX sh; sources cleanly under bash and zsh. side-effect-free on source
|
|
# (function definitions only — nothing runs at source time).
|
|
#
|
|
# every command REQUIRES an explicit project name. the session is always
|
|
# "claude-<name>", a stable speakable handle: "cc libs" -> claude-libs, which the
|
|
# voice daemon targets with "claudedo target libs" / "switch libs". the name->session
|
|
# mapping here MUST match target.py's session_name() in the daemon.
|
|
#
|
|
# cc <name> start or reattach to claude-<name>; writes ~/.claude-active
|
|
# ccr <name> reattach only (error if it doesn't exist); writes ~/.claude-active
|
|
# ccl list running claude- sessions
|
|
# cck <name> kill claude-<name>
|
|
# cckl kill ALL claude- sessions
|
|
|
|
cc() {
|
|
if [ -z "$1" ]; then
|
|
echo "usage: cc <project-name>" >&2
|
|
return 1
|
|
fi
|
|
session="claude-$1"
|
|
echo "$session" > "$HOME/.claude-active"
|
|
if tmux has-session -t "$session" 2>/dev/null; then
|
|
tmux attach -t "$session"
|
|
else
|
|
tmux new-session -s "$session" "claude"
|
|
fi
|
|
}
|
|
|
|
ccr() {
|
|
if [ -z "$1" ]; then
|
|
echo "usage: ccr <project-name>" >&2
|
|
return 1
|
|
fi
|
|
session="claude-$1"
|
|
if tmux has-session -t "$session" 2>/dev/null; then
|
|
echo "$session" > "$HOME/.claude-active"
|
|
tmux attach -t "$session"
|
|
else
|
|
echo "no session '$session' — run 'cc $1' to start one" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
ccl() {
|
|
tmux ls 2>/dev/null | grep '^claude-' || echo "no claude sessions running"
|
|
}
|
|
|
|
cck() {
|
|
if [ -z "$1" ]; then
|
|
echo "usage: cck <project-name>" >&2
|
|
return 1
|
|
fi
|
|
session="claude-$1"
|
|
if tmux kill-session -t "$session" 2>/dev/null; then
|
|
echo "killed $session"
|
|
else
|
|
echo "no session '$session'" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
cckl() {
|
|
tmux ls 2>/dev/null | grep '^claude-' | cut -d: -f1 | while read -r s; do
|
|
tmux kill-session -t "$s" && echo "killed $s"
|
|
done
|
|
}
|