explaingit

sihyeonjeon/why-was-fable-banned

Analysis updated 2026-05-18

31PythonAudience · developerComplexity · 3/5LicenseSetup · easy

TLDR

A hook-based gate for Claude Code and Codex that blocks an AI agent from editing code until it writes and passes a formal spec document.

Mindmap

mindmap
  root((why-was-fable-banned))
    Gate
      PreToolUse Hook
      Spec Validation
      Fail Closed
    Spec Contents
      Goal and Non-goals
      Rejected Alternatives
      Risks
      Acceptance Commands
    Scaling
      Light Tasks
      Heavy Tasks
    Supported Agents
      Claude Code
      Codex

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Force an AI coding agent to state its goal, alternatives considered, and risks before it can touch your codebase.

USE CASE 2

Require runnable acceptance checks with real output before an agent's change is considered done.

USE CASE 3

Scale how much justification an agent needs based on task risk, from a typo fix to an auth or payments change.

USE CASE 4

Install a shared gate machine-wide so every Claude Code or Codex project on a computer inherits the same rule.

What is it built with?

Python

How does it compare?

sihyeonjeon/why-was-fable-bannedcoleam00/harness-engineering-democolor4-alt/citecheck
Stars313131
LanguagePythonPythonPython
Setup difficultyeasymoderateeasy
Complexity3/53/52/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires only Python 3 standard library, install script wires hooks into Claude Code or Codex.

MIT license: use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

This project creates a checkpoint for AI coding agents: before the agent can change any code, it must write a formal specification and have that spec pass a validation check. The system works with Claude Code (the command-line AI coding tool from Anthropic) and Codex (OpenAI's coding agent), blocking any file edits until the agent fills out a structured plan document called .forge/spec.json. The spec document requires the agent to state the goal in its own words, list what it will not do, explain the context, identify at least two alternatives it considered and rejected with reasons for each, flag risks, and provide runnable acceptance commands that produce real output. Only after all of these fields pass does the gate open and edits are allowed through. Installation is a single shell command that wires the gate into Claude Code's hooks system. You can install it machine-wide so every Claude Code project on the computer inherits the rule, or restrict it to a single repo. A toggle command lets you turn the gate off temporarily within a session, but the setting persists per project until reversed. The gate does not apply to agents like Cursor that operate outside Claude Code or Codex. The depth of the spec scales with the task. A small typo fix requires only a brief goal statement and one verification check. A change touching authentication, payments, or database migrations triggers the full checklist. The project also includes an optional LLM-based judge that checks whether the spec is meaningful rather than just formally complete, plus a benchmark suite of 35 adversarial edge cases, all of which the gate passes. The codebase is pure Python using only the standard library. The project was built by recording 42 real engineering sessions with hooks enabled, extracting the decision patterns into a schema, and cross-checking the generalization with a second model. Only observable artifacts were used, with no chain-of-thought data and no secrets.

Copy-paste prompts

Prompt 1
Explain how a PreToolUse hook in Claude Code can block file edits until a condition is met.
Prompt 2
Show me how to design a spec schema that forces an AI agent to list rejected alternatives and risks before making a change.
Prompt 3
How do I write a Python script using only the standard library to validate a JSON spec file before allowing further actions?
Prompt 4
Explain how to scale a validation gate's strictness based on the risk level of a code change, like auth versus a typo fix.
Prompt 5
Show me how to run an AI coding agent in a throwaway git worktree so only a passing diff reaches the main repository.

Frequently asked questions

What is why-was-fable-banned?

A hook-based gate for Claude Code and Codex that blocks an AI agent from editing code until it writes and passes a formal spec document.

What language is why-was-fable-banned written in?

Mainly Python. The stack also includes Python.

What license does why-was-fable-banned use?

MIT license: use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is why-was-fable-banned to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is why-was-fable-banned for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.