agentreflex
v0.4.0
Published
Give your AI agents reflexes — write the logic once, enforce it on every coding agent.
Maintainers
Readme
MCP gives your agent hands. agentreflex gives it reflexes.
npx agentreflex initWires your reflexes into Claude Code, Cursor, Gemini CLI, Copilot CLI, Windsurf, and OpenCode — and compiles them to advisory AGENTS.md for Codex and everything else. Installed globally (npm i -g agentreflex), the command is arx.
A reflex is logic that fires before the agent runs a tool — written once, in a single file you own:
import { defineReflex, deny, pass } from "@agentreflex/core"
export default defineReflex({
name: "no-force-push",
onToolCall(ctx) {
if (ctx.tool === "Bash" && /git push.*--force/.test(ctx.command ?? ""))
return deny("we agreed: no force-push — open a PR")
return pass()
},
})Beyond single reflexes, arx add installs packs — a product's MCP server (with
auth), skills, session hooks, and reflexes as one unit, secrets prompted once and kept
user-private. arx doctor verifies each pack's MCP server with a real handshake;
arx remove undoes everything.
Commands
| | |
|---|---|
| arx init | scaffold .reflex/ and wire your installed agents |
| arx add <name \| ./path \| github: \| url> | add a reflex or a pack, from the registry or anywhere |
| arx remove <pack> | remove a pack — wiring, files, and stored secrets |
| arx new <name> | scaffold a new reflex |
| arx install / arx uninstall | wire / unwire the dispatcher |
| arx doctor | capability matrix + live MCP checks for installed packs |
| arx dev "<cmd>" | test a command against your reflexes |
Links
- Website — https://agentreflex.dev
- Docs — https://docs.agentreflex.dev
- Source & reflex catalog — https://github.com/agentreflex/agentreflex
MIT
