{"id":42494377,"url":"https://github.com/1jehuang/jcode","last_synced_at":"2026-05-27T13:02:49.628Z","repository":{"id":332268114,"uuid":"1128204614","full_name":"1jehuang/jcode","owner":"1jehuang","description":"Coding Agent Harness","archived":false,"fork":false,"pushed_at":"2026-05-24T21:46:37.000Z","size":386452,"stargazers_count":6508,"open_issues_count":141,"forks_count":731,"subscribers_count":39,"default_branch":"master","last_synced_at":"2026-05-24T22:26:29.531Z","etag":null,"topics":["ai","claude","cli","coding-agent","llm","mcp","openai","rust","terminal","tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1jehuang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY_DEPENDENCIES.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-05T09:43:36.000Z","updated_at":"2026-05-24T21:49:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/1jehuang/jcode","commit_stats":null,"previous_names":["1jehuang/jcode"],"tags_count":81,"template":false,"template_full_name":null,"purl":"pkg:github/1jehuang/jcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1jehuang%2Fjcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1jehuang%2Fjcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1jehuang%2Fjcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1jehuang%2Fjcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1jehuang","download_url":"https://codeload.github.com/1jehuang/jcode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1jehuang%2Fjcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33566873,"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-05-27T02:00:06.184Z","response_time":53,"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":["ai","claude","cli","coding-agent","llm","mcp","openai","rust","terminal","tui"],"created_at":"2026-01-28T12:36:52.381Z","updated_at":"2026-05-27T13:02:49.609Z","avatar_url":"https://github.com/1jehuang.png","language":"Rust","funding_links":[],"categories":["CLIs","AI开源项目","ai","Repos","🚀 AI Tools for Vim, Neovim, and Terminal","Rust"],"sub_categories":["Usage","AI 工具"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# jcode\n\n[![CI](https://github.com/1jehuang/jcode/actions/workflows/ci.yml/badge.svg)](https://github.com/1jehuang/jcode/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Built with Rust](https://img.shields.io/badge/Built%20with-Rust-orange.svg)](https://www.rust-lang.org/)\n\nA blazing-fast, fully autonomous AI coding agent with a gorgeous TUI,\nmulti-model support, swarm coordination, persistent memory, and 30+ built-in tools -\nall running natively in your terminal.\n\n\u003cbr\u003e\n\n\u003cimg src=\"https://github.com/1jehuang/jcode/releases/download/v0.3.1/jcode_demo_jaguar.avif\" alt=\"jcode demo\" width=\"800\"\u003e\n\n\u003cbr\u003e\n\n[Features](#features) · [Install](#installation) · [Quick Start](#quick-start) · [Further Reading](#further-reading)\n\n\u003c/div\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n## Installation\n\n\u003c/div\u003e\n\n```bash\n# macOS \u0026 Linux\ncurl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash\n```\n\nNeed Windows, Homebrew, source builds, provider setup, or tell your agent to set it up for you?\n[Jump to detailed installation](#detailed-installation).\n\n---\n\n\n\u003cdiv align=\"center\"\u003e\n\n## Performance \u0026 Resource Efficiency\n\n\u003c/div\u003e\n\njcode is built to be as performant and resource efficient as possible. Every metric is optimized to the bone, which is important for scaling multi-session workflows. Here we sample two metrics to show the difference: RAM usage and startup time.\n\n\u003c!-- Add performance demo thumbnail/video link here: spawning many jcode instances and using them in parallel. --\u003e\n\n### Headline numbers\n\n- **jcode uses 7.2× less PSS than pi**\n- **jcode uses 22× less PSS than OpenCode**\n- **jcode uses 25× less PSS than Claude Code**\n- **jcode spawns 44.4× faster than pi**\n- **jcode spawns 66.8× faster than OpenCode**\n- **jcode spawns 24.3× faster than Claude Code**\n\n### Memory benchmarks: 10 simultaneous sessions\n\nMeasured on this Linux machine using real interactive PTY sessions and Linux `/proc` memory stats. For jcode, the number includes both client memory and the incremental memory growth of the shared server, which is the fair comparison for many active sessions.\n\nVersions tested:\n\n- `jcode v0.8.16-dev (161f9fa)`\n- `pi-coding-agent 0.62.0` (`pi`)\n- `opencode 1.0.203`\n- `Claude Code 2.1.86`\n\n### Interactive startup time\n\nMeasured as median **time to first terminal output** across 10 PTY launches on this Linux machine.\n\n\u003cdiv align=\"center\"\u003e\n\n| Tool | Median startup | Range |\n|---|---:|---:|\n| **jcode** | **13.6 ms** | 9.0–16.9 ms |\n| **Claude Code** | **331.1 ms** | 274.5–466.1 ms |\n| **pi** | **603.9 ms** | 522.3–701.4 ms |\n| **opencode** | **908.9 ms** | 785.5–1014.6 ms |\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n| Tool | 1 active session | 10 active sessions | Avg per session at 10 | Architecture |\n|---|---:|---:|---:|---|\n| **jcode** | **28.2 MB RSS** / **8.9 MB PSS** | **433.3 MB RSS** / **140.7 MB PSS** | **43.3 MB RSS** / **14.1 MB PSS** | shared server + lightweight clients |\n| **pi** | **168.4 MB RSS** / **156.2 MB PSS** | **1554.9 MB RSS** / **1010.6 MB PSS** | **155.5 MB RSS** / **101.1 MB PSS** | mostly per-session Node process |\n| **opencode** | **377.0 MB RSS** / **372.6 MB PSS** | **3665.2 MB RSS** / **3135.1 MB PSS** | **366.5 MB RSS** / **313.5 MB PSS** | mostly per-session monolith |\n| **Claude Code** | **677.0 MB RSS** / **674.1 MB PSS** | **4880.9 MB RSS** / **3460.2 MB PSS** | **488.1 MB RSS** / **346.0 MB PSS** | mostly per-session monolith |\n\n\u003c/div\u003e\n\n### Additional memory per added session\n\n\u003cdiv align=\"center\"\u003e\n\n| Tool | Extra RSS per added session | Extra PSS per added session |\n|---|---:|---:|\n| **jcode** | **~45.0 MB** | **~14.6 MB** |\n| **pi** | **~154.1 MB** | **~94.9 MB** |\n| **opencode** | **~365.4 MB** | **~306.9 MB** |\n| **Claude Code** | **~467.1 MB** | **~309.6 MB** |\n\n\u003c/div\u003e\n\n---\n\n## Memory (Agent memory)\n\nJcode embedds each turn/response as a semantic vector. Every turn does queries a graph of memories to efficiently find related memory entries via a cosine similarity check. The embedding hits are fed into the conversation, or optionally uses a memory sideagent which verifies the memories are relevant, and potentially does more work for information retreival before injecting into the conversation. This results in a human like memory system which allows the agent to automatically recall relevant information to the conversation without actively calling memory tools or being a token burner. \not \nTo have memories which are retrieved, they must also be extracted and stored. Every so often (semantic drift, K turns since last extraction, session end, etc), memories are extracted via a memory sideagent, and put into the memory graph. \n\nThe harness also provides explicit memory tools to allow the agent to actively search or store the memory without relying on a passive background process. The harness also provides session search for traditional RAG on previous sessions. \n\nMemories are automatically consolidated every so often via the ambient mode. This reorganizes, checks for stalenss, etc\n\n\u003c!-- Add memory demo thumbnail/video and fuller writeup here. --\u003e\n\n---\n\n## Side Panel and Generated UI\n\nThe side panel can render linked markdown, diagrams, and generated visual output directly inside the terminal workflow.\n\u003cimg width=\"2877\" height=\"1762\" alt=\"image\" src=\"https://github.com/user-attachments/assets/6c7bec81-ef3f-434d-8a7b-d55f8a54e5cf\" /\u003e\n\nTo make this possible, I created a new mermaid rendering library to render diagrams 1800x faster. It has no browser or Typescript dependency. See https://github.com/1jehuang/mermaid-rs-renderer\n\u003c!-- Add side panel / generated UI demo thumbnail/video and fuller writeup here. --\u003e\n\n---\n\n## Swarm\n\nSpawn two or more agents in the same repo, and they will automatically be managed by the server to allow native collaboration. When agent A edits a file that agent B has read (code shifting under its feet), the server notifies agent B. Agent B can ignore it if it is not relevant, or it can check the diff to make sure that it doesn't conflict. Each agent has messaging abilities, capable of DMing just one agent, broadcasting to all other agents hosted by the server, or just agents working in that repo. This allows you to spawn multiple sessions in the same repo, and have all conflicts automatically resolved. \n\n\nhttps://github.com/user-attachments/assets/0b69a309-e4c2-4721-8e4d-b5a93d8865ed\n\nThe above is a video of me manually managing a swarm of 20 agents. Some working on the jcode codebase, and some not. This is only possible with the performance/resource efficiency noted in the above section on client/session memory usage. \n\nAgents are also able to spawn their own swarms autonomously. They have a swarm tool which allows them to spawn in their own teamates to accomplish tasks in parallel. Doing so turns the main agent into a coordinator and the spawned agents into workers. Groups of agents, their messaging channels, their completion statuses, etc are all automatically managed. This can be done headlessly or headed. \n\n\n\u003c!-- Add swarm demo thumbnail/video and fuller writeup here. --\u003e\n\n---\n\n## OAuth and Providers\n\njcode works with subscription-backed OAuth flows and many provider integrations, so you can use the models you already pay for and still fall back to direct API providers when needed.\n\n### Supported built-in login flows\n\n- **Claude** (`jcode login --provider claude`)\n- **OpenAI / ChatGPT / Codex** (`jcode login --provider openai`)\n- **Google Gemini** (`jcode login --provider gemini`)\n- **Google / Gmail tools** (`jcode login --provider google`)\n- **GitHub Copilot** (`jcode login --provider copilot`)\n- **Azure OpenAI** (`jcode login --provider azure`)\n- **Alibaba Cloud Coding Plan** (`jcode login --provider alibaba-coding-plan`)\n- **Fireworks** (`jcode login --provider fireworks`)\n- **MiniMax** (`jcode login --provider minimax`)\n\n\u003cimg width=\"2877\" height=\"1762\" alt=\"Screenshot from 2026-04-02 14-28-51\" src=\"https://github.com/user-attachments/assets/530684c0-9d12-4363-aa0e-1b39a0d4e1be\" /\u003e\nThe above image is the first page of provider logins\n\n### Supported provider\n\n- **Native / first-party style providers:** `jcode`, `claude`, `openai`, `copilot`, `gemini`, `azure`, `alibaba-coding-plan`\n- **Aggregator / compatibility providers:** `openrouter`, `openai-compatible`\n- **Additional provider integrations:** `opencode`, `opencode-go`, `zai` / `kimi`, `302ai`, `baseten`, `cortecs`, `deepseek`, `firmware`, `huggingface`, `moonshotai`, `nebius`, `scaleway`, `stackit`, `groq`, `mistral`, `perplexity`, `togetherai`, `deepinfra`, `fireworks`, `minimax`, `xai`, `lmstudio`, `ollama`, `chutes`, `cerebras`, `cursor`, `antigravity`, `google`\n\n### Auth UX and safety notes\n\n- OAuth flows use **PKCE + state validation**.\n- Secret files are written with **owner-only permissions** when supported.\n- For auth managed by other tools (for example `~/.codex/auth.json`, `~/.claude/.credentials.json`, `~/.local/share/opencode/auth.json`, or `~/.pi/agent/auth.json`), jcode asks before reading them, binds that approval to the external file path, rejects symlinked auth files, and does not rewrite or chmod the original external auth file.\n- OpenAI OAuth uses `http://localhost:1455/auth/callback` by default, with a manual paste fallback if the callback port is unavailable.\n- GitHub Copilot import checks `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, `GITHUB_TOKEN`, `~/.copilot/config.json`, legacy `github-copilot/{hosts,apps}.json`, trusted OpenCode/pi OAuth entries, and finally `gh auth token`.\n- You can verify currently configured providers with `jcode auth-test --all-configured`.\n\nFor more auth details, see [OAUTH.md](OAUTH.md).\n\n---\n\n## Self-Dev\n\njcode is the most customizable coding agent. Why? Because you can just modify the source code directly. Tell your jcode agent to enter self dev mode, and it will start modifying its own source code. Jcode is optimized to iterate on itself. There is significant infrastrucutre around self developement, including being able to make changes, test, build, and hot reload, fully automously without breaking your flow. \n\n\u003c!-- Add self-dev demo thumbnail/video and fuller writeup here. --\u003e\n\n---\n\n## iOS Application for Native OpenClaw\n\nA native iOS implementation of OpenClaw is coming soon.\n\n\u003c!-- Add iOS / native OpenClaw preview and fuller writeup here. --\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n## Quick Start\n\n\u003c/div\u003e\n\n```bash\n# Launch the TUI\njcode\n\n# Run a single command non-interactively\njcode run \"say hello\"\n\n# Resume a previous session by memorable name\njcode --resume fox\n\n# Run as a persistent background server, then attach more clients\njcode serve\njcode connect\n\n# Send voice input from your configured STT command\njcode dictate\n```\n\njcode supports interactive TUI use, non-interactive runs, persistent server/client workflows,\nand hotkey-friendly dictation without requiring a bundled speech-to-text stack.\n\n---\n\n## Further Reading\n\n- [Ambient Mode / OpenClaw](docs/AMBIENT_MODE.md)\n- [Memory Architecture](docs/MEMORY_ARCHITECTURE.md)\n- [Swarm Architecture](docs/SWARM_ARCHITECTURE.md)\n- [Server Architecture](docs/SERVER_ARCHITECTURE.md)\n- [iOS Client Notes](docs/IOS_CLIENT.md)\n- [Safety System](docs/SAFETY_SYSTEM.md)\n- [Windows Notes](docs/WINDOWS.md)\n- [Wrappers and Shell Integration](docs/WRAPPERS.md)\n- [Refactoring Notes](docs/REFACTORING.md)\n\n---\n\n## Detailed Installation\n\n### Setup\n\nIf you want another agent to set up jcode for you, give it this prompt:\n\n```text\nSet up jcode on this machine for me.\n\n1. Detect the operating system, available package managers, and shell environment, then install jcode using the best matching command below instead of referring me somewhere else:\n\n   - macOS with Homebrew available:\n     brew tap 1jehuang/jcode\n     brew install jcode\n\n   - macOS or Linux via install script:\n     curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash\n\n   - Windows PowerShell:\n     irm https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.ps1 | iex\n\n   - From source if the above paths are not appropriate:\n     git clone https://github.com/1jehuang/jcode.git\n     cd jcode\n     cargo build --release\n     scripts/install_release.sh\n\n   - For local self-dev / refactor work on Linux x86_64, prefer:\n     scripts/dev_cargo.sh build --release -p jcode --bin jcode\n     scripts/dev_cargo.sh --print-setup\n     scripts/install_release.sh\n\n2. Verify that `jcode` is on my `PATH`.\n3. Launch `jcode` once in a new terminal window/session to confirm it starts successfully.\n4. Before attempting any interactive login flow, assess which providers are already available non-interactively and prefer those first. Check existing local credentials, config files, CLI sessions, and environment variables such as:\n   - Claude: `~/.jcode/auth.json`, `~/.claude/.credentials.json`, `~/.local/share/opencode/auth.json`, `ANTHROPIC_API_KEY`\n   - OpenAI: `~/.jcode/openai-auth.json`, `~/.codex/auth.json`, `OPENAI_API_KEY`\n   - Gemini: `~/.jcode/gemini_oauth.json`, `~/.gemini/oauth_creds.json`\n   - GitHub Copilot: existing auth under `~/.config/github-copilot/`\n   - Azure OpenAI: `~/.config/jcode/azure-openai.env`, `AZURE_OPENAI_*`, or an existing `az login`\n   - OpenRouter: `OPENROUTER_API_KEY`\n   - Fireworks: `~/.config/jcode/fireworks.env`, `FIREWORKS_API_KEY`\n   - MiniMax: `~/.config/jcode/minimax.env`, `MINIMAX_API_KEY`\n   - Alibaba Cloud Coding Plan: existing jcode config/env if present\n5. Prefer whichever provider is already configured and verify it with `jcode auth-test --all-configured` or a provider-specific auth test when appropriate.\n6. Only if no usable provider is already configured, guide me through the minimal manual step needed:\n   - Claude: `jcode login --provider claude`\n   - GitHub Copilot: `jcode login --provider copilot`\n   - OpenAI: `jcode login --provider openai`\n   - Gemini: `jcode login --provider gemini`\n   - Azure OpenAI: `jcode login --provider azure`\n   - Fireworks: `jcode login --provider fireworks`\n   - MiniMax: `jcode login --provider minimax`\n   - Alibaba Cloud Coding Plan: `jcode login --provider alibaba-coding-plan`\n   - OpenRouter: help me set `OPENROUTER_API_KEY`\n   - Anthropic direct API: help me set `ANTHROPIC_API_KEY`\n7. After setup, run a simple smoke test with `jcode run \"say hello\"` and confirm it works.\n8. Explain any manual step that still needs me, especially browser OAuth, device login, or API key entry.\n```\n\nThis is intended to be a copy-paste bootstrap prompt for jcode itself or any other coding agent.\n\n### Quick Install\n\n```bash\n# macOS \u0026 Linux\ncurl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash\n```\n\n```powershell\n# Windows (PowerShell)\nirm https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.ps1 | iex\n```\n\n### macOS via Homebrew\n\n```bash\nbrew tap 1jehuang/jcode\nbrew install jcode\n```\n\n### From Source (all platforms)\n\n```bash\ngit clone https://github.com/1jehuang/jcode.git\ncd jcode\ncargo build --release\n```\n\nFor local self-dev / refactor work on Linux x86_64, prefer:\n\n```bash\nscripts/dev_cargo.sh build --release -p jcode --bin jcode\nscripts/dev_cargo.sh --print-setup\n```\n\nThat wrapper automatically uses `sccache` when available, prefers a fast\nworking local linker setup (`clang + lld`) instead of assuming every machine's\n`mold` configuration is valid, and can print the active linker/cache setup via\n`--print-setup` so slow-path builds are easier to diagnose.\n\nThen symlink to your PATH:\n\n```bash\nscripts/install_release.sh\n```\n\n### Platform Support\n\n| Platform | Status |\n|---|---|\n| **Linux** x86_64 / aarch64 | Fully supported |\n| **macOS** Apple Silicon \u0026 Intel | Supported |\n| **Windows** x86_64 | Supported (native + WSL2) |\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1jehuang%2Fjcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1jehuang%2Fjcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1jehuang%2Fjcode/lists"}