explaingit

otisworks/batch-kit

Analysis updated 2026-07-24

0TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A command-line tool that sends large batches of documents to Claude at half the normal API cost, using a git-like workflow to automate file processing and result retrieval.

Mindmap

mindmap
  root((repo))
    What it does
      Sends batches to Claude
      Halves API costs
      Retrieves results as JSON
    How it works
      Add files to stage
      Review staged documents
      Send as a single batch
      Fetch results later
    Tech stack
      TypeScript
      Node.js
      Anthropic API
    Use cases
      Process text documents
      Bulk content analysis
      Automated data extraction

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Process folders of text files through Claude for bulk analysis or summarization.

USE CASE 2

Run automated document workflows at reduced API cost using batch processing.

USE CASE 3

Submit large volumes of markdown files for data extraction via a simple command line.

USE CASE 4

Integrate batch document processing into a TypeScript application using the library API.

What is it built with?

TypeScriptNode.jsAnthropic APICLI

How does it compare?

otisworks/batch-kit0xkinno/astraea0xkinno/halcyon
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyhardhard
Complexity2/54/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires Node.js 18 or higher and an Anthropic API key set in your environment or a .env file.

In plain English

batch-kit is a command-line tool and code library that helps you send large batches of documents to Claude for processing at half the normal API cost. It is built for developers using Anthropic's Message Batches API, but it removes the manual work normally involved. Instead of hand-crafting request files, tracking batch identifiers, or writing polling logic, you use a short set of commands that resemble how git works. The workflow has four main steps: add, review, send, and fetch. You start by pointing the tool at a folder of documents and giving it a prompt template with placeholders like {content} for the file text. You can review what is staged, send it as a single batch, and later fetch the results back into a JSON file. The tool keeps a local state directory, similar to git's hidden folder, so it remembers which batch is the most recent and maps each result back to its original filename across terminal sessions. You can use it as a command-line program with npx batch or install it globally for the shorter batch command. It requires Node.js 18 or higher and an Anthropic API key set in your environment or a .env file. There is also a TypeScript library API for programmatic use, letting you add documents, submit batches, wait for completion with polling callbacks, and stream results as they arrive. State is stored locally per directory on the machine you run it from. If you send a batch from one computer, you need that same machine's state folder to use the --latest shorthand later, though you can always fetch by explicit batch ID from anywhere. The tool assumes a single user and non-concurrent usage, with atomic writes to prevent corruption if a process is interrupted. It supports text and markdown files by default, with options to filter by extension, override the model, and set token limits.

Copy-paste prompts

Prompt 1
I have a folder of markdown files I want to summarize. Show me how to use batch-kit to add them, include a prompt template, and fetch the results into a JSON file.
Prompt 2
I want to use the batch-kit TypeScript library API in my project to submit documents to Claude and stream the results as they arrive. Write a code example showing how to set this up.
Prompt 3
I ran `batch send` but lost track of my batch ID. Explain how the local state directory works and how I can use the `--latest` flag to fetch my most recent batch results.
Prompt 4
Help me set up my `.env` file and environment so I can run `npx batch` to process documents with Claude's batch API.

Frequently asked questions

What is batch-kit?

A command-line tool that sends large batches of documents to Claude at half the normal API cost, using a git-like workflow to automate file processing and result retrieval.

What language is batch-kit written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Anthropic API.

How hard is batch-kit to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is batch-kit for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.