{"id":51463667,"url":"https://github.com/xero/cchat","last_synced_at":"2026-07-06T08:30:45.407Z","repository":{"id":346486969,"uuid":"1190185257","full_name":"xero/cchat","owner":"xero","description":"claude.ai chat in the terminal. vi keybinds, session management, file/skill attachments, command/file auto completions, \u0026 task handoff to claude code","archived":false,"fork":false,"pushed_at":"2026-03-24T04:00:07.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T04:54:34.684Z","etag":null,"topics":["agentic","agentic-workflow","claude","claude-ai","claude-chat","claude-cli","claude-code","cli","prompt-toolkit","python","repl","single-file","terminal","tui","tui-app"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-24T03:27:46.000Z","updated_at":"2026-03-24T07:20:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/xero/cchat","commit_stats":null,"previous_names":["xero/cchat"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xero/cchat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xero%2Fcchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xero%2Fcchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xero%2Fcchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xero%2Fcchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xero","download_url":"https://codeload.github.com/xero/cchat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xero%2Fcchat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35184015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic","agentic-workflow","claude","claude-ai","claude-chat","claude-cli","claude-code","cli","prompt-toolkit","python","repl","single-file","terminal","tui","tui-app"],"created_at":"2026-07-06T08:30:44.689Z","updated_at":"2026-07-06T08:30:45.389Z","avatar_url":"https://github.com/xero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cchat\n\n\u003cimg width=\"815\" height=\"544\" alt=\"preview screenshot\" src=\"https://github.com/user-attachments/assets/e8c2a21f-de85-4a47-9793-4ca7b55e1e57\" /\u003e\n\na terminal interface for [claude chat](https://claude.ai/chat) that uses your existing plan subscription. no api tokens needed.\n\ncchat wraps the [`claude`](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview) code cli in a prompt_toolkit shell with vi keybindings, session persistence, file injection, and a planning workflow that produces task files for autonomous agents.\n\n## why\n\nclaude code's interactive mode is fine, but it takes over your terminal and isn't a back and forth conversation. cchat gives you a persistent chat session you control. attach files, switch modes, plan tasks, hand them off to agents to implement, all without leaving your shell.\n\nthe key insight: `claude --print` lets you have conversations using your plan tokens, not api credits. cchat manages the sessions, context, and workflow around that.\n\n## install\n\n```sh\n# deps\npip install prompt_toolkit\n\n# claude code (if you don't have it)\nnpm install -g @anthropic-ai/claude-code\n\n# cchat itself — it's a single file\ncurl -o ~/.local/bin/cchat https://raw.githubusercontent.com/xero/cchat/main/cchat.py\nchmod +x ~/.local/bin/cchat\n```\n\n## usage\n\n```sh\ncchat                    # interactive session (named \"default\")\ncchat myproject          # named session\ncchat myproject --plan   # start in plan mode\ncchat -a \"quick question\" # one-shot, no session\necho \"explain this\" | cchat -a - --file src/app.js  # pipe + file\n```\n\n### profiles\n\ncchat supports multiple claude accounts via profiles. set `CCHAT_PROFILE=work` to switch, or edit `~/.claude_chat/config.json`:\n\n```json\n{\n  \"profiles\": {\n    \"personal\": { \"bin\": \"/usr/local/bin/claude\", \"env\": {} },\n    \"work\": {\n      \"bin\": \"/usr/local/bin/claude\",\n      \"env\": { \"CLAUDE_CONFIG_DIR\": \"~/.claudework\" }\n    }\n  },\n  \"default_profile\": \"personal\"\n}\n```\n\nthe `env` dict is merged into the subprocess environment, so you can point each profile at a different claude config directory with separate auth.\n\n## modes\n\n### chat\n\nthe default. fast, no tool access, just `--print`. good for questions, reviews, quick back-and-forth.\n\n### plan\n\n`/plan` — read-only access to your codebase via `--permission-mode plan`. the agent can read files, grep, check versions, but can't write anything. use this for researching and designing tasks.\n\n### plan (danger)\n\n`/plan danger` — full tool access via `--dangerously-skip-permissions`. the agent can install packages, write test scripts, run your test suite, fetch docs from the web — everything it needs to thoroughly validate a plan before writing it.\n\n\u003e[!WARNING]\n\u003e **danger mode should only be used inside a sandbox.** a devcontainer, docker sandbox, or vm where the blast radius is contained. see [sandboxing](#sandboxing) below.\n\n## commands\n\n| command              | description                           |\n| -------------------- | ------------------------------------- |\n| `/attach \u003cpath\u003e`     | attach file(s) or zip to next message |\n| `/skill \u003cpath\u003e`      | inject a SKILL.md into next message   |\n| `/system [txt]`      | show or set system prompt             |\n| `/plan [danger]`     | switch to planning mode               |\n| `/chat`              | switch to chat mode                   |\n| `/handoff [name]`    | write task.md when plan is ready      |\n| `/compact`           | reset session, start fresh            |\n| `/clear`             | alias for /compact                    |\n| `/sessions`          | list saved sessions                   |\n| `/usage`             | session stats                         |\n| `/help`              | show help                             |\n| `/q` `/quit` `/exit` | save and quit                         |\n\nall commands tab-complete. type `/` then tab to see the full list with descriptions.\n\n## keybindings\n\n| key      | action                                   |\n| -------- | ---------------------------------------- |\n| `ctrl+g` | send message (\"go\")                      |\n| `enter`  | newline (insert mode) or submit /command |\n| `F4`     | toggle vi/emacs mode                     |\n| `ctrl+c` | interrupt running command                |\n| `ctrl+d` | save and quit                            |\n\nvi mode is on by default. the prompt shows `❯` in insert mode and `❮` in normal mode. `dd`, `ciw`, `yy`, `p` — all the usual vi motions work in the input buffer.\n\n## the planning workflow\n\nthe core workflow cchat is built for:\n\n1. **chat** — discuss the problem, get a code review, explore options\n2. **plan** — switch to `/plan` (or `/plan danger` in a sandbox). the agent reads your codebase, installs test deps, validates assumptions, works out the approach with you\n3. **handoff** — run `/handoff` when the plan is solid. the agent writes a `task.md` with numbered steps, gate tests, and a definition of done\n4. **execute** — hand the task to an autonomous agent: `claude -p \"read task.md and begin\" --dangerously-skip-permissions`\n\nthe planning agent does the intellectual work. the executing agent follows instructions. this separation means the executor doesn't need to make judgment calls — everything was decided during planning.\n\n### task format\n\n`/handoff` produces a structured task file:\n\n- **goal** — what and why\n- **orientation** — files to read first, with exact paths\n- **steps** — numbered, imperative, each with a gate test\n- **definition of done** — verifiable checklist\n- **what not to do** — specific prohibitions\n- **orchestration** — (optional) sub-agent coordination for parallel work\n- **raising an issue** — when to stop and ask instead of guess\n\n### orchestration\n\nfor complex tasks, the task file can instruct the executing agent to act as a project manager — spawning sub-agents for independent workstreams, monitoring gate tests, and merging results. no extra tooling needed; the orchestration instructions are just part of the task.\n\n## sandboxing\n\ndanger mode (`/plan danger`) gives the planning agent full system access. **do not run this on your host machine.** use one of:\n\n- [anthropic's devcontainer](https://code.claude.com/docs/en/devcontainer) — the official reference setup\n- [trail of bits devcontainer](https://github.com/trailofbits/claude-code-devcontainer) — security-focused sandbox with `devc` cli\n- [docker sandboxes](https://docs.docker.com/ai/sandboxes/agents/claude-code/) — docker's built-in claude code sandbox support\n\nthe sandbox provides filesystem isolation and network firewall rules. cchat runs inside the container, claude runs inside the container, and your host machine is untouched.\n\n## files\n\n```\n~/.claude_chat/\n├── config.json          # profiles and settings\n├── default.json         # session state (per session name)\n├── default.history      # input history (per session name)\n└── myproject.json       # another session\n```\n\nsessions persist across restarts. `/compact` clears the session state but keeps the history file. sessions are keyed by name — `cchat foo` and `cchat bar` are independent.\n\n## status bar\n\nthe bottom toolbar shows live session state:\n\n- mode icon (green ≡ for chat, cyan ✱ for plan, red ✱ for danger)\n- session name, profile, code session id\n- turn count, skill count\n- armed context count (`ctx:3` when files are attached)\n- quick reference (`^g send`, `/help`)\n\n## CLAUDE.md\n\nif a `CLAUDE.md` or `.claude/CLAUDE.md` exists in the current directory, cchat loads it and appends it to the system prompt via `--append-system-prompt`. this lets you give project-specific context to every message without attaching it manually.\n\n## license\n\n[CC0](https://creativecommons.org/publicdomain/zero/1.0/) — public domain. do whatever you want.\n\n## author\n\n```\n ┌──────────▄▄▄▄▄▄▄─┐\n │  ▄▄▄▄▄▄  █cchat█ │\n │ ▄█~██~█▄ ▀█▀▀▀▀▀ │\n │  ▀█▀▀█▀  ▀       │\n └──────────────────┘\n```\n\nxero harrison [x-e.ro](https://x-e.ro) · [github.com/xero](https://github.com/xero)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxero%2Fcchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxero%2Fcchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxero%2Fcchat/lists"}