Top 200 ReposEXPLORER
Browse agents, categories and pages
Back to results
Reported by sourceThe source says this happened. Top 200 Repos has not reproduced it.

Apply the context engineering lessons from Manus to a long-running agent loop

The Manus team describes the context rules it settled on after rebuilding its agent framework four times: keep the prompt prefix cacheable, mask tools instead of removing them, and use files as memory.

The problem

How it works

Yichao “Peak” Ji explains why Manus chose to build on the in-context learning of frontier models instead of training its own model, and lists the practices the team kept. Keep the start of the prompt identical between steps (no timestamp to the second), only append to the context, serialize data deterministically and mark cache breakpoints where a provider needs them. Do not add or remove tools in the middle of a task; Manus instead uses a state machine that masks token choices, helped by tool names that share prefixes such as browser_ and shell_. Treat the sandbox file system as memory and shrink context in ways that can be undone, for example by keeping a URL or file path in place of the content. Rewrite a todo.md file as work goes on so the plan stays near the end of the context, leave failed actions and error messages visible, and add small variations so the agent does not copy its own earlier steps during repetitive batch work.

Results and limitations

Manus reports an average input-to-output token ratio of about 100 to 1 and around 50 tool calls for a typical task, and notes that with Claude Sonnet cached input cost 0.30 USD per million tokens against 3 USD uncached. It says the lessons come from repeated rewrites and real use by millions of users, and calls them patterns that worked for Manus rather than universal rules. These are vendor-reported figures without published measurements.

Before you try it

Masking token choices and prefilling responses depend on what your model provider or inference server allows; many hosted APIs only offer tool-choice settings. The cache prices are a July 2025 example and change over time. Keeping errors in the context costs tokens, and undoable compression only works if the agent can fetch the URL or file again. The post is design advice, not a benchmark. Results depend on your setup and were not independently reproduced by Top 200 Repos.

Tools and repositories

No ranked repository is involved. This use case still stands on its own source.

Tools
A model API or inference server with prefix caching · A sandbox with a file system the agent can use
Prerequisites
An agent whose prompt and tool loop you control; masking token choices needs an inference stack that supports constrained decoding or response prefill.

Try it yourself: Audit an agent loop for cache and context problems

Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].

Preview
Here is the system prompt, tool list and a sample trace from my agent: [Prompt, tools and sample trace]. It runs on [Model and provider]. Review it against these rules: the prompt prefix stays the same between steps, context is only appended to, serialization is deterministic, tools are not added or removed mid-task, large observations are replaced by a path or URL that can be reloaded, the current plan is restated near the end of the context, and failed actions stay visible. For each rule, say whether my agent follows it, point to the part of the trace that shows it, and suggest the smallest change that would fix it. Flag anything that would stop prompt caching from working. My main problem right now is [Main problem].

Remove secrets and personal data from traces before sharing them.

Sources

  1. Context Engineering for AI Agents: Lessons from Building Manus (opens in a new tab)

    Vendor post · manus.im · Published 18 Jul 2025 · Source checked 12 Nov 2026, 07:54 UTC

    What this source supports
    • Manus chose context engineering on frontier models over training an end-to-end model
    • The team rebuilt its agent framework four times
    • Average input-to-output token ratio in Manus is around 100 to 1
    • A typical Manus task takes around 50 tool calls
    • With Claude Sonnet, cached input cost 0.30 USD per million tokens versus 3 USD uncached
    • Recommends a stable prompt prefix, append-only context, deterministic serialization and explicit cache breakpoints
    • Masks token logits with a state machine instead of adding or removing tools mid-task
    • Uses the file system as restorable memory and rewrites a todo.md file to keep goals in recent context
    • Keeps failed actions in context and adds variation to avoid repetitive patterns
Report a problem

Reported by source

Build an app with Replit Agent while keeping production data out of reach

Replit Agent builds and browser-tests apps from a description. A widely reported 2025 incident, where it deleted a live database during a code freeze, shows why separate dev and prod data matters.

docs.replit.com
Reported by source

Explore and change a large codebase from the terminal with Gemini CLI

Gemini CLI is Google’s open-source terminal agent. Simon Willison found it strong on large codebases in 2025; in 2026 Google moved individual users to Antigravity CLI.

github.comgoogle-gemini/gemini-cli
Reported by source

Hand coding tasks to Cursor cloud agents that open pull requests

Start Cursor agents from the editor, web, Slack or a GitHub comment; each works in its own cloud VM on a branch and returns a pull request with screenshots, videos and logs.

cursor.com
Reported by source

Let an assistant test QA tickets in a browser via Playwright MCP

Peter Eysermans connected Claude Desktop to Playwright and GitHub MCP servers so it could walk through features from tickets, report results and draft reusable tests.

madewithlove.com · 22 Jul 2025microsoft/playwright
Reported by source

Port a Python library to JavaScript with a coding agent

Simon Willison had Codex CLI translate the JustHTML parser into a dependency-free JavaScript library, steering it with about eight prompts over one afternoon.

simonwillison.net · 15 Dec 2025openai/codex