Skip to content
@agentreflex

agentreflex

agentreflex — give your AI agents reflexes



npm license agents stars

MCP gives your agent hands. agentreflex gives it reflexes.


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.

The missing layer

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

Write a reflex once

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.

Quickstart

npx agentreflex init

One command wires every agent in your repo to your .reflex/ folder. After that, editing a reflex is instantly live — no rebuild, no re-publish.

Explore

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

A few official reflexes

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 →

Trust is the point

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

Pinned Loading

  1. awesome-reflexes awesome-reflexes Public

    The community catalog of reflexes for agentreflex — guardrails and instincts that fire before your AI coding agent acts.

  2. agentreflex agentreflex Public

    The open commons of reflexes for AI coding agents — write an instinct once, it fires in every agent.

    TypeScript

Repositories

Showing 4 of 4 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…