Distill skill hits "Prompt is too long" when processing many conversations
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 64/100
Piste de recherche
Examinez skills/distill/SKILL.md, en vous concentrant sur les prompts des sub-agents et l'étape de collecte du coordinateur. Exécutez /distill sur un lot de conversations, en incluant suffisamment de sessions pour reproduire la limite de contexte. C'est terminé lorsque les sub-agents écrivent directement dans le journal, ne renvoient que de courts résumés et que l'ensemble du flux de distillation et de mise à jour s'achève sans erreur "Prompt is too long".
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem
I have 10-25 Claude Code sessions/day. Today, the /distill skill's coordinator session started hitting "Prompt is too long" during the end-of-day/memory-maintenance runs — every API call after sub-agents completed returned this error, making the session completely unresponsive.
In my case, sub-agents were returning ~25-37KB of JSON each. With 18+ conversations to process, the accumulated results in the coordinator's context (~630KB / ~164K tokens estimated) plus the system prompt exceeded the context limit.
Root cause
Claude and I did some debugging and our understanding of the current flow is:
- Coordinator spawns sub-agents in parallel
- Each sub-agent reads a conversation, extracts JSON, returns it to the coordinator
- Coordinator collects all results, then writes to journal
Step 2 seems like the problem. All returned results accumulate in the coordinator's context. Claude Code context is append-only until compaction — there's no way to discard results between turns. The more conversations you have, the more result data piles up.
Fix attempted
Have sub-agents write directly to the journal via log_journal() instead of returning results to the coordinator. Each sub-agent returns only a short summary string (e.g., "Wrote 3 actions, 2 facts, 1 decision to journal.").
The coordinator then reads from the journal (get_recent_journal) when it needs the data for entity/state file updates.
Before: sub-agent → returns 35KB JSON → coordinator writes to journal
After: sub-agent → writes to journal directly → returns ~50 bytes
Tested
Patched locally and ran against 25 conversations without issue. Previously failed with 18 "Prompt is too long" results. All 25 conversations completed successfully — distillation, state file updates, entity updates, index maintenance finished without hitting context limits.
Proposed changes to skills/distill/SKILL.md
- Sub-agent prompt: instead of "Extract and return as JSON", instruct to call
log_journal()directly with topicsdistilled,distilled-fact,distilled-decision - Sub-agent prompt: "Return ONLY a short summary line" instead of "Return ONLY the JSON"
- Step 3 (Collect): coordinator reads from journal instead of parsing returned JSON
- Add note: "Sub-agents MUST write to journal themselves and return only a short summary"
Happy to open a PR with the full SKILL.md change if this approach looks good.
- Langage dominant
- TypeScript
- Étoiles
- 119
- Forks
- 6
- Merge moyen
- 1 h 32 min
- PR mergées (30 j)
- 2
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de ascorbic/macrodata
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 70/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
-
Support Cursor Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
Toutes les issues de ascorbic/macrodata
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Ouvertebug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Client support matrix inclusion Ouverteenhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
calcite-components needs triage refactor
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Esri/calcite-design-system#15203 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
danielmiessler/LifeOS#2218 ·