Batch

There is no batch() method in the SDK. When a host workflow or agent turn has a clear list of independent, deterministic steps, compose them directly from the session's deterministic helpers (readFile, grep, glob, ls, git) and aggregate the results yourself. That keeps the "batch" fully under your control: no model calls, explicit ordering, and no destructive operations unless you invoke them.

The example below reads package metadata, the changelog, and the release script, then reports version mismatches without editing any files.

Node.js
Python
TypeScript
import { Agent } from '@a3s-lab/code';
const agent = await Agent.create('agent.acl');
const session = agent.session('/path/to/project');
// Node helpers are async — group independent reads with Promise.all.
const [pkg, changelog, releaseScript] = await Promise.all([
session.readFile('package.json'),
session.readFile('CHANGELOG.md'),
session.readFile('scripts/release.sh'),
]);
const pkgVersion = JSON.parse(pkg).version;
const mismatches = [];
if (!changelog.includes(pkgVersion))
mismatches.push(`CHANGELOG.md is missing ${pkgVersion}`);
if (!releaseScript.includes(pkgVersion))
mismatches.push(`release.sh is missing ${pkgVersion}`);
console.log(
mismatches.length ? mismatches.join('\n') : 'All files agree on the version.',
);
session.close();

Do not mix destructive operations into these grouped reads. Any destructive host workflow (writes, git commits, bash) should sit behind explicit application confirmation or your automation gates, constrained with permissionPolicy / permission_policy so no unexpected step runs silently.

When the steps are not independent — each one depends on the previous result and you want an agent to drive them — use session.pipeline(...) instead, which runs the work in stages where each stage receives the prior stage's output.