pathscale

RustAgentAbstraction — AI skill for Claude Code

AI community

Drive the Claude Code, Codex and GitHub Copilot CLIs headlessly from Rust.

How to install RustAgentAbstraction

This entry records only its repository, not the path inside it, so there is no exact command to give. Open pathscale/RustAgentAbstraction and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What RustAgentAbstraction does

Drive the Claude Code, Codex and GitHub Copilot CLIs headlessly from Rust. One request type, one event stream, one session model.

Alternatives in AI

  • Botmux — Bridge Feishu/Lark to AI coding CLIs — Claude Code, Codex, Gemini, OpenCode… every DM, group or topic spawns i 1.2k ★
  • CliRelay — Self-hosted AI gateway for coding CLIs — one OpenAI/Claude/Gemini/Codex-compatible endpoint, with a multi-tena 1k ★
  • Memory Forge Rs — Stop resetting satisfying AI chats — edit the memory instead 474 ★

README

agent-abstraction

[![crates.io](https://img.shields.io/crates/v/agent-abstraction.svg)](https://crates.io/crates/agent-abstraction) [![docs.rs](https://img.shields.io/docsrs/agent-abstraction)](https://docs.rs/agent-abstraction) [![license](https://img.shields.io/crates/l/agent-abstraction.svg)](LICENSE)

Drive **Claude Code**, **Codex** and **GitHub Copilot** headlessly from Rust: one request type, one event vocabulary, one session model across three CLIs that agree on none of those things.

[dependencies]
agent-abstraction = "0.6"

Every flag mapping and output shape here was verified against the installed CLIs rather than taken from documentation, which is the part that keeps being wrong.

It is a **library, not a CLI**. Your program links it and spawns the agent directly, so nothing marshals a request through a command line and back out of stdout twice.

use agent_abstraction::nagoya::reactor::Reactor;
use agent_abstraction::{Agent, Permission, Request, run};

// The I/O driver for the child's pipes. Yours to start and keep alive while
// runs are in flight; the crate never starts one of its own.
let reactor = Reactor::start()?;

let outcome = run(
    &Request::new(Agent::Claude, "Reply with the single word: pong")
        .model("haiku")
        .permission(Permission::ReadOnly),
    &reactor.handle(),
)
.await?;

println!("{}", outcome.text);          // "pong"
println!("{:?}", outcome.usage.cost_usd);

Every entry point that spawns a CLI (`run`, `stream`, `interrupt`, `Probe::run`, `AuthStatus::check`, `Agent::account_usage`, `Agent::discover_models`) takes that `&reactor.handle()`. The examples below assume a `reactor` like this one is in scope.

What each agent can actually do

Verified live, against `claude 2.1.280`, `codex-cli 0.156.1`, `GitHub Copilot CLI 1.0.88` and `grok 1.0.40`, and not inferred from documentation.

session id fork events system prompt resume flag
Claude Code