gitwtfhub

wtf is codex-516-fix?

tai-wei/codex-516-fix — explained in plain English

Analysis updated 2026-05-18

48Audience · developerComplexity · 1/5LicenseSetup · easy

TL;DR

A single AGENTS.md configuration file that gives OpenAI Codex stricter reasoning rules to stop it from jumping to wrong answers on tricky logic puzzles.

Mindmap

mindmap
  root((codex-516-fix))
    What it does
      Fixes Codex reasoning shortcut bug
      Adds stricter analysis rules
      Single AGENTS.md file
    Tech stack
      AGENTS.md config
      Codex CLI or Desktop
    Use cases
      Fix logic and algorithm answers
      Apply per project or globally
      Verify with candy puzzle test
    Audience
      Codex users
      Developers hitting reasoning bugs

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

Why would anyone build with this?

REASON 1

Drop the AGENTS.md file into a Codex project to reduce wrong answers on worst-case logic problems.

REASON 2

Install the rules globally so every Codex session gets stricter problem analysis.

REASON 3

Test whether the fix works by rerunning the original candy puzzle from the linked bug report.

REASON 4

Apply the rules to tasks with easy to miss conditions like touch or shape distinguishability.

What's in the stack?

AGENTS.mdCodex

How it stacks up

tai-wei/codex-516-fix619dev/guanlanachrefelouafi/grasssystemthreejs
Stars484848
LanguageTypeScriptJavaScript
Setup difficultyeasymoderateeasy
Complexity1/53/52/5
Audiencedeveloperdeveloperdeveloper

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

How do you spin it up?

Difficulty · easy Time to first run · 5min

Just copy one AGENTS.md file into a project folder or Codex's global config directory.

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

Wtf does this do

This is a configuration workaround, not a code project. It addresses a bug reported in an OpenAI Codex issue where the gpt-5.5 model, even set to its highest reasoning effort, sometimes skips its visible reasoning step and jumps straight to a final answer, giving a wrong result on certain logic puzzles. The bug report used a specific puzzle: reaching into a bag of candies that differ in shape, so you can tell shapes apart by touch, and figuring out the minimum number you must pull out to guarantee a matching pair. The correct answer, 21, requires noticing that shape can be told apart by touch. When Codex fails, it treats the puzzle as an ordinary blind draw instead and answers 29. Failed runs' logs consistently show a specific reasoning token count around 516, and a related issue found that Codex's reasoning token counts tend to cluster around fixed numbers such as 516, 1034, and 1552, with the 516 cluster linked to worse performance on hard tasks. This project does not patch Codex itself and does not change model routing or reasoning budgets internally. Instead it ships a single file, AGENTS.md, containing stricter problem analysis rules that you place either inside one project, to affect just that project, or in Codex's global config folder, to affect every project. Once loaded, Codex reads these rules as behavior instructions. It is meant for tasks like algorithm problems, logic puzzles, weighing and sorting problems, edge case problems, and anything needing a worst case guarantee, especially where a condition like "can be told apart by touch or sight" is easy to miss. It can also help with analyzing or restructuring written content, though it was not built for open ended creative writing. To check whether the fix is working, you can rerun the original candy puzzle. If Codex correctly uses the touch distinguishable condition, it answers 21, if it still answers 29, the fix has not taken effect for that case. The project is a single AGENTS.md file plus an Apache-2.0 license, nothing more.

Yoink these prompts

Prompt 1
Install this AGENTS.md file into my current Codex project.
Prompt 2
Copy this repo's AGENTS.md into Codex's global config folder.
Prompt 3
Explain what the reasoning-token-516 bug is that this repo works around.
Prompt 4
Test whether my Codex setup still gives the wrong candy puzzle answer after applying this fix.
Prompt 5
Adapt this AGENTS.md's rules for a different worst-case guarantee problem I'm working on.

Frequently asked questions

wtf is codex-516-fix?

A single AGENTS.md configuration file that gives OpenAI Codex stricter reasoning rules to stop it from jumping to wrong answers on tricky logic puzzles.

What license does codex-516-fix use?

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

How hard is codex-516-fix to set up?

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

Who is codex-516-fix for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.