# JCode
jcode is an [[AI Agent Harness]] written in [[Rust]] by Jeremy Huang, under the [[MIT License]]. Its own claim, printed twice at the top of the README: the most RAM efficient harness, and the most intelligent one.
First commit 2026-01-05, with commits landing daily since. Linux, macOS and Windows.
## The efficiency claim
This is the headline, and the numbers are genuinely large. Resident memory (PSS) for a single active session:
| Tool | 1 session | Extra per added session |
|---|---|---|
| jcode (local embedding off) | 27.8 MB | ~9.9 MB |
| jcode | 167.1 MB | ~10.4 MB |
| Codex CLI | 140.0 MB | ~21.6 MB |
| pi | 144.4 MB | ~76.5 MB |
| Cursor Agent | 214.9 MB | ~157.5 MB |
| GitHub Copilot CLI | 333.3 MB | ~158.1 MB |
| OpenCode | 371.5 MB | ~318.4 MB |
| Claude Code | 386.6 MB | ~212.7 MB |
Startup follows the same shape: time to first input is 3512.8 ms for [[Claude Code]] against jcode's baseline, which the README writes up as 72× slower.
Read those multipliers carefully, though. The baseline row is *jcode with local embedding turned off*, so the advertised "13.9× more RAM" for Claude Code is measured against a crippled jcode rather than a working one. Against jcode as it actually ships, the gap is closer to 2.3×. These are also the author's own benchmarks on the author's own machine. The per-session scaling column is the honest standout: about 10 MB per extra session against 200-300 MB, and that one matters if you run many agents at once, which is the whole point of the tool.
## Memory that works like memory
Every turn gets embedded as a semantic vector into a memory graph. Each new turn queries that graph by cosine similarity, and hits are fed straight into the conversation. Optionally a memory sideagent checks the hits are relevant and does extra retrieval before injecting anything.
The point is that recall is **passive**. The agent doesn't call a memory tool and doesn't burn tokens deciding to remember; the relevant material simply shows up. Extraction runs on semantic drift, after K turns, or at session end. Consolidation runs in the background to reorganise and resolve stale or conflicting entries. Explicit memory tools and session search exist too, for when you want to drive it manually.
**Skills work the same way.** They are not all loaded at startup. The conversation is embedded, and a skill gets injected on an embedding hit, exactly like a memory. You can also fire one manually with a tool call or a slash command.
That is the same problem [[AI Agent Skills]] loading solves by convention (load on demand, never everything upfront), handled by the harness instead of by discipline. Worth thinking about for [[Obsidian Starter Kit]], where the "never load all skills upfront" rule currently depends on the agent behaving.
## Swarm
Spawn several agents in one repo and the server coordinates them. When agent A edits a file agent B has already read, B gets notified and can check the diff or ignore it. Agents can DM each other, broadcast to everyone on the server, or broadcast only to agents in that repo.
Agents can also spawn their own swarms. The main agent becomes a coordinator, the spawned ones become workers, and group membership, channels and completion state are managed for you. Headless or headed.
## Self-dev mode
Tell the agent to enter self-dev mode and it edits jcode's own source, builds it, tests it, reloads its own binary, and carries on in your existing sessions. Automatically.
The README recommends a frontier model for this and says plainly that weaker ones make subtle breaking changes in a codebase this size. That's the honest version of a feature most projects would oversell.
## The rest of it, briefly
- **Cross-harness session resume.** Broke a [[Claude Code]] session? Resume it from jcode. Also works for [[Codex CLI]], [[OpenCode]] and [[Pi Mono]].
- **Providers.** OAuth flows for Claude, OpenAI/Codex, Gemini, [[GitHub Copilot]], Azure, Alibaba, Fireworks, MiniMax, plus [[Ollama]] and [[LM Studio]] locally. Named profiles for [[OpenRouter]], DeepSeek, Kimi, Moonshot, OpenCode Zen and others, or any OpenAI-compatible endpoint including self-hosted vLLM.
- **UI.** Side panels the agent can write into or use as a diff viewer, inline [[Mermaid]] rendering, and info widgets that only occupy screen space that was empty anyway. Renders above 1000 fps.
- **Two spin-off projects.** A Rust mermaid renderer with no browser or TypeScript dependency (claimed 1800× faster), and `handterm`, a terminal the author wrote because normal terminals can't do smooth partial-line scrolling with a custom scrollback.
- **Agent grep.** Grep results carry file structure (function names, offsets) so the agent can infer a file's shape without reading it, with adaptive truncation for what it has already seen.
- **Cache-cold warning.** Anthropic's prompt cache goes cold after five minutes; the UI tells you when that happened and flags unexpected cache misses.
- **Browser automation** through a built-in `browser` tool backed by Firefox Agent Bridge.
- **Ambient mode** with schedules, token budgets and work-branch targeting.
- **Planned**: a native iOS app reaching your machine over [[Tailscale]] with [[OpenClaw]]-style features, and a new git-like primitive, on the argument that git was never built for several agents working a dirty tree at once.
## Why I keep this note
Three things, in order of how much they'll matter to me.
**Skills injected by embedding rather than loaded by rule.** This is the one I want to steal. Semantic retrieval decides what the agent sees, so the context stays small without anyone maintaining a discipline about it.
**Per-session memory cost as the real metric.** Not "is this tool light" but "what does the tenth concurrent agent cost me". Once you work in swarms, marginal cost is the only number that matters, and almost nobody publishes it.
**A harness that rewrites itself.** Self-dev mode is either the beginning of something or a very good way to corrupt your own binary. Either way it's the most interesting idea here, and I want to see where it lands in six months.
Worth watching rather than switching to. The pace is fast and the engineering is serious, but the benchmark presentation is doing marketing work the underlying work didn't need.
## References
- [jcode on GitHub](https://github.com/1jehuang/jcode)
- [jcode.sh](https://jcode.sh/)
- [Documentation](https://jcode.sh/docs)
- [mermaid-rs-renderer](https://github.com/1jehuang/mermaid-rs-renderer)
- [handterm](https://github.com/1jehuang/handterm)
## Related
- [[AI Agent Harness]]
- [[Claude Code]]
- [[Codex CLI]]
- [[OpenCode]]
- [[Pi Mono]]
- [[OpenClaw]]
- [[AI Agent Skills]]
- [[Embeddings]]
- [[Rust]]
- [[Open Source]]
- [[MIT License]]