npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-code-cgg

v2.1.88-cgg.0.1

Published

Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal

Readme

CGG Code

GitHub stars npm downloads npm version License: MIT Bun Claude Code

Claude 一个终端内,多模型协作

Claude Code CGG 源码扩展/增强版 Claude, 开箱即用多模型协作,无缝适配Sub agent/Team ,打破跨模型壁垒。主会话与各 Agent(Subagent/Team 成员)独立配置最优的底层模型(如 GPT、Gemini 、Grok 或 Claude)。 无需折腾各种各样的外部脚本,也无需搭建复杂的桥接层与多个CLI终端编排。 所有跨模型调度都在同一cli,同一会话内丝滑完成。

English | 中文

CGG Code 想要解决什么

📝 同一会话,多种模型协作

主会话、Subagent、Team 走的是同一套原生会话体系。上下文不需要手动搬运。

📢 推荐优先用 Team

强烈建议优先使用 Team,而不是只做一次性 subagent 调用。这样 Team 成员在同一会话里可以保留持续上下文和持续记忆,后续还能继续追问、继续分工、继续协作。

⚙️ 一份配置即可

Anthropic、OpenAI、Gemini 可以统一放在一个 settings.json 里管理。

🧠 源码级集成

不是在 Claude Code 外面再套一层脚本,而是直接在源码里接入多 Provider 和多 Agent 协作能力。

🖥️ 适合继续二开

如果你要继续做权限控制、模型接入或工作流改造,直接从源码层改就行。


快速开始

安装

npm install -g claude-code-cgg
cgg

配置 Provider

默认用户配置目录是 ~/.claude/,和 Claude Code 共用同一套用户级配置目录。
顶层 "modelType" 表示主会话默认走哪个 Provider。
各家 Provider 的鉴权、Base URL 和模型名,放在 env 里。

~/.claude/settings.json

{
  "modelType": "anthropic",
  "env": {
    "ANTHROPIC_API_KEY": "sk-ant-xxx",
    "ANTHROPIC_BASE_URL": "https://your-anthropic-endpoint.example.com",
    "OPENAI_API_KEY": "sk-openai-xxx",
    "OPENAI_BASE_URL": "https://your-openai-endpoint.example.com/v1",
    "OPENAI_MODEL": "gpt-5.4",
    "GEMINI_API_KEY": "sk-gemini-xxx",
    "GEMINI_BASE_URL": "https://generativelanguage.googleapis.com/v1beta",
    "GEMINI_MODEL": "gemini-3.1-pro-preview"
  }
}

定义 Agent

Subagent 可以在 frontmatter 里单独指定自己的 providermodel
这意味着主会话继续用 Anthropic 时,某个 Subagent 也可以单独走 OpenAI 或 Gemini。

~/.claude/agents/openai-dev.md

---
name: openai-dev
description: Backend / API reviewer and implementer
provider: openai
model: gpt-5.4
---

You focus on backend design, API contracts, and implementation details.

~/.claude/agents/gemini-dev.md

---
name: gemini-dev
description: Frontend / UX reviewer and implementer
provider: gemini
model: gemini-3.1-pro-preview
---

You focus on UI flow, UX details, and frontend implementation ideas.

开始协作

先让 openai-dev 看一下接口设计,再让 gemini-dev 给一个前端交互方案,最后你来汇总并决定。

⚡ 进阶建议:优先使用 Team 模式

如果你希望子代理在同一会话里保留持续上下文和持续记忆,强烈建议优先使用 Team,而不是只做一次性 subagent 调用。
一次性 subagent 更适合单轮查询或单次执行;Team 成员则可以在当前会话里被继续追问、继续分工、继续协作。

本项目默认已经开启 Team / teammate 相关能力,不需要再额外打开实验开关。


使用方式

和 Claude Code 的交互习惯保持一致,只是模型调度能力更多了。

| 你说的话 | 发生了什么 | | --- | --- | | 让 openai-dev 审一下这个 API 设计 | 主会话调起 OpenAI 子代理,返回审查意见 | | 让 gemini-dev 给个前端交互方案 | 主会话调起 Gemini 子代理,返回 UI 方案 | | 创建一个 product-team,成员是 openai-dev 和 gemini-dev,先讨论注册页方案,再持续协作直到给我结论 | 主会话创建 Team,让成员进入同一会话并保留持续上下文;后续你还可以继续给这个 Team 追加任务或追问 | | openai-dev 写后端,gemini-dev 写前端,你来 review | 多个 Agent 在同一会话里分工协作 |


架构:源码级集成 vs 外部编排

  CGG Code                                外部编排方案
  ─────────────────────────────           ─────────────────────────────

  ┌─── Claude Code 本体 ────────────┐     ┌────┐  ┌────┐  ┌────┐
  │                                 │     │CLI │  │CLI │  │CLI │
  │  ┌───────┐ ┌─────┐ ┌───────┐  │     │ A  │  │ B  │  │ C  │
  │  │Claude │ │ GPT │ │Gemini │  │     └─┬──┘  └─┬──┘  └─┬──┘
  │  └───┬───┘ └──┬──┘ └──┬────┘  │       │       │       │
  │      └────────┼───────┘       │     ┌─┴───────┴───────┴─┐
  │               ▼               │     │  编排脚本 / Hook   │
  │  ┌──────────────────────────┐ │     │  / Daemon / tmux   │
  │  │ 统一会话 · Agent · Team  │ │     └────────────────────┘
  │  └──────────────────────────┘ │
  └───────────────────────────────┘     各自运行环境 / 各自会话
                                        需要桥接通信
  一个 CLI · 一套配置 · 一个会话

| 维度 | CGG Code | 外部编排方案 | | --- | --- | --- | | 接入位置 | Claude Code 内部 | Claude Code 外部 | | 交互入口 | 一个 cgg | 多个 CLI / 多个终端 | | 会话上下文 | 原生共享 | 需要桥接传递 | | Provider 配置 | 一份 settings.json | 常常分散在多个客户端 | | 二开成本 | 直接改源码 | 先处理外围编排层 |


配置目录

CGG Code 默认直接复用 Claude Code 的配置目录约定。
用户级用 ~/.claude/,项目级用项目里的 .claude/

默认就是和 Claude Code 共用的 .claude
只有你显式设置了 CLAUDE_CONFIG_DIR,才会改走别的目录。


开发

本地运行

bun install
bun run dev

构建

bun run build

调试

bun run dev:inspect

启动后在编辑器里 attach 到 Bun Inspector 即可。
如果你之前手动设置过 CLAUDE_CONFIG_DIR,调试前先清掉,不然不会走默认的 ~/.claude


License

本项目遵循 MIT License