# retex

retex logs technical incidents, rollbacks, and mistakes into project memory so Claude Code retains prevention rules across sessions.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 6529 repo stars
- Author: FlorianBruniaux
- License: CC-BY-SA-4.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/FlorianBruniaux/claude-code-ultimate-guide/tree/HEAD/.claude/commands/retex.md
- Updated: 2026-10-22
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/retex

## What it does

The command inspects the Git environment by checking the active branch and five recent commits, then collects incident details. You can pass the summary directly via command arguments or answer two guided questions when running without parameters.

The resulting record is written as a Markdown file in `.claude/memories/`. Each entry includes the root technical cause, recommended solutions, tags, and an imperative prevention rule starting with an action verb.

The central index file `retex-index.md` caps history at 50 records, dropping older logs as newer post-mortems arrive.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/retex.md` — Call it with /retex. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/retex.md` — Call it with /prompts:retex. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/retex.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/retex.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/FlorianBruniaux/claude-code-ultimate-guide/tree/HEAD/.claude/commands/retex.md

## When to use it
- record lessons learned right after a rollback or failed script
- enforce concise prevention rules for subsequent coding sessions
- maintain a structured log of development errors in repository memory
- associate post-mortem summaries with recent Git commits

## Example prompts
- /retex
- /retex Typst build failed due to incorrect template arguments
- /retex Release hook stopped working after configuration update

## Similar
- [recall-reasoning](https://affpapa.org/en/nevibecode/skills/recall-reasoning.md) — skill · 605 installs
- [game-retrospective](https://affpapa.org/en/nevibecode/skills/game-retrospective.md) — skill · ★ 57 repo stars
- [game-postmortem](https://affpapa.org/en/nevibecode/skills/game-postmortem.md) — skill · ★ 57 repo stars
- [git-context-controller](https://affpapa.org/en/nevibecode/skills/git-context-controller.md) — skill · 82 installs
- [context-sync](https://affpapa.org/en/nevibecode/mcp/context-sync.md) — MCP server · ★ 190 repo stars
- [memory-mcp](https://affpapa.org/en/nevibecode/mcp/memory-mcp.md) — MCP server · ★ 100 repo stars

From the same set: [florianbruniaux/claude-code-ultimate-guide](https://affpapa.org/en/nevibecode/by/florianbruniaux/claude-code-ultimate-guide.md) — 45 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
