Build a loop that stops at the right time
Reason → act → observe, the 6 elements of every loop, and a done criterion that an outsider can check.
Long Execution Training · 8 courses on loops, context, and memory
Telling an agent to work for ten hours is not enough. It needs a goal with proof of completion, state saved to a file, and context that doesn't rot. In 8 courses, in the right order, you learn to build the loop, take care of context and cache, give the agent memory, and make the loop learn from what worked.
Prerequisite: Claude Code or Codex in the terminal. INEMA.PRO content, open and free. 6 of the 8 courses are also available in English and Spanish.

The problem
A long session always fails for the same reasons. None of them is solved with a better prompt, and each one has a course in this training.
After the training
Reason → act → observe, the 6 elements of every loop, and a done criterion that an outsider can check.
A task runner, a GitHub issues bot and an orchestrator with several agents, with the anti-patterns of each.
Work in blocks, /clear, /rewind and /compact at the right time, structured handoff, and subagents for the heavy parts.
Know what appends to and what breaks the prompt cache, and set up the project so the cache lasts across cycles.
SessionStart, PreCompact and UserPromptSubmit hooks and a ~/.memory/ with decay and promotion to CLAUDE.md.
LOOP-R with a hypothesis, a checklist, a decision card and an undo button, and the handoff from the loop to the agent graph.
8 courses in order · 136 lessons and modules
Course 1 delivers the long-execution kit, in 8 v7.2 lessons. The next two build the loop. The three in the middle handle what makes a long session fail: context, cache, and memory. The last two take the loop into learning and into the graph. If you already run loops, you can start at course 4.
Kit in practicev7.2
The seven-file kit that holds up a run lasting hours: a goal.md with no shortcuts, context in bands at 50, 70, and 85%, a handoff that checks it saved, and a headless loop with a cap.
LoopPT · EN · ES
The reason → act → observe skeleton, the 6 elements every loop has, the 3 forms of loop, and how to define and check what counts as done.
Loop in practicePT · EN · ES
The orchestrator-workers architecture, when to use it and when not to, and three loops built: a task runner, a GitHub issues bot and a multi-agent orchestrator.
Context
How context fills up and rots, when to use /clear, /rewind and /compact, structured handoff, memory in files, and a large task split across sessions.
CachePT · EN · ES
What prompt caching is, what appends to it and what breaks it, cache × compaction, and a cache-friendly architecture with auditing.
Memory
Why compaction erases memory, the 18 Claude Code hooks, and injection through SessionStart and PreCompact, all the way to your own ~/.memory/ with decay and promotion.
LearnsPT · EN · ES
Locate, Operate, Observe, Propose and Reinforce, with the one who executes kept separate from the one who judges, a decision card and an undo button in sales and customer service loops.
GraphPT · EN · ES
From the loop to the agent graph: nodes, edges and state, org graph × work graph, the verifier as the bottleneck, and observability of failures.
Who it's for
Included in the training
The execucao-longa kit brings templates, a headless loop, a context hook, a watchdog, session measurement and recall. It and the area's other kits come with the program, along with the video on the topic.
Why this training
The kit lives in course 1, stopping at the right time in courses 2 and 3, context in 4, cache in 5, memory in 6. You go straight to what hurts.
The area's kit was tested in real runs: goal.md, state in files, limits, and a human gate for credit and irreversible actions.
Free courses and four repositories on GitHub: execucao-longa, claude-session-kit, agente-claude-codex and loop-r.
The method works for Codex's /goal, Claude Code's /goal and the headless loop, with every cycle capped on time and memory.
Questions
You need to use Claude Code or Codex in the terminal. Course 7, LOOP-R, works with a spreadsheet and an AI chat and doesn't require a terminal.
The suggested order is 1 → 8. If you already run loops, you can start at course 4 and come back to the first three when you need a completion criterion.
The loops and the completion criterion apply to both. Courses 4, 5, and 6 use Claude Code commands and hooks.
There are 136 lessons and modules across 8 courses: 8 lessons in course 1 and, in the others, from 8 (cccache) to 36 (CCMasterMemory) modules.
A small goal, with a criterion that a test can prove. Create the folder with the execucao-longa kit, run one cycle and measure the session. Then open course 1.
Start with course 1. In 8 lessons you build the kit that holds up a run lasting hours and learn to prove that it finished.