Coding agents edit files, run commands, and call tools on your behalf — each through
its own hook system, none of which talk to each other. agentreflex is the
reflex layer that sits under all of them: write an instinct once, and it fires
natively in every agent you use.
A reflex is the thing you'd do by hand the moment an agent acts — reach for the
test, flinch at a force-push, refuse to read a .env, pause before prod. Not advice
the model can ignore. Deterministic code that sees every tool call and decides,
before it happens.
| Layer | The question it answers | Where it lives |
|---|---|---|
| Instructions | What should the agent know? | AGENTS.md |
| Skills / tools | What can it reach and do? | MCP, skills |
| Reflexes | What would you do the moment it acts? | agentreflex |
import { defineReflex, deny, pass } from "@agentreflex/core";
export default defineReflex({
name: "no-force-push",
onToolCall(ctx) {
if (ctx.tool === "Bash" && /git\s+push\b.*--force\b/.test(ctx.command ?? ""))
return deny("no force-push — open a PR instead");
return pass();
},
});agentreflex compiles it into each agent's native hook, so the same instinct fires
across Claude Code · Cursor · Copilot CLI · Gemini CLI · Windsurf · OpenCode —
and as a compiled AGENTS.md advisory everywhere else.
npx agentreflex initOne command wires every agent in your repo to your .reflex/ folder. After that,
editing a reflex is instantly live — no rebuild, no re-publish.
| agentreflex | the runtime, CLI, adapters, and official reflexes |
| awesome-reflexes | the community catalog — npx agentreflex add <name> |
| agentreflex.dev | the home page + live playground |
| docs.agentreflex.dev | guides, concepts, the spec |
no-force-push · no-rm-rf · no-secrets · ask-on-prod · stay-in-repo ·
conventional-commits · recover (snapshots files before edits) ·
abide (your human↔agent working agreement, enforced) — browse the catalog →
Reflexes run in your dev loop, so the runtime is built to be trusted: agentreflex add
shows the code and the reflex's declared capabilities before anything is wired
in, and the dispatcher fails open — it never blocks or breaks your agent because of
its own error.
▷│ Open source · MIT · built in the open
