agentreflex
Give your AI agents reflexes.
Guardrails and logic that fire before the agent acts — written once, enforced on every coding agent.
MCP gives your agent hands. agentreflex gives it reflexes.
npx agentreflex init
Wires 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()
},
})
Commands
arx init | scaffold .reflex/ and wire your installed agents |
arx add <name | ./path | github: | url> | add a reflex from the catalog or anywhere |
arx new <name> | scaffold a new reflex |
arx install / arx uninstall | wire / unwire the dispatcher |
arx doctor | capability matrix for your agents |
arx dev "<cmd>" | test a command against your reflexes |
Links
MIT