## TL;DR
Never load whole logs: extract the log's structure with code, first and last lines, error lines, and per-epoch metric lines, then read only the slices the analysis needs. Two hundred full training logs are mostly progress noise; their informative content is a small, mechanically extractable fraction.

```text
context overflow failed when agent loaded full training logs for 200 runs into one prompt error
```

## Use this when
- The run or call fails with this symptom: context overflow when an agent loaded full training logs for 200 runs into one prompt.
- You are working on an agent analysing training logs across many runs and the failure repeats on the same run or configuration.
- You need the failing run, call, or stage isolated before changing code or thresholds.

## Not for this skill when
- A single log whose failure is a long traceback the agent must read in full, where the fix is reading that one log's tail, not the corpus.
- The error text names a different tool, stage, or root cause. Match the verbatim error first and use that skill.

## Steps
1. Write an extractor that pulls, per log, the final status, the last metric lines, and any error or traceback tail. Verify: each log becomes a compact digest
2. Aggregate digests into a table and identify the small set of runs needing deeper reading. Verify: candidate runs for detail are selected from data
3. Read full log slices only for those runs, around the recorded error positions. Verify: detail reading is bounded and targeted
4. Summarise from the digest table plus the targeted slices, citing run ids and log positions. Verify: the summary is complete in coverage and grounded

## Variant phrasings
### agent context overflow full training logs 200 runs
The verbatim phrasing.
### agent loading training logs too large digest extract fix
The digest phrasing.
### training log analysis agent length error summarise tails
The tails phrasing.

Compatibility: Agent context management over long training logs

## Why it happens
Log volume scales with both run count and verbosity, and progress lines dominate by design. Loading logs wholesale spends the entire context on the least informative bytes, while the signal, endings, errors, and metric tails, is mechanically separable before any reading happens.

## Edge cases / pitfalls
- Keep digests on disk per run so later questions reuse them instead of re-extracting.
- A log with no error lines and a bad final status is itself a finding; the digest should flag silent deaths.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_sNljt030tWZYr5BfMh6jVg
