Skip to main content
command CX Codex

retex — Claude Code command: what it does, how to install

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

CC-BY-SA-4.0 ★ 6,529 updated 2026-10-22

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/retex.md
Open on GitHub

What retex 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.

What it helps with

  • 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 for the agent

  • /retex
  • /retex Typst build failed due to incorrect template arguments
  • /retex Release hook stopped working after configuration update

How to install retex

Manually: put the files in place

.claude/commands/retex.md

Call it with /retex. For all projects use ~/.claude/commands/

Questions about retex

How to install retex in Claude Code?

Save the command file into .claude/commands/retex.md inside your repository root.

What does the retex command do?

It examines Git context, categorizes the underlying root cause of a failure, and writes prevention guidelines to the agent memory directory.

How does retex handle brief input arguments?

Supplying no arguments or fewer than 10 characters prompts the tool to start an interactive questionnaire to clarify the incident.

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set45

The whole set →
worktree Creates a separate git worktree folder for feature or fix branches. Useful when you need to work on multiple tasks in parallel without conflicts in your main branch. CX Codex +1 ★ 6,529repo stars worktree-status worktree-status is a Claude Code command that reports the branch, path, commit hash, and modified-file count for each active git worktree. CX Codex +1 ★ 6,529repo stars track-mentions track-mentions finds fresh web references to the Claude Code Ultimate Guide and updates its tracker. Use it when you need a repeatable mention audit. CX Codex +1 ★ 6,529repo stars audit-quiz-coverage The audit-quiz-coverage command for Claude Code and Codex compares recent releases and guide changes with quiz questions, then drafts questions for topics not yet covered. CX Codex +1 ★ 6,529repo stars guide-recap guide-recap is a Claude Code skill that turns CHANGELOG.md entries into draft posts for LinkedIn, Twitter/X, newsletters, and Slack. Run it after a release or for a weekly recap. CX Codex +1 ★ 6,529repo stars methodology-advisor The methodology-advisor command for Claude Code and Codex reads the codebase and asks three questions to recommend an AI-development methodology stack. Run it at the start of a project, before choosing a workflow. CX Codex +1 ★ 6,529repo stars source-command-methodology-advisor source-command-methodology-advisor inspects your repository, asks three focused questions, and suggests an engineering methodology stack for coding with AI. CX Codex +1 ★ 6,529repo stars boldguy-linkedin-answer boldguy-linkedin-answer is a Claude Code command that drafts a LinkedIn comment tied to relevant parts of a Claude Code guide. It reads a post from its URL and writes in the post’s language. CX Codex +1 ★ 6,529repo stars

Project sponsors

Companies that keep this analytics open