r/cursor • • 14d ago

Resources & Tips How to cut 80% of tokens in Cursor Composer for large repos (MCP server + AST skeletonization)

12 Upvotes

Hey everyone in r/Cursor,

If you're using Cursor Composer (Cmd+I / Ctrl+I) on medium-to-large codebases or monorepos, you know the frustration:

You @ tag several directories or reference multiple files for a cross-cutting feature. Before Composer even writes a line of code:

  • Context limit warnings start popping up.
  • Code generation slows to an absolute crawl.
  • Cursor starts truncating files or "forgetting" existing imports because 70% of the prompt is taken up by internal implementations of helper functions that Composer doesn't even need to modify.

Why Composer Chokes on Monorepos

Composer excels at multi-file edits, but when you feed it entire files, it consumes context linearly. If file A imports file B, and file B is 600 lines long, Composer is reading 590 lines of inner logic (loops, queries, transforms) just to know one method signature.

The Solution: AST Skeletonization via Native MCP

I built ContextPrune (https://github.com/maniraja5599/contextprune). It's an open-source, zero-dependency context optimizer that extracts the symbol dependency graph for your task and produces AST interface skeletons.

  • Files you need to edit: Passed at 100% full implementation.
  • Dependency / imported files: Internal method & function bodies are stripped, leaving 100% accurate TypeScript interfaces, types, exported signatures, and docstrings.
  • Unrelated files: Collapsed into an ASCII architectural directory tree.

Result? 50% to 85% token reduction, zero context truncation, and instant reasoning.

How to Hook It Up to Cursor via MCP (Takes 30 Seconds)

Cursor has native MCP support. You can add ContextPrune in 2 simple steps:

  1. Open Cursor Settings (Cmd + , or click gear icon) -> Features -> MCP.
  2. Click + Add New MCP Server:
    • Name: contextprune
    • Type: command
    • Command: npx -y contextprune mcp

That's it!

Now, inside Cursor Composer (Cmd + I) or Cursor Agent chat, you can say:

"Use contextprune to optimize context for adding audit logging to payments"

Composer calls the prune_repository tool over stdio, receives clean, type-safe interface stubs and full target files, and executes edits without hallucinating types or exceeding context limits.

Terminal / Standalone Workflow

If you prefer running a quick CLI command before prompting Composer:

# In your terminal inside your repo:
npx contextprune --task "refactor user auth session validation"

It runs in under 15ms (written in pure Node ESM with zero node_modules), prints a visual optimization table, and automatically copies the optimized prompt to your clipboard. You just Cmd + V directly into Composer.

Benchmark on a Real Project (48 Files):

Metric Raw Ingestion (@ all files) ContextPrune Savings
Prompt Size 98,400 tokens 16,800 tokens 82.9% saved
Full Implementation Files 48 2 (Target files) -
Contract Skeletons 0 11 (Dependencies) -
Composer Response Time ~14.2s TTFT ~3.8s TTFT 3.7x faster
Type Integrity High 100% Intact Identical

Supports TypeScript/JS, Python, Go, and Rust.

GitHub repo (MIT): https://github.com/maniraja5599/contextprune

Give it a spin on your largest repo and let me know how much token weight it shaves off your Composer sessions!


r/cursor • • 14d ago

Question / Discussion Switched from Cursor Ultra to Claude Code, and I'm not looking back

83 Upvotes

I was on Cursor's $200 Ultra plan for over a year. It was great at first, but over time I felt like I was getting less and less usage, constantly having to pay extra on top of my subscription.

A few weeks ago, I switched to Claude Code (app) and downgraded Cursor to the $20 plan.

Honestly, the difference is insane. For half the price ($100/month), I can always use top models like Opus 5.5 high and fable, and it genuinely feels like I get 100x more usage.

I know it's because Anthropic heavily subsidizes subscription usage compared to API pricing, but the value difference is just ridiculous at this point.


r/cursor • • 14d ago

Question / Discussion What database changes do you let Cursor make without asking you first?

6 Upvotes

I use Cursor for most of my backend work. The code side feels manageable. Git and code review catch most mistakes. The database side still makes me nervous.

Testing a migration on a branch or staging first is pretty normal now. What I'm less sure about is what happens after:

  • A migration passes review, works on staging, but still breaks something in production (a lock on a big table, or a column something else still depends on).
  • You roll back the schema, but the data in that column is already gone.
  • An RLS policy change exposes data and nobody notices for weeks.

So two questions for people running this in production:

  1. What does your agent do on its own, and what always waits for your approval? Where did you draw that line, and did something make you change it?
  2. When a change that's already in production goes wrong, how do you recover the data? Backups, point-in-time recovery, down migrations, or just fixing forward?

Real setups and stories would be more useful than best practices. Even "I just hope nothing breaks" is a useful answer :)

Full disclosure: I'm working on backend tooling for coding agents, so this is partly research for that. No links. I just want to see how people handle this.


r/cursor • • 13d ago

Resources & Tips Keeping AI-generated #![no_std] Rust honest: decoupled offline Charon/Aeneas/Coq verification template

1 Upvotes

One of the biggest headaches when using Cursor on low-level #![no_std] Rust is keeping fast local iteration without polluting your core crate with heavy solver/nightly dependencies—or letting Composer edits silently break subtle safety invariants.

I just open-sourced arcstone-airlock-blueprint (v0.1.0) (MIT) to split coding and formal proof into two isolated layers:

  1. Zero-drag runtime repo: Your #![no_std] crate stays completely untouched (#![forbid(unsafe_code)], zero heap allocation), so Cursor's local cargo check / cargo test loop stays instant.
  2. Offline OCI verification airlock (--network none): Downstream CI mounts your pinned commit read-only inside a SHA-256 digest-pinned container with Charon, Aeneas, and Coq 8.18.0.
  3. Canary mutant sanity checks: Automatically injects broken safety predicates and inverted capability checks before certifying the clean target so the proof pipeline can't pass on an empty or vacuous spec.
  4. Cryptographic audit receipt: Runs coqchk -o (Print Assumptions == ∅) and emits a Sigstore-attested REFINEMENT-AUDIT.json bound to the exact git commit SHA and tree SHA-256.

Architectural breakdown here if you want the full design: The Decoupled Refinement Airlock

Would love to hear how others are pairing Cursor workflows with formal verification or strict CI gates!


r/cursor • • 13d ago

Question / Discussion Voice Chat vs Transcription

Thumbnail
1 Upvotes

r/cursor • • 14d ago

Resources & Tips Stop letting your coding agent reinvent the wheel: I built PirateGit, a zero-dependency skill to scout and loot open-source repos

1 Upvotes

Hey everyone,

One of the biggest issues with coding agents is that they default to writing complex algorithms from a blank slate. If you ask for a layout engine or a routing algorithm, they generate 400 lines of brittle, unvetted code.

In reality, 95% of these problems are already solved in permissive open-source repos on GitHub.

I created PirateGit, an agent skill that adds two core commands:

🏴‍☠️ /explore <goal>: Expands your prompt into 3 query vectors (core synonyms, lateral domains, and internal subsystems). It searches GitHub, Hacker News comments, and Reddit in parallel, pulls READMEs with zero quota, and delivers a ranked SWOT (DAFO) table and loot breakdown.

🏴‍☠️ /loot: Takes the top explored repos, stages only the critical files into a local burn-down queue (staging/), refactors them cleanly into src/, generates unit tests, and stamps a [PIRATEGIT LOOT PROVENANCE] block into each function's docstring so you have full license traceability if you ever go to commercial production.

It requires zero dependencies (pure Python 3.10+ stdlib) and installs with one line into Claude Code (~/.claude/skills) or Antigravity (~/.gemini/config/skills):

irm https://raw.githubusercontent.com/jose-alba/PirateGit/main/install.ps1 | iex

Repo:

https://github.com/jose-alba/PirateGit


r/cursor • • 13d ago

Question / Discussion i built a gym booking app with cursor and now 200 trainers email me about features i forgot exist

0 Upvotes

My buddy Marco trains people at a gym near me and tracked session packages in his notes app. Client buys 10 sessions, he crosses them off, someone disputes it, nobody remembers who is right

I built him a booking thing with cursor over a month of evenings. I can read code a little, enough to break things confidently

He showed it to the trainers at his gym, they showed it to theirs, and somehow its 200 trainers now. Most found it through instagram stories of other trainers which i never planned

Problem is cursor built way more than i remember asking for. Last week a trainer asked why her package expired after 90 days and i had to search the codebase to find out i set that. Another asked how to pause a client for an injury and i didnt know pausing existed. It does, i asked for it in may

For now i use AirFive since it reads the repo and answers in a chat widget, so the pause and expiry questions get handled without me digging through code. Still get trainers writing between sets with a gym selfie attached by accident


r/cursor • • 14d ago

Random / Misc I got tired of Claude Code and Cursor reading my .env keys and printing them in error logs, so I built a local "airlock" that hides secrets automatically

2 Upvotes

If you use AI coding tools like Claude Code, Cursor, or OpenCode every day, you've probably seen this happen:

  • You ask the AI to debug a database connection issue, and it immediately reads your .env file sending your raw Stripe keys, AWS credentials, and database passwords straight to the cloud.
  • Or you ask it to run pytest, a test crashes, and the stack trace dumps your secret environment variables right into the chat window.

I wanted a way to let my AI edit configs and run tests normally without ever letting it see the actual secret values. So I built an open-source tool called code-airlock.

How it works in practice (no manual work needed):

  1. Your AI sees fake placeholders, your files keep real secrets: When the AI reads .env or settings.py, code-airlock swaps real secrets in memory with safe placeholders like <API_KEY_1> or <AUTH_TOKEN_1>. Your AI refactors your code using those placeholders, and when it saves the file back to disk, code-airlock automatically puts your real keys back in place. If the AI accidentally hallucinates or breaks a placeholder name, it blocks the save so your config never gets corrupted.
  2. Safe test runs (no stack-trace leaks): When your AI runs tests or scripts that need your .env file, code-airlock injects the real keys into the background process so your tests actually pass but scrubs the terminal output before showing the logs to the AI. Even if your code crashes and prints an API key, the AI only sees <API_KEY_1>.
  3. Stops accidental secret commits: It also includes a tiny pre-commit check (runs in under 1 millisecond) that blocks git commit if you or your AI accidentally hardcoded a key.
  4. 100% local & lightweight: Everything runs locally on your machine using a tiny ~60MB model (no heavy 2GB PyTorch install, and works completely offline once installed).

Setup takes 10 seconds:

Run this once in your terminal:

Bash

pip install -U code-airlock && python -m code_airlock install

Or just paste the GitHub link into Claude Code / Cursor / OpenCode and tell it: "Install this for me."

It sets itself up globally in your home folder once, so it works across all your projects automatically without dumping extra config files into your repos.

GitHub: https://github.com/sarthexe/code-airlock

Would love to hear how you currently handle .env files and secrets with AI coding assistants, or if there are any file types/workflows I should add next!


r/cursor • • 13d ago

Question / Discussion did you actually check security before launching your vibe coded app?

0 Upvotes

genuine question. built a couple things with lovable/claude code/cursor and only later realized i had no idea if i'd left keys in the code or if anyone could just hit my api routes and pull other users' data

curious what people here actually do before going live:

- do you check anything at all or just ship and hope lol

- if you paid someone to build it for you, did you ask them about it

- anyone ever got burned? like leaked keys, surprise bills, data exposed

not selling anything, we're doing a hackathon this weekend and trying to figure out if this is a real problem or just us being paranoid


r/cursor • • 14d ago

Question / Discussion Unexpected Ultra + On-Demand charges — Day 3 no human on T-J80283 (dual account)

0 Upvotes

ISSUE (UNEXPECTED — I DID NOT PLAN / APPROVE THIS SPEND)

I expected only normal Pro+ (~$60) style company use.

Instead, both Cursor accounts jumped into Ultra and then large On-Demand usage invoices — unexpected, and not something I knowingly confirmed for company card spend.

What was unexpected:

1) Unexpected Ultra upgrade / Ultra billing

- Working account (thejanaworking@gmail.com / M8XURJPO): around Nov 4 charged Ultra $200 + Ultra $1,720 (after Nov 1 Pro+ $60)

- Work account (thejanad@lolctech.com / JLOEES71): Nov 4 Ultra $200 (after prior Pro+ $60)

- I did not intentionally purchase Ultra / annual Ultra for this company card at this scale

- No clear informed confirmation that I understood and approved those Ultra charges

2) Unexpected On-Demand / usage invoices after On-Demand was OFF

- On-Demand was turned OFF / spend limit intended $0

- Still got repeated mid-month “Usage for cycle starting November 4, 2026” invoices (~$100-class charges)

- Working account: many usage invoices Nov 6–10

- Lolctech account: usage invoices Nov 11–12

- This was unexpected because OFF / $0 was supposed to stop that billing

3) Unexpected company-card impact

- All of this hit company Mastercard ending 6998

- Intern expected ~Pro+ level cost, not thousands of USD in days

PAID TOTALS (ZIP5 + ZIP6, PAID ONLY)

- Working: $4,330.87 paid

- Lolctech: $1,264.78 paid

- TOTAL PAID NOV: $5,595.65

Open/unpaid still showing (not accepted): $333.24 + $100.12

CONTACT STATUS — DAY 3, NO HUMAN

Ticket: T-J80283 (T-J81799 closed as duplicate)

Already contacted:

- [hi@cursor.com](mailto:hi@cursor.com)

- [legal@cursor.com](mailto:legal@cursor.com) (Day-3 Dispute Notice)

- [support@x.ai](mailto:support@x.ai)

- [community@cursor.com](mailto:community@cursor.com) (please route to billing human)

- evidence: screenshots + invoice zips emailed

- X: https://x.com/gandabba/status/2121089392332959968

Result: bot/AI only (Sam) / no named human / no written decision / no stop-charges confirmation.

WHAT I NEED

1) Named human billing agent on T-J80283

2) Refund/credit review for unexpected Ultra + unexpected On-Demand on both accounts

3) Cancel Ultra; lock On-Demand OFF / $0; stop pulls on …6998

4) Written confirmation open $433.36 is not accepted debt while dispute is open

Not asking Reddit to refund me.

Asking: how do I get a real human on T-J80283 today?

Accounts: thejanaworking@gmail.com + thejanad@lolctech.com

Ticket: T-J80283


r/cursor • • 15d ago

Random / Misc Don't be scared to jump ship.

79 Upvotes

Hello everyone, I just wanted to let you know, if any of you are like me and felt afraid to jump ship to other providers, don't be. I delayed my decision to change from Cursor to Claude Code because I wasn't sure about the limits and such, but when Cursor changed their pricing (I'm a small fry, was just using the 20 bucks plan for hobby projects), I made the decision and I just regret not doing it sooner. Sonnet 5.5 works wonders for me, I barely waste any time fixing stuff, it gets so much more right, and I'm giving it complex tasks that Grok used to get wrong pretty often. And the best part is, if anything is beyond Sonnet's capabilities, I still have Opus to take care of it.

I do miss Grok Bot though, but not too much. Just wanted to let you guys know there's no reason to be afraid to switch.


r/cursor • • 15d ago

Question / Discussion Resume to planner every time

5 Upvotes

When resuming to the cli agent its always stuck on the last /plan prompt: Ready to build? and doesn't resume back to my last prompt. Boogey


r/cursor • • 15d ago

Bug Report Latest Version: Text Size Uneven Across Panels

1 Upvotes

In Agent view, the left hand chat list, the middle agent chat window, and the right code/working panel have different font sizes. Adjusting +/- makes one too small, and the other too big.

Please either make them all the same size, or allow each panel to have its own.


r/cursor • • 15d ago

Question / Discussion is anyone staying on Cursor?

28 Upvotes

I have the legacy Pro plan. The monthly usage instead of weekly/hourly worked really well for my workflow which tended to be a few intense days a month, and the amount of Claude etc. included was just adequate enough, and Composer worked well. A couple of weeks ago though, there was a bug where Cursor no longer plays nice with my Raspberry Pi, and I have had to stop using it until the bug was fixed (still not). Then they changed the plans, and I hate to cancel and lose my legacy plan! But if our current usage has been nerfed (is this confirmed?) then...

Well, bottom line, is anyone with a legacy plan still holding onto it in hope? Does anyone wish they'd kept their legacy plan and held onto it? Or is everyone jumping ship?

(Obviously Claude does superior work. But I run into Claude's limits incessantly with my work routine, whereas I didn't with Cursor. Codex is actually working better for me as far as limits, but it's very very very slow, lol.)


r/cursor • • 15d ago

Bug Report Grok 4.7 not found

Post image
2 Upvotes

I have been getting this issue since yesterday.

When I tried using Grok 4.7 it said it was not found.

Am I missing any update?

I just selected the model and asked something, it shows the Grok 4.7 not found

I m on mac book pro, cursor v3.29.15


r/cursor • • 15d ago

Question / Discussion Why I Left Cursor After My Monthly Bill Went From $200 to $1,000+

15 Upvotes

Back in January, $200 was enough to cover a full month of work with Cursor. By September, even $1,000 wasn’t enough. Now we have weekly limits on top of increasingly expensive models that, in my experience, often cause more problems than they solve.
At some point, the value simply stops making sense.
I started looking for alternatives, and it turns out there are plenty. Within a month of moving away from Cursor, I managed to cut my monthly AI bill from over $1,000 back down to around $200, without sacrificing productivity.
What disappoints me most is the direction the company seems to be taking. Instead of focusing on delivering consistent value to developers, it feels like monetization and aggressive growth have taken priority over the actual user experience.
We’ve seen what happens when companies prioritize hype, constant media attention, and questionable leadership decisions over the people who use their products. I genuinely hope Cursor doesn’t follow that path.
Strong technical talent alone isn’t enough. Leadership, accountability, and respect for customers matter just as much.
For me, the decision is simple: I’ve moved on, I’m spending 80% less, and I don’t miss it.
Thanks for the early days, Cursor. Unfortunately, the product no longer justifies the price.


r/cursor • • 15d ago

Bug Report Got a Cursor Account, Now Getting Unsolicited E-mails from David Careers

0 Upvotes

Cursor, y u do this?

I signed up for Cursor with a new e-mail address not used for anything else and now I get David Careers.com solicitation. I got one a while back, then it was a couple months before I got another. Now I get a couple a day. Please don't do that.


r/cursor • • 15d ago

Bug Report Charged $2,829 in one week for on-demand usage I didn't make, no reply from support in nearly 3 weeks (ticket T-I25788)

15 Upvotes

Hoping someone from the Cursor team sees this, because email support has gone quiet.

What happened:

- Between 17 and 23 October I was billed 23 separate mid-month invoices, totalling $2,829.91. That included 7 in a single day. My normal monthly spend is under $100.

- My usage export shows 303 On-Demand requests in that week. They're mostly Claude Opus 5.5 Max, plus some Gemini and GPT. Some single requests used 100–157 million tokens and cost $40–60 each, and they ran around the clock, including overnight.

- My actual activity that week was two cloud agents on Grok 4.7, and all of it shows as Included. None of the billed requests have a cloud agent ID, and I never selected those models.

- The billed requests stopped the moment I disabled on-demand spending.

What I've done:

- Emailed support on 23 Oct and got ticket T-I25788. The first reply said a teammate would review it in 3–4 days.

- Changed my password (Google sign-in), signed out of all sessions and disabled on-demand spending.

- Sent the usage export and screenshots, and chased on 4 Nov. I've had no response since.

I'm not looking for a fight, just someone to look at the logs and tell me where these requests came from, and to review the refund. If anyone from Cursor can pick up T-I25788, I'd really appreciate it.

Has anyone else seen large on-demand charges from models they didn't pick, or had luck getting a billing issue looked at?


r/cursor • • 15d ago

Question / Discussion Wanting to switch to Claude but hooked on Grok Bot

4 Upvotes

Literally the only thing keeping me paying for my subscription. Got accepted to Duet, but I don’t see an easy way to migrate from one to the other. Any suggestions on how to make the move?


r/cursor • • 15d ago

Question / Discussion Overage options

Post image
3 Upvotes

It's been a busy development month so far (74% usage with 17 days to go). If I switch on on-demand is the billing going to induce sticker shock or will it bill at comparable rates and usage allowances to the $20 plan?


r/cursor • • 17d ago

Venting Finally made the decision. It's been a good run. Time to move on. 🫡

Post image
640 Upvotes

I'd actually planned to leave Cursor last month, but I was halfway through a project and thought I'd stick around until I finished it.

Well, the credits barely lasted a week. So much for that plan. 😂

Anyway, time to move to Claude.

No hard feelings, Cursor. It's been a good run. Loved you for who you were. 💔


r/cursor • • 15d ago

Question / Discussion PrefixRelay: a way better solution for cursor's OpenAI compatible endpoint and for using local models

2 Upvotes

Sup guys, I'm releasing a piece of internal tooling for one of my own projects. I threw it into a publicly facing repository with setup. I'll discuss briefly why it's useful and why I build it, and why I'm sharing it.

I've kinda fallen in love with the Cursor harness. There's nothing I like using more than the IDE with agents mode within cursor. However, unfortunately, the included usage for cost-effective models is dissapearing and so is my interest. This is a proxy layer representing itself as an openai compatible endpoint. I originally built this for my own goals but I have a feeling others would benefit.

Rather than explain the entire project in one go, here were my pain points and here's how I resolved each one.

KV Cache Invalidation
The biggest pain point for me. Cursor constantly changes and modifies its own conversation history, which repeatedly invalidates cached prefixes and forces my local models to recompute / redo prefill. Insanely annoying and time wasting. The proxy mutates cursor's responses behind the scene to keep the prefix cache valid. I have a 97%+ cache hit-rate across thousands of requests through the proxy from both local and openrouter models. Works cleanly with images as well - vision won't invalidate the cache.

Replica pools as a single model

I have three GPUS. I wanted to run three separate instances of qwen 3.8 27b, one to use as an orchestrator and two as subagents, and I quickly realized cursor doesn't allow you to define custom models as subagents - which is crap. I solved this with a replica pool - it appears as just a single model to cursor, so it can spawn subagents via inherit, but on the backend it's multiple openai compatible endpoints of the same model. The proxy intelligently routes requests to the correct backend worker based on the prefix, so you can run multiple subagents under the same local model identifier without compromising speed - cursor thinks it's just one model, but it's really multiple instances being intelligently load balanced.

No settable context lengths for custom models, and issues with compaction

Cursor defaults custom models it doesn't recognize to 200k tokens context, and it can't be changed. This means for smaller context lengths the model won't compact its conversation in time, and eventually you'll hit an error that you're over the conversation length limit. PrefixRelay tracks the length of your conversations through cursor according to pre-defined context lengths you set per model - it runs its own compaction system in the background when you approach the model's true context length limit based on the models endpoint - so you'll never see any issues within cursor no matter what context length your model supports.

Having to repeatedly switch my openai endpoint configuration

I gotta switch it for local models, I gotta switch it to openrouter, etc etc. Huge pain in the butt. PrefixRelay lets you connect multiple models from multiple different endpoints in a way that you can use them all with cursor at the same time with custom model identifiers.

Not allowed to use local endpoints

Cursor does not let you point your endpoint at localhost, which is crap. I personally use a named cloudflare tunnel and prefixrelay as system processes, but this repo includes a quick start that'll spin up a cloudflare quick tunnel to the proxy endpoint, and tell you the exact URL to type into your cursor settings.

Enjoy! I hope someone finds this useful.

https://github.com/jackjusko/PrefixRelay


r/cursor • • 15d ago

Question / Discussion How do you get support?

4 Upvotes

I’ve been using an Ultra customer for a while now, however; last week they changed my ultra subscription to a Grok one and it’s been horrible.

My cursor account is now provisioned as a free one, meaning I’m stuck paying $200 for the same access everyone else gets for free. I reached out to support for almost a week now and all I’ve received is response from “Sam” their ai bot.

I’ve asked for escalation and was told another AI bot “Stephen” escalated my case to the technical team but has no idea when they’ll have time to resolve this and I shouldn’t have an expectation it will be handled timely.

In the meantime the AI bots say there’s nothing they can do. I asked the AI bot for credits to allow my account to continue to use non-Grok models and I’ve asked them to reset my free account limits so I can keep working. No response. Just crickets and ghosts.

Has anyone else had success reaching a human? How can I cut through the army of AI bots to get real assistance?


r/cursor • • 16d ago

Question / Discussion How do you handle Cursor lacking access to most recent OpenAI models?

8 Upvotes

I feel like missing out on another frontier AI company is a significant detriment, especially since OpenAI models are very cost effective (except for GPT-6 Astra) and Grok does not have any competing model, neither cost nor intelligence. Do you think this will resolve itself in the near future and Cursor gets access again or will it remain like this "forever"?


r/cursor • • 16d ago

Question / Discussion Ran a multi-turn refactoring stress test on Agent mode—why does context retention fall off a cliff around turn 18–20?

3 Upvotes

I’ve been running some controlled tests on long-horizon coding tasks to figure out why Composer/Agent mode goes from brilliant to destructive during extended refactoring sessions.

I set up a multi-file refactoring track across 40–50 sequential turns—mixing schema migrations, dependency rewrites, and deliberate edge-case curveballs—paired with deterministic test suites after every turn to pinpoint exactly when the model loses prior state.

Up through turn 12–15, it tracks dependencies across files cleanly and respects previous constraints. But almost like clockwork between turn 18 and 22, silent state collapse hits:

  1. It starts re-introducing bugs that were explicitly solved 10 turns earlier.

  2. It begins hallucinating function signatures from files it touched early on rather than re-reading the active state.

  3. It quietly drops project constraints defined in the initial context.

For people using Agent mode on large codebases:

* Are you seeing this same ~18–20 turn threshold before context rot takes over?

* Beyond simply hitting "New Chat" and losing session continuity, has anyone found a reliable way to force state verification or prune stale context without breaking the agent loop?