◉ Pulse
coopersimson96 avatar
#26 today ▲ 6

coopersimson96/aar-loop

Python AI

Run an After Action Review after any AI session and write concrete lessons so your agent stops repeating mistakes. A manual Reflexion loop, built on the US Army's AAR method.

Created Jul 25, 2026
Stars
16
Today
+7
Forks
2
Quality
95/100
Momentum
23

README

Fetched from GitHub on Oct 30, 2026, 9:23 PM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to coopersimson96/aar-loop and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

AAR Loop

A human-run version of Reflexion for AI agents, built on a military method that's been standard practice for fifty years.

Run /aar-loop after any task or session. It does three things:

  1. Reviews the session with the US Army's 4-question After Action Review.
  2. Finds what's worth fixing and writes the improvement straight into your skills or rules files, so the fix is there before you need it again, not just written down somewhere.
  3. Saves the lessons to a persistent LESSONS.md file that your AI loads next time.

Point the next session at that file (and at whatever skill or rule got patched) and the agent stops repeating the same mistake. Run it every session and the agent compounds instead of restarting from zero each time.

Where the method comes from

The US Army formalized the After Action Review in the mid-1970s, in the years after Vietnam, as a structured debrief for training exercises. It became official doctrine in 1993 with field manual TC 25-20, and it's still run after every rotation at the National Training Center, Fort Irwin, one of the most realistic combat training environments in the world. Fifty years of continuous use on one method, because the mechanism is simple and hard to argue with: separate the debrief from blame, ask what was supposed to happen versus what actually happened, and the gap tells you exactly what to fix before the next fight.

The 4 questions, verbatim:

  1. What was supposed to happen?
  2. What actually happened?
  3. Why was there a difference?
  4. What do we do the same or differently next time?

The research parallel

This is also, functionally, a manual version of Reflexion (Shinn et al., 2023, arXiv:2303.11366): an agent framework where a model generates a verbal self-reflection after a failed attempt, stores it in an episodic memory buffer, and carries it into the next attempt. Reflexion agents that keep their reflections outperform agents that start every attempt from scratch.

Nobody's wired that loop into your AI harness by default. This skill is the manual version: you run the reflection step yourself, once per session, and LESSONS.md is the buffer. Same idea, no automation, and it costs you five minutes.

Install

Paste this into Claude Code, Codex, or your AI harness:

Install this skill globally: https://github.com/coopersimson96/aar-loop

Use

/aar-loop

or just say "run an aar" after finishing something. Sample output:

AAR · production deploy

1. What was supposed to happen?
   Deploy the new build and have all three services (web, worker,
   scheduler) come up on the new version.

2. What actually happened?
   The deploy script reported success and exited 0. Web and worker were on
   the new version, but the scheduler was still running the old one; it had
   never actually restarted.

3. Why was there a difference?
   The deploy script only checks the exit code of the restart command, not
   the running version of each service afterward. The restart command for
   the scheduler returned success even though the process manager skipped
   it because it thought the service was already healthy.

4. What do we do the same or differently next time?
   Never trust a deploy script's exit code alone; after any deploy, check
   the actual running version on every service it touches, not just the
   ones it printed a success line for.

FIX PLAN
1. Target: CLAUDE.md
   Add rule: "After any deploy, verify the running version on every service
   it touched. Do not trust the deploy script's exit code alone."
2. Target: skills/deploy/SKILL.md, step 6
   Insert a post-deploy check: query each service's running version and
   compare it against the build hash before reporting the deploy as done.

Apply these fixes? (approve, or say "apply"/"fix it" next time to skip the ask)

Lesson written to LESSONS.md:
  ## 2026-07-24 -- Never trust a deploy script's exit code alone; check the running version on every service it touches after a deploy.
  - Expected: All three services (web, worker, scheduler) run the new build after deploy.
  - Actual: Deploy script exited 0 but the scheduler stayed on the old version.
  - Why: The script checks restart-command exit codes, not the actual running version per service.
  - tags: deploy,verification,fix-applied

Once the fix plan is approved, CLAUDE.md and the deploy skill get the new rule directly, and the next deploy AAR starts from a checklist that already checks running versions, not exit codes. Even without the fix plan applied, the next session still reads LESSONS.md (pointed to from CLAUDE.md or AGENTS.md), sees this entry, and checks the running version on every service without being told.

Files

  1. SKILL.md -- the 4-question method, how to extract a concrete lesson, how to turn a lesson into a fix plan and apply it on approval, and how to write and load lessons.
  2. scripts/append_lesson.py -- appends a dated, structured lesson to LESSONS.md, and lists existing lessons so the same one doesn't get written twice. Stdlib only.

What this is, and isn't

It's a disciplined reflection-and-write habit, not automatic learning. It proposes, and on approval writes, changes to the skills, rules, and lessons files you load, not the model itself. Nothing here retrains anything or changes model weights, and it runs after the session ends: the fix takes effect starting next time, not mid-session and not in real time. A proposed fix only helps once it's actually applied and actually loaded.

It only compounds if the lessons are specific enough to check ("batch size over 100 fails with a timeout") instead of vague ("write better code"), fix plans name an exact file and an exact edit instead of a vague intention, and something actually reads the file before the next relevant task. All three are on you.

License

MIT.

Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 26, 2026

first spotted on the list

Best rank

#26

highest position reached

Appearances

2

times on the trending list

Quality score

95

out of 100

Momentum

23

trend strength indicator

Star velocity

0.17

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot
81012141618coopersimson96/aar-loop · Jul 26, 1 PM UTC: 9 starscoopersimson96/aar-loop · Jul 26, 7 PM UTC: 16 stars1:37 PM4:27 PM7:16 PM

Rank history

position on trending · lower is better
#1#25#30#35#40#45#50#55Jul 26, 1 PM UTC: rank #52Jul 26, 7 PM UTC: rank #261:37 PM4:27 PM7:16 PM

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/coopersimson96/aar-loop" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="coopersimson96/aar-loop — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

coopersimson96/aar-loop stars badge
Markdown
[![coopersimson96/aar-loop](https://www.notionpulse.cc/api/badge/coopersimson96/aar-loop.svg)](https://www.notionpulse.cc/repo/coopersimson96/aar-loop)
HTML
<a href="https://www.notionpulse.cc/repo/coopersimson96/aar-loop"><img src="https://www.notionpulse.cc/api/badge/coopersimson96/aar-loop.svg" alt="coopersimson96/aar-loop stars badge" /></a>

Repository of the Day

#26 Repository of the Day

Repository of the Week

#26 Repository of the Week

Repository of the Month

#26 Repository of the Month