mrig Agent
A terminal coding agent that runs on Claude or a model on your own machine.
Overview
A personal, local, model-agnostic agent for the terminal. It writes and changes software, runs commands, works with files and answers questions, using Claude through your API key or a model running on your own hardware. Swapping models means editing a config file, not code.
The problem
Coding agents tie you to one vendor's model and one vendor's idea of what may run on your machine. Anyone who wants to use a model on their own hardware, for privacy or cost, usually has to leave the agent they already know.
The approach
One agent loop, with the model behind a provider interface. Anthropic models and anything that speaks the OpenAI protocol (Ollama, LM Studio, llama.cpp, vLLM, OpenRouter) are configured in JSON, merged from a global file, a per-project file, environment variables and flags, in that order of precedence. Tools that only read run freely; anything that changes files or runs a command asks first, with an "always" answer that adds a rule for the session.
Outcome
- Ships as a single binary per platform: Linux, macOS (Apple Silicon and Intel) and Windows
- The agent loop is tested against a mock model, so the test suite needs no network
- Lint (Biome, zero warnings), typecheck, tests and build run as one command
- Sessions are saved as JSONL and resumable, and per-run token counts and cost are shown
What it does
Any model, by config
Built-in profiles for Claude, OpenAI and local servers, and a generic OpenAI-compatible kind for everything else, each with its own pricing so the cost line is honest.
Permissions you can read
Read, glob and grep never prompt. Edit, write and bash ask, and allow rules such as bash:git status or edit:src/** make the answer permanent. A yolo switch exists and is off by default.
Project memory
Reads AGENTS.md from the working directory up to the git root, plus a personal one, into the system prompt, so conventions travel with the repository.
Headless mode for scripts
mrig -p runs one prompt and exits with a meaningful code: done, error, stopped at the step limit, or aborted.
Ask about mrig Agent
Want something like this, or curious how a piece of it works? Send a note — it reaches me tagged with this project, so I have the context before I reply.