jcode:最快的开源编码代理

每隔几个月,开源社区就会出现一些新进展,其速度甚至超过了拥有数十亿美元研发预算的公司的努力。jcode 就是最近的例子——它引发了相当大的关注,值得我们深入了解,不过在深入之前,有一些重要的注意事项需要先了解。让我们来分析它是什么、如何工作、做出了哪些声明,以及你在参与之前需要评估的一个风险。

1、什么是 Agent 编排框架(Agent Harness)?

在理解 jcode 之前,你需要了解它取代的是什么。

WITHOUT a harness:

You ──────────────────────────► AI Model
     (raw prompts, no memory,
      no tools, no parallelism)

WITH a harness (Claude Code, Codex CLI, jcode):
You ──► Harness ──────────────► AI Model
         │
         ├── Prompt management    (context, history)
         ├── Tool routing         (bash, browser, files)
         ├── Memory system        (what happened before)
         └── Session management   (parallel agents)

编排框架充当你和模型之间的中间层。它决定了如何组织你的请求、为 AI 提供哪些工具、在各轮对话之间保留哪些信息,以及如何协调多个 Agent 以避免冲突。

Claude Code 和 Codex CLI 都是编排框架。jcode 是一个第三方编排框架,声称可以更好地完成同样的工作,而且关键是,它支持使用你现有的 Claude 或 Codex 订阅登录。

2、jcode 自称能做到什么

benchmarks = {
    "memory_efficiency":  "20x better than Claude Code",
    "spawn_speed":        "63x faster than Codex CLI",
    "customisability":    "more than any existing harness",
    "memory_system":      "built-in, zero setup required",
    "parallel_agents":    "up to 20 simultaneous sessions",
    "native_capabilities": [
        "background task handling",
        "browser automation",
        "codebase search"
    ]
}

这些基准测试尚未经过独立验证。不过,架构方面的声明足够详细,可以进行测试,开源社区已经开始对其进行评估。

讨论最多的一点是:你可以通过 jcode 的 OAuth 流程使用现有的 Claude Max 或 Codex 订阅。你只需付费一次,然后通过更快的界面访问即可。

3、你首先需要了解的风险

这不是一个脚注。它应该放在最前面。

Anthropic 已经因使用 Claude OAuth 搭配未经授权的第三方工具而封禁过账户。jcode 的 Claude 登录功能——jcode login --provider claude——使用的正是这种机制。

jcode's OAuth flow:

Your browser ──► Anthropic login page (legitimate)
                          │
                          ▼
              Token stored at ~/.jcode/auth.json
                          │
                          ▼
              jcode uses token for API calls
                          │
                          ▼
              Anthropic sees: "not an authorised client"
                          │
                          ▼
              Possible account ban

这就是所谓的"灰色地带"。有两种方式可以在没有这种风险的情况下使用 jcode:

safe_options = {
    "direct_api_key": {
        "method": "set ANTHROPIC_API_KEY environment variable",
        "risk":   "none — standard API usage",
        "cost":   "pay per token, no subscription reuse"
    },
    "other_providers": {
        "method": "GitHub Copilot, Gemini, local Ollama, vLLM",
        "risk":   "none for Anthropic ToS",
        "cost":   "depends on provider"
    },
    "claude_oauth": {
        "method": "jcode login --provider claude",
        "risk":   "ACCOUNT BAN — Anthropic has enforced this",
        "cost":   "reuses your Max plan subscription"
    }
}

如果你的 Claude 账户对你来说很重要——而且可能确实如此——请使用 API 密钥方式或其他提供商。本文的其余部分假设你已经做出了审慎的决定。

4、安装 jcode

jcode 使用 Rust 编写。它的速度是设计出来的,不是偶然的。

# macOS & Linux — one-liner install
curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash
# macOS via Homebrew
brew tap 1jehuang/jcode
brew install jcode
# Windows (PowerShell)
irm https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.ps1 | iex
# From source (all platforms) - requires Rust/Cargo
git clone https://github.com/1jehuang/jcode.git
cd jcode
cargo build --release
scripts/install_release.sh
# Verify installation
jcode --version
which jcode   # confirm it's on PATH

安装完成后,在做任何其他事情之前,先运行一个冒烟测试:

jcode run "say hello"
# Expected output: Hello! (or similar)
# If this works, the binary is functional.

5、连接提供商

jcode 会自动检测现有凭证。在提示你登录之前,它会检查:

# What jcode checks automatically, in order:

# Claude
~/.jcode/auth.json
~/.claude/.credentials.json
ANTHROPIC_API_KEY                 ← safest option
# OpenAI
~/.jcode/openai-auth.json
~/.codex/auth.json
OPENAI_API_KEY
# Gemini
~/.jcode/gemini_oauth.json
~/.gemini/oauth_creds.json
# GitHub Copilot
~/.config/github-copilot/
# And more: Azure, Fireworks, MiniMax, Ollama, LM Studio

最干净的 Claude 设置方式——没有 ToS 风险:

# Set your API key (get one at console.anthropic.com)
export ANTHROPIC_API_KEY="sk-ant-..."

# Add to shell profile so it persists
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.zshrc
# Verify jcode detects it
jcode auth-test --all-configured
# Output: ✓ Anthropic (API key) - connected

其他提供商:

# GitHub Copilot — uses your existing subscription
jcode login --provider copilot

# Local Ollama - no API key needed
jcode login --provider ollama
# jcode will prompt for your Ollama base URL (default: http://localhost:11434)
# Google Gemini
jcode login --provider gemini
# Custom local model (vLLM, LM Studio, any OpenAI-compatible endpoint)
jcode login --provider openai-compatible
# Prompts for: API base URL, model name, optional API key

6、核心差异特性:并行 Agent 会话

这就是"Agent 编排框架"在实际中的含义。不是一个 Claude 会话做一件事,jcode 管理一个同时工作的 Agent 池。

# Standard single-agent workflow (what Claude Code does)
claude "refactor the auth module"
# → One agent, sequential, blocks until done

# jcode parallel workflow
jcode serve   # start the persistent background server
              # (keeps agents warm, reuses memory)
# In separate terminals, or programmatically:
jcode connect   # attach a new client to the running server
# What's happening under the hood (conceptual):

class JCodeServer:
    def __init__(self):
        self.agent_pool   = AgentPool(max_agents=20)
        self.memory       = SharedMemoryStore()    # persists across sessions
        self.task_queue   = BackgroundTaskQueue()
    def spawn_agent(self, task: str) -> Agent:
        # 63x faster than cold-starting Codex CLI
        # because agents share memory - no reload from scratch
        agent = self.agent_pool.get_or_create()
        agent.context = self.memory.relevant_context(task)
        return agent
server = JCodeServer()
# Run three agents in parallel:
agent_1 = server.spawn_agent("write unit tests for auth module")
agent_2 = server.spawn_agent("update API documentation")
agent_3 = server.spawn_agent("find and fix TypeScript errors")
# All three run simultaneously
# Results merge back into shared memory

内存效率方面的声明——比 Claude Code 好 20 倍——源于这种共享内存架构。当你用 Claude Code 启动 10 个 Agent 时,每个 Agent 都会独立加载自己的完整上下文。jcode 的 Agent 共享一个中央内存存储,因此第 2 到第 20 个 Agent 的成本仅为第 1 个的一小部分。

7、按名称恢复会话

这是一个较小的功能,但在实践中非常有用:

# jcode assigns memorable names to sessions
# (fox, harbor, castle, etc.)

# Start a session - jcode names it automatically
jcode
# Session: "fox" started
# Days later, resume exactly where you left off
jcode --resume fox
# Restored: 47 conversation turns, 3 files modified, 2 tasks pending
# List all resumable sessions
jcode sessions list
# fox      (2 days ago)  auth-refactor project
# harbor   (5 days ago)  api-documentation
# castle   (1 week ago)  deployment-pipeline

这是内存系统按设计工作的结果。当你关闭终端时,上下文不会消失。

8、连接本地和自托管模型

对于运行本地模型的开发者——Ollama、vLLM、LM Studio——jcode 将它们视为一等公民提供商:

# Ollama (local models)
jcode login --provider ollama
# Enter base URL: http://localhost:11434
# Available models: llama3.2, mistral, deepseek-r1 ...

# vLLM on a LAN server
# Create config file:
cat > ~/.config/jcode/openai-compatible.env << EOF
JCODE_OPENAI_COMPAT_API_BASE=http://192.168.1.50:8000/v1
JCODE_OPENAI_COMPAT_DEFAULT_MODEL=Qwen/Qwen3-Coder-30B-A3B-Instruct
EOF
# LM Studio
jcode login --provider lmstudio
# Uses LM Studio's built-in OpenAI-compatible server

对 localhost 和局域网 IP 支持纯 http:// 很重要——大多数工具即使在本地连接时也强制使用 HTTPS,这意味着仅仅与自己的机器通信就需要进行证书配置。

9、MCP 服务器集成

jcode 从与 Claude Code 相同的位置读取 MCP 配置——因此如果你已经为 Claude Code 设置了 MCP 服务器,它们会自动迁移:

// ~/.jcode/mcp.json  (global MCP config)
// or .jcode/mcp.json (project-local)

{
  "servers": {
    "filesystem": {
      "command": "/usr/local/bin/mcp-server-filesystem",
      "args": ["--root", "/workspace"],
      "env": {},
      "shared": true
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
      }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "POSTGRES_URL": "postgresql://localhost/mydb"
      }
    }
  }
}
# On first launch, jcode auto-imports from Claude Code's config:
# ~/.claude/mcp.json → ~/.jcode/mcp.json

# Verify MCP servers are detected
jcode mcp list
# ✓ filesystem  (connected)
# ✓ github      (connected)
# ✓ postgres    (connected)

10、浏览器自动化

内置浏览器使用——无需 Playwright 设置:

# Check browser status
jcode browser status
# Status: not configured

# Set it up
jcode browser setup
# Installing browser automation dependencies...
# Done. Browser tool is ready.
# Verify
jcode run "use the browser to go to example.com and tell me the page title"
# → Opens browser, navigates, returns title

11、无头和远程环境

适用于 SSH 会话、CI/CD 流水线以及没有显示器的服务器:

# OAuth without a browser — prints URL for manual completion
jcode login --provider gemini --headless
# Open this URL on any device: https://accounts.google.com/...
# Then paste the auth code: _

# Two-step auth for scriptable flows
# Step 1: get the auth URL
jcode login --provider openai --print-auth-url --json
# {"auth_url": "https://auth.openai.com/...", "state": "abc123"}
# Step 2: complete with callback URL (after browser auth)
jcode login --provider openai --callback-url 'http://localhost:1455/auth/callback?code=...'
# GitHub Copilot device flow (works on any headless machine)
jcode login --provider copilot --print-auth-url --json
# {"verification_uri": "https://github.com/login/device",
#  "user_code": "ABCD-1234"}
# → Go to URL, enter code, then:
jcode login --provider copilot --complete

12、引导提示

该项目附带了一个可以直接复制粘贴的提示词,你可以将其提供给任何编码 Agent——包括 Claude Code 本身——来自动设置 jcode:

Set up jcode on this machine for me.

1. Detect the operating system, available package managers,
   and shell environment, then install jcode using the best
   matching command.
2. Verify that `jcode` is on my PATH.
3. Launch `jcode` once to confirm it starts successfully.
4. Check for existing credentials before attempting any
   interactive login.
5. Run a smoke test with `jcode run "say hello"`.

将这段提示词给 Claude Code、Cursor 或任何具有终端访问权限的 Agent。它会自动处理操作系统检测、安装方式选择、凭证发现和验证。

13、客观评估

strengths = [
    "Rust-based — genuinely fast cold starts",
    "Shared memory architecture — parallel agents without redundant context",
    "Multi-provider — Copilot, Gemini, Ollama, vLLM, all in one harness",
    "MCP compatibility — migrates Claude Code config automatically",
    "Resumable sessions — persistent context by default",
    "Headless-friendly — works in CI/CD and SSH environments",
    "Open source — auditable, forkable, not dependent on one company"
]

risks = [
    "Claude OAuth use violates Anthropic ToS - account ban risk is real",
    "Benchmarks (20x, 63x) are unverified by independent sources",
    "Early project - rough edges and breaking changes expected",
    "Community-maintained - no enterprise support or SLA",
]
verdict = """
If you use the API key path or a non-Claude provider,
jcode is a genuinely interesting harness worth evaluating -
especially if you're already managing multiple Claude Code
sessions manually or want to run agent swarms without
building the orchestration layer yourself.
If the Claude OAuth route is the reason you're interested,
the account ban risk is real and documented. Weigh that
against your Claude account's value to you.
The open-source community moving faster than the incumbents?
Accurate. That's what's happening here.
"""

14、参考命令

# Install
curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash

# Connect (safe - API key method)
export ANTHROPIC_API_KEY="sk-ant-..."
jcode auth-test --all-configured
# Core commands
jcode                          # launch interactive TUI
jcode run "your task here"     # single non-interactive command
jcode serve                    # start persistent background server
jcode connect                  # attach new client to server
jcode --resume fox             # resume named session
jcode sessions list            # show all resumable sessions
jcode browser setup            # enable browser automation
jcode mcp list                 # show connected MCP servers
# Parallel agents (the main event)
jcode serve &                  # background server
jcode connect                  # agent 1
jcode connect                  # agent 2 - shares memory with agent 1
jcode connect                  # agent 3 - up to 20 simultaneous

原文链接: jcode: The Open-Source Agent Harness That Wants to Replace Claude Code and Codex CLI

汇智网翻译整理,转载请标明出处