# "How I reduced 90 errors for my Cursor Part 2" <!-- ref: @content/youtube/ai-jason/2025-04-22-how-i-reduced-90-errors-for-my-cursor-part-2 triggers: [frequent errors during implementation, loss of context between sessions, stuck in a fix-retry loop, legacy codebase challenges] trigger_prompt: When users experience repeated errors, struggle to maintain context across sessions, or need to onboard legacy projects into Cursor. version: 4 updated_at: 2026-10-31T18:27:10.444Z --> From AI Jason, 2025-04-22: Most Cursor failures stem from users acting as messengers between test output and the agent, and from context loss between sessions. AI Jason (solo presenter) walks through two workflows — Test-Driven Development and a persistent Memory Bank — that dramatically reduce errors when using Cursor on complex projects. ## Core Thesis Most Cursor failures stem from users acting as messengers between test output and the agent, and from context loss between sessions. Pairing TDD with YOLO/auto-run mode puts Cursor in an autonomous write-test → implement → run → iterate loop, while a structured Memory Bank of markdown files preserves architecture, decisions, and progress across chats so the agent stops clobbering existing work. ## Key Insights - **TDD flips the human out of the loop.** Define expected inputs/outputs as tests first, enable auto-run, and Cursor iterates — including adding debug logging — until all tests pass. - **More failing tests after iteration is progress.** It means the agent is surfacing edge cases (e.g., nested JSON strings inside Pydantic models), not regressing. - **Memory Bank solves context amnesia.** Structured files — `projectbrief.md`, `productContext.md`, `activeContext.md`, `systemPatterns.md`, `techContext.md`, `progress.md` — let the agent read before acting and update after completing tasks. - **Works retroactively on legacy codebases.** Deleting and regenerating the memory bank makes Cursor scan the project, reverse-engineer the stack, and produce onboarding context automatically — normally the hardest part of adopting Cursor on existing work. - **Custom modes make rules dynamic.** The VAN → PLAN → CREATE → BUILD workflow conditionally loads only the rules relevant to the current mode and complexity level (1–4), rather than stuffing every rule upfront. - **Creative mode is a debugging escape hatch.** When the agent loops on the same failing fix, Creative mode forces it to generate 3–4 root-cause hypotheses before acting. ## Actionable Takeaways 1. Write test scripts with explicit input/output expectations *before* asking Cursor to implement a function. 2. Turn on YOLO / auto-run so Cursor can execute test commands and iterate autonomously. 3. Install a Memory Bank: paste the prompt into Cline custom instructions (or Cursor Custom Modes), create a `memory-bank/` folder, and run `initialize memory bank`. 4. After every task, prompt `update memory bank` to persist state for the next session. 5. For existing projects, delete any stale memory bank and regenerate it — the agent will reverse-engineer context from the codebase. 6. Set up Cursor's four custom modes (VAN, PLAN, CREATE, BUILD) and start every new project in VAN to bootstrap foundational files. 7. When stuck in a fix-retry loop, switch to CREATE mode and have it weigh multiple root-cause hypotheses before acting. 8. For web data ingestion in AI apps, try Firecrawl's `extract` endpoint and web action agent (handles pagination, logins, smartwait). ## Notable Quotes > "You will just kind of be the messenger between the testing result and cursor for multiple different times until it kind of works." > "By defining test cases clearly you can put a cursor in the driver seat and let it iterate until the function is ready." > "I can continue pile up more and more complex feature in the existing project without worrying it messing up my project." > "The next time when I open a even a new chat it will still have a context about what has been done before instead of starting from scratch." > "Creative mode is supposed to sync through a few potential options before it actually takes actions, so it's more likely to solve the actual error instead of getting stuck in this kind of loop." --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*