Agent Session
inixiative/agent-session
Sessões persistentes para agentes de código com captura completa de eventos
Ver no GitHubFramework TypeScript para orquestrar agentes de código (Claude Code, Codex, Gemini, Grok) como sessões persistentes e multi-turn, capturando e classificando cada evento (texto, pensamento, tool calls, resultados). Ideal para harnesses de avaliação, comparação de agentes e orquestração multi-agente sem dependências externas.
Instalação
npx convez-ai inixiative/agent-session1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Harnesses de avaliação e benchmarking de agentes de IA
- Orquestração de trabalhos multi-turn entre diferentes runtimes
- Comparação de performance e comportamento entre Claude Code, Codex, Gemini e Grok
- Automação de tarefas de desenvolvimento com CLI agents em containers
Veredito

Solução robusta para quem precisa de controle fino sobre agentes de código em produção. Abstração bem pensada que unifica múltiplos runtimes com event streaming classificado — excelente para benchmarks e orquestração, mas requer familiaridade com TypeScript e CLI agents.
README
A tradução para o português deste README ainda está na fila.
@inixiative/agent-session
Drive coding-agent CLIs as persistent, streaming, event-captured sessions — one interface, any agent. Claude Code and Codex today; Gemini and Grok planned.
Most ways to script a coding agent are one-shot (claude -p "…") and lose the
process. agent-session keeps a single long-lived agent process, streams turns
in over stdin, and classifies every event coming back — text, thinking,
tool calls, tool results, usage — so you can drive multi-turn work and capture
exactly what the agent did. Built for eval harnesses, agent comparisons, and
multi-agent orchestration.
import { ClaudeCodeSession } from "@inixiative/agent-session";
const session = new ClaudeCodeSession({
cwd: "/path/to/workdir",
model: "sonnet",
permissionMode: "bypassPermissions",
});
await session.start();
const result = await session.send("Build a CLI that …");
console.log(result.content); // final text
console.log(result.tokens); // { input, output }
for (const e of result.events) { // full classified event stream
if (e.kind === "tool_use") console.log("tool:", e.toolName);
}
session.kill();
Why it's different
- Persistent, multi-turn. One process per session;
send()per turn, resolves on the runtime'sresultevent. Not one-shot-p. - Full event capture. A normalized
SessionEventtaxonomy (text/thinking/tool_use/tool_result/result/error/session_compact) — the same shape regardless of runtime. - Subscription auth, no API billing. The Claude Code adapter strips
ANTHROPIC_API_KEYand authenticates via the CLI's subscription / anCLAUDE_CODE_OAUTH_TOKENfromclaude setup-token— works headless and in containers. - fork / resume / interrupt and pre-send hooks (rewrite the outgoing message — e.g. inject just-in-time context per turn).
- Zero dependencies. Just Bun + the agent CLI you're driving.
Interface
HarnessSession is the provider-agnostic contract (start / send / kill /
fork / interrupt + an event handler). ClaudeCodeSession implements it over
claude --print --input-format stream-json --output-format stream-json.
Roadmap
| Runtime | Status |
|---|---|
| Claude Code | ✅ shipped |
Codex CLI (codex mcp-server, JSON-RPC) | ✅ shipped (CodexSession; CodexAppServerSession experimental) |
| Gemini CLI | planned |
| Grok CLI | planned (when its headless/stream mode matures) |
Opaque runtimes degrade gracefully — fewer event types, never a hard failure.
Provenance
Extracted from inixiative/foundry,
where this drives the Artificer session. Consumed by foundry, foundry-oracle,
and the inixiative bench.
License
MIT