The proposal stage prints the whole tool registry into the agent's context

An agent-driven video production pipeline whose own guide already names the short provider summary to use instead.
≈ 30,000 tokens per 1,000 runs, prompt tokens for a registry dump the guide calls a firehose estimate
Audited with leanprompt 0.1.0-dev.15
Estimates, not measurements. Every figure on this page is an estimate from reading the code, not a measurement of the app in use.
- Repository
- OpenMontageInc/OpenMontage
- Commit audited
2e003e6- leanprompt version
- 0.1.0-dev.15
- Audit date
- Status
- The maintainers have been told about this audit; no response yet.
- Maintainers
- the issue
- How it ran
- Unattended audit: nobody was asked during the run, so priority, volume and prices were left open; the questions for the owner are listed at the end.
leanprompt read the code at commit 2e003e6 and found 3 places where its LLM calls could use fewer tokens, plus 1 other problem, not scored. Static score: 98 of 100 (an estimate from the findings). The code may have changed since.
Findings
-
LP-PD-03Do not resend the same boilerplate on every turnAGENTS.md:3· severity medium · saves prefill · how often is assumedWhat happens. AGENTS.md and CLAUDE.md (line 3 in both) tell the agent to read AGENT_GUIDE.md, 49,611 bytes, before responding to any user message. Every approval gate ends the agent's turn (AGENT_GUIDE.md line 599) and waits for the user, so one run is many user messages, and an agent that follows the sentence literally reads the 12,000-token guide again on each.
The change. Say 'once per session, again only if it is no longer in context' in AGENTS.md and CLAUDE.md. Optionally move the sections only some runs need (onboarding, reference analysis, atelier mode, provider menu) into skills the guide points to.
Why it helps. The guide is about 12,400 tokens (49,611 bytes at 4 bytes per token) and every second read adds it to the context again.
Estimate about 62,000 prompt tokens per run if the guide is re-read at five of the gates
Assumptions. 5 re-reads of 12,400 tokens; agents differ in whether they re-read, which is why the status is frequency-unknown; the estimate counts the first pass only, not later cached reads.
How often. Look at a real transcript of one run and count how many times AGENT_GUIDE.md is read after the first message.
-
LP-PD-03Do not resend the same boilerplate on every turnAGENT_GUIDE.md:586· severity medium · saves prefill · how often is assumedWhat happens. AGENT_GUIDE.md line 586 (and line 193) say to self-review after every stage with the reviewer skill, skills/meta/reviewer.md, 25,407 bytes. Eight stages can mean eight reads of the same 6,400 tokens, and a revision round runs it again.
The change. Write the rule as 'read reviewer.md once per run' and keep the per-stage part as a one-kilobyte checklist taken from the manifest's review_focus, which AGENT_GUIDE.md line 587 already loads.
Why it helps. The same 6,400 tokens enter the context at each stage in which the agent reads the file again.
Estimate about 44,000 prompt tokens per run (7 extra reads of 6,400 tokens)
Assumptions. 8 stages, one read each; agents that keep the first read in context avoid this, hence frequency-unknown; revisions (up to 3 a stage) would add more.
How often. Count the reads of skills/meta/reviewer.md in a transcript of one run.
-
LP-PD-04Trim tool results and retrieved context at the tool boundaryskills/pipelines/explainer/proposal-director.md:94· severity high · saves prefill · size is assumedWhat happens. The proposal stage tells the agent to print the whole tool registry as indented JSON (support_envelope) and then the whole capability catalog, although AGENT_GUIDE.md line 267 says the raw dump is a firehose, to be used for debugging only, and gives a short provider_menu_summary() for this step. The same dump is repeated in the animation and cinematic proposal skills and in video-reference-analyst.md.
The change. In the proposal-director skills, replace the two commands with registry.provider_menu_summary() (the call AGENT_GUIDE.md already runs at preflight), or reuse its result; keep support_envelope() for debugging.
Why it helps. get_info() returns about 40 fields per tool, including the input and output schemas, for about 130 tools, and the output goes into the agent's context and is carried through every later call of the run.
Estimate about 30,000 prompt tokens per run, more on a machine where it is not truncated
Assumptions. about 130 tool classes (tools/ has 132 BaseTool subclasses), 2 to 3 KB of JSON each; the agent's shell tool cuts output at roughly 30,000 characters (about 8,000 tokens) in some harnesses and not in others, so 30,000 is a middle figure; the preflight in AGENT_GUIDE.md already ran once, so this is a second dump. Cached re-reads of it on later calls are not counted.
How big. Run the two commands on a configured machine and count the characters printed (python -c ... support_envelope() and capability_catalog(), both indent=2).
Other problems the audit found
Problems read in the code that cost no tokens of their own, such as a cost meter or an error path. Not scored.
-
Revision and send-back limits disagree and no code enforces them
pipeline_defs/animated-explainer.yaml:49What happens. The manifest sets max_revisions_per_stage: 3 and max_send_backs: 3. AGENT_GUIDE.md line 588 says at most two review rounds, and skills/pipelines/explainer/executive-producer.md line 135 says at most one send-back per stage pair (line 121 uses 3 for revisions). Only schemas/pipelines/pipeline_manifest.schema.json mentions the two keys; no Python or TypeScript reads them, so each limit exists only as a sentence the agent may follow.
The change. Pick one number per limit, write it in the manifest, and make the guide and the executive-producer skill refer to the manifest instead of repeating a number.
Why it matters. Every extra revision runs a director skill (10,000 to 33,000 bytes) and its review again.
To check. grep for the limits shows one number in the manifest and references to it elsewhere.
The maintainers’ response
No response from the maintainers yet.
How this was made
The llm-call-audit skill read the code and wrote findings.json; nothing was run against the project’s providers. The full audit page is what leanprompt report --html writes from the same findings.
Corrections and takedown: email info@podwarden.com or open an issue.