Read-only mirror of github.com/ondeinference/ed.
Mirrored from https://github.com/ondeinference/ed.git
Synced Nov 23, 01:00 UTC
ed-claude
Claude as an ACP coding agent that runs inside your app.
It is an ed-acp Profile: Claude's name, prompt, workspace
tools and an Anthropic API-key sign-in. It talks to the Anthropic API with the user's own key,
so you ship no key and pay for no inference. Every session gets ed-acp's tool approvals, fs/*
routed through the client, MCP servers and durable sessions.
use std::sync::Arc;
use agent_client_protocol::Channel;
use ed_acp::ServeOptions;
use ed_claude::{credentials, Claude};
// Once, at startup. In a sandboxed app, a dir inside the container.
credentials::set_dir(app_config_dir.join("edclaude"));
// The key the user pasted into your settings screen.
credentials::store_api_key(&api_key, None)?;
// Serve the agent in process. Run your ACP client on `client_end`.
let (agent_end, client_end) = Channel::duplex();
tokio::spawn(ed_acp::serve(
Arc::new(Claude::new()),
ServeOptions { yolo: false, surface: "app" },
agent_end,
));
Claude::new()hasread_file,write_file,edit_file,list_directoryandrun_command.Claude::without_shell()dropsrun_commandand tells the model so, for hosts that can't start processes (iOS, Mac App Store builds).- Models:
claude-sonnet-5-5(default),claude-opus-5-5andclaude-haiku-5-5, offered in the ACP model picker. - The key lives in one file at mode 0600 in the dir you set. The crate never reads the process
environment, so
OPENAI_*,ONDE_*andED_CLAUDE_*variables don't leak in. - Without a stored key,
authenticatefails withAPI_KEY_NEEDED. Show your key prompt when you see it.logoutdeletes the stored key. ClaudeAuth::with_base_urlpoints the agent at a proxy or a test server. Test withed-acp-testkit's mock endpoint.
This crate uses API keys only. For a Claude subscription, run Anthropic's claude CLI as an
external agent instead, for example through ed-acp-tauri.
Used in production by siGit.
Claude and Anthropic are trademarks of Anthropic, PBC. This crate is not made or endorsed by Anthropic. Use of the Anthropic API follows Anthropic's terms.
Copyright
© 2026 Seto Elkahfi (Onde Inference). Licensed under MIT or Apache-2.0.