← Long Execution area

Long Execution Training · 8 courses on loops, context, and memory

Agents that work for hours and don't lose their way.

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.

Execução Longa — training in 8 courses: agents that work for hours without losing their way.
8courses in order, from the loop to memory
136lessons and modules across the 8 courses
4open kits on GitHub
6courses also in EN and ES

The problem

The first hour pays off. After the third compaction, the agent walks in circles.

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.

  • The agent doesn't know when to stop and declares done what isn't done.
  • After compacting, it forgets what it has already done and reopens closed work.
  • The done criterion is "0 failures", and the agent meets it by deleting the test.
  • The cache drops between cycles and the same task costs 12.5 to 25 times more.
  • Each new session starts from scratch, because nothing was saved outside the conversation.

After the training

By the end of the 8 courses, you will be able to:

01

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.

02

Run real loops

A task runner, a GitHub issues bot and an orchestrator with several agents, with the anti-patterns of each.

03

Hold the context for hours

Work in blocks, /clear, /rewind and /compact at the right time, structured handoff, and subagents for the heavy parts.

04

Pay less for the same work

Know what appends to and what breaks the prompt cache, and set up the project so the cache lasts across cycles.

05

Give the agent memory

SessionStart, PreCompact and UserPromptSubmit hooks and a ~/.memory/ with decay and promotion to CLAUDE.md.

06

Make the loop learn

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

Seven courses, from the first loop to the loop that learns.

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.

  1. 1

    Kit in practicev7.2

    Execução Longa (LOOP-R Engenharia, course 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.

  2. 2

    LoopPT · EN · ES

    Loop Agents v2

    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.

    13 modulesOpen course 2
  3. 3

    Loop in practicePT · EN · ES

    Loop Engineering

    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.

    14 modulesOpen course 3
  4. 4

    Context

    CCTop: master of context and tokens

    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.

    21 modulesOpen course 4
  5. 5

    CachePT · EN · ES

    cccache: prompt caching in Claude Code

    What prompt caching is, what appends to it and what breaks it, cache × compaction, and a cache-friendly architecture with auditing.

  6. 6

    Memory

    CCMasterMemory

    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.

    36 modulesOpen course 6
  7. 7

    LearnsPT · EN · ES

    LOOP-R: your company that learns on its own

    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.

    21 modulesOpen course 7
  8. 8

    GraphPT · EN · ES

    Graph Engineering

    From the loop to the agent graph: nodes, edges and state, org graph × work graph, the verifier as the bottleneck, and observability of failures.

    15 modulesOpen course 8

Who it's for

Made for you if

  • You already use Claude Code or Codex and want to leave the agent working without watching every step.
  • You lose the thread of the task when the session compacts, crashes or starts over the next day.
  • You pay a lot in tokens and want to know where cache and context are leaking.
  • You want the agent to remember what worked, instead of repeating the same mistake.

Not for you yet if

  • You have never opened a terminal: start with the From Chat to Agent area.

Included in the training

Along with the courses, the kits that run long execution.

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.

Projects and kits

Videos

Why this training

What changes compared with piecing together loose tips.

Every failure has a course

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.

A method tested in real execution

The area's kit was tested in real runs: goal.md, state in files, limits, and a human gate for credit and irreversible actions.

Everything open

Free courses and four repositories on GitHub: execucao-longa, claude-session-kit, agente-claude-codex and loop-r.

Claude Code and Codex

The method works for Codex's /goal, Claude Code's /goal and the headless loop, with every cycle capped on time and memory.

Questions

Before you start.

Do I need to know how to code?

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.

Do I need to follow the order?

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.

Does it work with Codex or only with Claude Code?

The loops and the completion criterion apply to both. Courses 4, 5, and 6 use Claude Code commands and hooks.

How long does it take?

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.

What is the best first step?

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.

Your next agent can work the whole afternoon and prove it finished.

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.