agentleFS
danmestasdanmestas/wardrobe/skills/course-correct/SKILL.md

course-correct

Skill4 starsChanged 7 months agoMITView on GitHub

Rewind a bad chunk of work by capturing what was tried + learned to a summary file, then telling the user how to rewind their session context per harness. Use when an approach has failed, work has gone down the wrong path, the agent went in circles, the user wants to undo recent decisions, or the user says "course correct", "rewind", "we went down the wrong path", "this isn't working start over", or "roll back what we just did". Captures session learnings without destroying git history or the working tree.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If $EDITOR is unset, fall back to vi.

    line 55
  2. Very specific:

    Write the final summary to docs/course-corrections/YYYY-MM-DD-HH-MM-<topic>.md.

    line 82
  3. Distinctive:

    If the user wants to discard uncommitted changes after the summary is saved:

    line 107
  4. Very specific:

    After invoking course-correct, the user typically restarts work with flight-deck:takeoff (fresh inventory) OR superpowers:brainstorming (if …

    line 119
  5. Very specific:

    If the dead-end happened during plan execution, flight-deck:course-correct saves the learnings.

    line 120
  6. Distinctive:

    Never: delete files from the working tree.

    line 125

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Course correct

Bad path. Capture what was tried + learned, write the summary to disk, then tell the user how to rewind their session context. Does not modify git history or the working tree — files stay; the user manages git state separately if they want to discard them.

When to use

  • An approach has failed and circling back to a prior approach is the right call
  • The agent's been going in circles on a problem and a clean restart would help
  • The user wants to undo recent decisions but keep the learnings
  • User says "course correct", "rewind", "we went down the wrong path", "start over from <point>", "this isn't working"

Workflow

1. Reflect on the session

The agent reviews the recent session and answers internally:

  • What was the goal at the rewind point?
  • What approach(es) were tried?
  • What didn't work and why?
  • What concrete learnings should survive the rewind (so future-you doesn't re-tread the same dead-end)?

2. Inventory recent changes

echo '---recent commits on this branch---'
git log --oneline -20 "$(git merge-base HEAD main 2>/dev/null || echo HEAD~10)..HEAD" 2>/dev/null \
  || git log --oneline -10
echo '---uncommitted changes---'
git status --porcelain | head -20
echo '---files modified this session (uncommitted)---'
git diff --name-only HEAD 2>/dev/null | head -20

3. Draft the summary

Compose a draft summary covering:

  • Goal: what we were trying to do
  • What was tried: specific approaches, in order
  • Why it didn't work: root causes if known, symptoms if not
  • Learnings: things to remember next time
  • Suggested rewind point: which conversation point or commit to fall back to

Show the draft to the user. Get explicit confirmation OR $EDITOR for editing.

If $EDITOR is unset, fall back to vi. Use a temp file:

TMPFILE=$(mktemp -t course-correct.XXXXXX.md)
cat > "$TMPFILE" <<EOF
# Course correction: <topic>

## Goal
...

## What was tried
...

## Why it didn't work
...

## Learnings
...

## Rewind point
...
EOF
${EDITOR:-vi} "$TMPFILE"

4. Save the summary

Write the final summary to docs/course-corrections/YYYY-MM-DD-HH-MM-<topic>.md. Topic is derived from the summary's title (slugified) or asked-for if absent.

mkdir -p docs/course-corrections
TOPIC=<slugified-from-title>
DEST="docs/course-corrections/$(date +%Y-%m-%d-%H-%M)-$TOPIC.md"
cp "$TMPFILE" "$DEST"
echo "Saved: $DEST"

Optionally git add the summary if the user wants it tracked. Don't commit automatically — let the user decide if course-correction artifacts belong in git history for this repo.

5. Tell the user how to rewind

Per harness:

  • Claude Code: "Press Esc twice to rewind to a prior conversation point. Reference the summary at <path> to re-orient."
  • Codex / Gemini / Copilot CLI / Pi: "These harnesses don't have a native rewind. Reference the summary at <path> going forward; treat the work above as discarded mentally. If you want a hard reset, exit the session and start a new one."

The skill prints the appropriate guidance based on detected harness (env vars: CLAUDE_PROJECT_DIR, CODEX_HOME, GEMINI_CLI, etc.). When in doubt, print the Claude Code instruction with a fallback note.

6. No git operations

course-correct does NOT run git reset, git checkout, git stash, or any other git mutation. The course correction is a documentation artifact, not a destructive operation.

If the user wants to discard uncommitted changes after the summary is saved:

git stash push -m "course-correct-$(date +%Y%m%d-%H%M)"  # safer
# OR
git checkout .  # destructive, prompt user

These are user-driven follow-up actions, not part of the skill's flow.

Composition with other skills

  • After invoking course-correct, the user typically restarts work with flight-deck:takeoff (fresh inventory) OR superpowers:brainstorming (if rethinking the design from scratch).
  • If the dead-end happened during plan execution, flight-deck:course-correct saves the learnings; the user then revises the plan via superpowers:writing-plans and re-invokes execution.

Safety rules

  • Never modify git history (git reset, git rebase, git checkout).
  • Never delete files from the working tree.
  • Never invoke the harness's rewind mechanism for the user — that's their action.
  • The summary is the artifact. Everything else is the user's call.

Tone

Reflective, not panicky. The user is course-correcting deliberately; the skill should match that thoughtful tone. Concise but thorough on the "what was tried + learned" capture.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.