Skip to content
How it learnsFrom coding sessions, reviews, Slack and docs.Only what fitsEach session gets the few rules its task needs.Pull request reviewEvery PR checked against your team’s rules.Keep it trueA gate, conflicts, disputes and stale rules, handled.HandoffsCarry the work to another session or a teammate.SecurityWhat it sends, what it changes and how to leave.
Engineering teamsOne agent or several: what one person learns, every session uses.PR review onlyInstall the GitHub App. Nothing on anyone’s machine.Teams that mix agentsClaude Code, Cursor, Codex and Copilot, the same rules.On your ownYour corrections follow you across repos, machines and agents.Book a call30 minutes with Roei, if you want a hand. Never required.
DocsPricingSign in
Connect your agents →
For teamsOn your ownPR review onlyHow it learnsOnly what fitsPull request reviewKeep it trueSecurityDocsPricingSign inConnect your agents →
Home/Blog

Blog

AGENTS.md, Cursor rules and Copilot instructions

  • AGENTS.md vs CLAUDE.md
  • Sync rules across repos
  • Why Codex ignores it
  • Keep rule files in sync
  • 3,905 files checked
  • Why Copilot ignores it
  • Cursor Team Rules
  • Cursor rules
  • copilot-instructions.md
  • Claude Code and AGENTS.md
  • AGENTS.md research

CLAUDE.md and context engineering

  • Why Claude ignores it
  • Test a CLAUDE.md rule
  • One CLAUDE.md for all projects
  • Context engineering, Claude 5
  • CLAUDE.md length
  • Which rules got used
  • Context rot, stale rules
  • Growing CLAUDE.md
  • Claude Code best practices
  • Karpathy CLAUDE.md
  • Committing CLAUDE.md

Built-in agent memory

  • Agent memory compared
  • Claude Code auto memory
  • GitHub Copilot Memory
  • Make Claude Code remember
  • Claude Tag vs Claude Code
  • Codex memories
  • Cursor memories
  • Memory or documentation?

Team knowledge and shared conventions

  • Claude Code team memory
  • Stop repeated mistakes
  • Who owns CLAUDE.md
  • Claude Code second brain
  • Shared memory across agents
  • Hand off between agents
  • Company brain
  • Slack decisions
  • Memory poisoning
  • Karpathy's LLM wiki
  • ADRs for agents

Skills, hooks and permissions

  • Rules vs skills
  • Block banned commands
  • Claude Code hooks
  • Codex skills
  • Auto mode
  • CLAUDE.md vs skills vs hooks
  • Claude Code skills

AI code review and PR guardrails

  • PR review against AGENTS.md
  • PR review for team conventions
  • Review comments to rules

Memory tools and alternatives

  • Best company brain tools
  • Unblocked alternatives
  • claude-mem alternatives
  • Supermemory alternatives
  • Mem0 alternatives
  • claude-mem
  • Best MCP memory servers
  • Supermemory Company Brain alternatives

Blog

How to block AI coding agents from running rm -rf, force push and other banned commands

Published November 21, 2026

An agent with shell access will eventually try a command you wish it hadn't. Use layers.

Layer 1: the server

Turn on branch protection on GitHub or GitLab. Disable force pushes on main and release branches and require pull requests. This holds even if an agent tries.

Layer 2: each agent's own settings

  • Claude Code: deny rules in settings and PreToolUse hooks that inspect a command before it runs (Claude Code hooks).
  • Codex: execution rules that forbid a command or require approval (a forbidden Codex rule).
  • Cursor: use the Allowlist run mode, so only the commands you list run without approval. Cursor's docs call the allowlist best-effort, not a security boundary. The Cursor CLI also takes deny rules.

The catch: these are set per tool and per machine. With a mixed team, the lists drift.

Layer 3: containment

Run agents in a container, a disposable VM or a fresh clone. Keep backups. Containment limits damage when a rule is missed.

Where Harbor fits

Harbor holds an agent to your rules at the moment it runs a command, and tells the agent what to do instead.

Example: your team bans prisma migrate reset because it wipes every row. You turn on a guardrail for it and write the remedy on it: a migration made with prisma migrate dev. Harbor blocks the command and points the agent to the remedy. The banned command never runs.

That last part matters. A bare “denied” leaves the agent guessing, and it often retries a variant. A block that names the alternative gets the task done.

You also do not start the list from a blank page. Harbor suggests guardrails from what your team already wrote: a rule that names the command, a deny entry in a repo's .claude/settings.json, or a package script that runs it. A person turns each one on, and it reaches Claude Code, Codex, Cursor and GitHub Copilot on every teammate's machine (guardrails).

Caveats

  • Harbor does not replace server-side branch protection or sandboxes. Keep both for the worst case. Harbor's hook fails open: if it errors, the call runs.
  • Check your own setup by trying a banned command in a test repo before you rely on it. harbor check "git push --force" prints which guardrail stops a command and what the agent will read.

Try it

Run npx harborloop init. It is free for you and one teammate, no card.

Questions

How do I stop an AI coding agent from running rm -rf or git push --force?

Use layers. Turn on branch protection so force pushes to main fail on the server. Set each agent's own controls: deny rules and PreToolUse hooks in Claude Code, forbidden execution rules in Codex, the Allowlist run mode in Cursor. Run agents in a container, a disposable VM or a fresh clone. Harbor adds one guardrail that refuses the command in Claude Code, Codex, Cursor and Copilot and tells the agent what to run instead.

Does Cursor have a deny list for terminal commands?

Not in the IDE, by its current docs. The run modes are Auto-review, Allowlist and Run Everything, and the docs call the allowlist best-effort, not a security boundary. The Cursor CLI takes deny rules in its permissions config.

Why tell the agent what to run instead of only denying the command?

A bare denial leaves the agent guessing, and it often retries a variant of the same command. A refusal that names the sanctioned route, such as a migration made with prisma migrate dev instead of prisma migrate reset, gets the task done.

More on Skills, hooks and permissions

  • Rules vs skills: Cursor, Claude Code, Copilot and Codex
  • Claude Code hooks: a practical guide with examples
  • Codex skills: SKILL.md, the .agents/skills folder, and $name
  • Claude Code auto mode vs --dangerously-skip-permissions

How Harbor reaches each agent →

Your team’s rules, in every agent, checked on every PR.

Harbor is shared memory for your team’s Claude Code, Cursor, Codex and Copilot. Free for you and one teammate. No card. No end date.

Start free →

Product

  • How it learns
  • Only what fits
  • Pull request review
  • Keep it true
  • Handoffs
  • The result
  • Security
  • For coding agents
  • Pricing

Developers

  • Docs
  • Quickstart
  • Install
  • CLI
  • MCP server
  • Served and cited
  • Rule-file checker
  • Blog

Guides

  • Why Claude ignores CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Share Claude Code memory with a team
  • Why Codex ignores AGENTS.md
  • Why Cursor ignores rules
  • Copilot instructions vs AGENTS.md
  • Shared memory across agents
  • Copilot Memory and Dreaming

Compare

  • All comparisons
  • vs Mem0
  • vs Zep
  • vs Unblocked
  • vs ByteRover
  • vs Cognee
  • vs Hindsight
  • vs OpenViking
  • vs Supermemory
  • vs Glen
  • vs MemPalace
  • vs Sentra
  • vs Trail-code

Company

  • Questions
  • Contact
  • X
  • LinkedIn
  • Privacy Policy
  • Terms of Service
  • Data Processing Agreement
  • Refund Policy
© 2026 HarborConnect your agents