feat(claude): persistent tmux session via cc; drop agentapi helpers - #6
Merged
Conversation
AgentAPI was removed in claude-code Coder module v5, so replace the agentapi attach/restart helpers with a 'cc' command that attaches to (or creates) a persistent, attachable tmux session running Claude Code. Survives terminal disconnects and is reachable over SSH. Adds a tuned ~/.tmux.conf (truecolor, fast ESC, mouse, scrollback) for the session. - dot_bash_aliases: remove 'aa'/agentapi-restart; add cc() with root->vscode hop - fish config: add cc function (desktop parity) - dot_tmux.conf: new
There was a problem hiding this comment.
Pull request overview
Adds a cc helper to run Claude Code inside a persistent, attachable tmux session (replacing the removed AgentAPI attach/restart helpers) and introduces a tmux configuration tuned for this workflow.
Changes:
- Replace AgentAPI bash helpers with a
ccfunction that attaches/creates aclaudetmux session (and falls back to directclaudeif tmux is missing). - Add a fish
ccfunction for parity with bash usage. - Add a new
dot_tmux.confwith truecolor, mouse support, larger scrollback, and resize/status tweaks.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dot_tmux.conf | New tmux defaults aimed at a stable Claude Code TUI experience. |
| dot_config/fish/config.fish.tmpl | Adds cc wrapper for tmux-based Claude sessions in fish. |
| dot_bash_aliases | Removes AgentAPI helpers and introduces bash cc with root→vscode hop. |
…cal/bin mise installs claude-code as a managed tool (shim in ~/.local/share/mise/shims), so the $HOME/.local/bin/claude check false-negatived and exit 1'd, aborting the chezmoi run before update-claude-settings.sh could write ~/.claude/settings.json — which made verify-marketplace.sh fail with 'settings.json not created'.
verify-marketplace.sh runs outside `mise exec`, and mise installs claude-code as a managed tool (shim in ~/.local/share/mise/shims, not ~/.local/bin). Check both locations directly instead of only the non-existent ~/.local/bin/claude.
…d vscode The non-root user is the container's primary user (UID 1000 by devcontainer convention), not necessarily 'vscode'. Resolve it via `id -un 1000` and drop to it only when running as root, so cc is correct whether the runtime container runs the agent as root or already as the non-root user.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the AgentAPI helper aliases with a
cccommand that runs Claude Code in a persistent, attachable tmux session.Context: the Coder
claude-codemodule v5 dropped AgentAPI (the old web/attach layer), so workspaces now launch Claude directly.ccrestores a durable session that survives the web-terminal tab closing/reconnecting and is reachable overssh <ws>.coder.Changes
aa="agentapi attach"andagentapi-restart(); addcc()claude--dangerously-skip-permissionsas root) — no-op on the desktopclaudeif tmux is absentclaudealias unchanged (still launches Claude directly, no tmux)ccfunction for desktop parityNotes
Pairs with an infra-repo change to the Coder
defaulttemplate that points the Claude Code app tile atbash -ic ccand symlinksclaudeinto/usr/local/bin. Workspaces pick this up on next start (they curl install.sh frommain), so merge this before updating workspaces.