Build a Basic AI Agent from Scratch: Long Task Planning
TL;DR Highlight
No article text; comments say plain-text plans beat dedicated planning tools for agents.
Who Should Read
Developers handing long tasks to coding agents and deciding whether to add planning or todo tools
Core Mechanics
- The article body was not provided
- The title suggests a tutorial on long-task planning for agents.
- Specific methods and numbers cannot be stated without the text.
Community Reactions
- Plain-text plans beat planning tools, per one user
- They tried AGENTS.md, ./dev/ plan files, todo tools and sqlite tracking, and none were worth it.
- A year ago models needed reminders, but today they follow a plan from text alone.
- A four-level workflow by task complexity
- Basics are just asking, or asking for a plan and then executing it.
- Next, write the plan to a file and have a subagent review it before executing.
- Last, a supervisor agent has subagents implement phases and roll over via handoff.md.
- Questions on scratch pad and todo value
- One commenter asked why a scratch pad helps when the data is already in context.
- They suspect todos help less with newer models and want numbers.
- Defense of script-style tutorial code
- A commenter said real design needs boundaries, policies and error handling, so tutorials simplify to short runnable scripts.
How to Apply
- Make the agent plan before working
- Add one line to your agent system prompt: write a plan first, then execute.
- Compare results without any separate planning tool.
- Save the plan to a file and review it
- For complex tasks, have the agent write the plan to a file and a subagent review it before execution.
- Use handoff.md for long tasks
- Split long work into phases handled by subagents that pass state via handoff.md.
- Save frequent prompts as shortcuts for quick injection.
Try It
# Paste into Claude Code or ChatGPT (simplified version of the workflow from comments)
Do the following task: {{task description}}
1. First write a step-by-step plan in plan.md.
2. Have a subagent (or a separate review pass) review plan.md and flag problems.
3. Apply the review, then implement step by step.
4. If context grows long, write progress and remaining work to handoff.md and continue.Terminology
Related Papers
Ask HN: If the models are so good, why doesn't OpenAI just start 100 companies?
HN answers: code is easy, knowing what to build isn't, so they sell tokens instead
OpenShell – A safe, private runtime for fleets of autonomous AI agents
OpenShell uses policy files to control agent file, network, and credential access at kernel level.
Show HN: Omnara – Open-source alternative to Claude Managed Agents
Open-source managed agent platform runs agents on any model and machine, self-hostable
Rust off Rails: The opinionated web stack for the AI era
Sixty Markdown files tell coding agents how to build a Rust web app, with no framework code.
LayerFS: The filesystem for AI coding agents
Mount an ephemeral workspace per agent, commit only the changes
Launch HN: Alter (YC S25) – Access control for multi-user agents
Alter gives each agent its own identity, policy, and audit trail instead of shared API keys.
Using Claude to reduce the attack surface of code
Claude scanned 25 open-source projects and found 493 needlessly reachable code issues.
WhatsApp's help pages hid LLM instructions: dont recommend a regulator
WhatsApp help pages hid 102 AI-only instructions, including not recommending a data regulator