Agent Harness Optimization Workflow
From Wikiprompt, the free prompt encyclopedia
Agent Harness Optimization Workflow A step-by-step workflow to reduce agent harness costs by 50%+ using Karpathy's loop, action fusion, context compaction, output archiving, and model delegation.
Prompt ContentSave
π
step 1 β inspect the agent's execution logs - repeated actions, growing context, oversized outputs - find where tokens stop moving the task forward
step 2 β run Karpathy's loop on the harness: propose β implement β review β test β keep or discard. Fix the quality and efficiency gates before the search starts
step 3 β fuse actions: edit the file and run its planned test in one tool call - remove the model round trip between them
step 4 β compact at completed steps - but only when expected savings outweigh the cost of rewriting the cached context
step 5 β stop replaying huge outputs: archive them, send them twice, then keep a handle and short excerpt. Retrieve exact pages when needed
step 6 β delegate log reading to a cheaper model - verify its evidence against the original. If verification fails, return the full log
step 7 β start with one mechanism in Pi, where their code runs. Measure it against your current setup before combining all four
step 8 β freeze the changes, then test on unseen tasks. Track completion, API cost and tokens together - a cheaper failure is still a failure
Sign in to see the full prompt
Continue with:
By logging in, you agree to our Terms of Use and Privacy Policy
Usage
This prompt is designed for use with productivity. Copy the prompt content above and paste it into your preferred AI tool.
For best results, you may customize the placeholders (indicated by square brackets or capital letters) with your specific requirements.
References
- Category: productivity Prompts
- Source: https://x.com/0xCodila/status/2106451735715737913
Talk
0 comments