The 200 That Dropped ECC's Security Skill in Cursor
rules: ecc/skills + .cursor/rules → 146,812 tokens (est.)
POST https://b-lost.com/v1/chat/completions → 200
relay: prompt truncated at 128000, tail dropped
mcp: tools registered
result: security skill absent, schema change merged without the checklist
No exception in the IDE. The turn looked fine. We caught it in review: the PR skipped the check ECC's security skill is supposed to require before a schema change. The model had not refused the skill. The skill was no longer in the prompt.
The red herring
ECC's Cursor path is copy the rules, add the MCP server, restart. Fine for a handful of skills. Not fine for the full tree. Skills, instincts, and research checklists were all always-apply, and the memory server added its resource list on every session.
Raising max output tokens changed nothing. The drop was on input. A provider with a larger window only postponed it. Routed back through https://b-lost.com/v1 at a 128k cap, the same 200-and-truncate showed up on the first request.
Root cause
The relay log had the real prompt. About 110k tokens were ECC skill bodies. About 18k was stale memory-server notes, which are not part of the skill contract and should not sit on the system prompt. The user message was under 4k. Cursor injects rules before any tool call, and the provider trims from the tail. The tail held the security skill and the last user constraint. The MCP UI still listed the tools, so it looked like an instruction-following failure.
We diffed two captured requests. The only delta was skill-body bytes. Index only, same route, same model: no truncation. The tool-using turn completed in about 1.1s, TTFT near 400ms on that gateway, security checklist present. The model was never the variable.
Fix
A pre-start indexer writes one always-apply rule: path plus frontmatter description. Bodies stay on disk. One MCP tool reads a single file.
import { readdir, readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
const root = join(process.cwd(), "ecc", "skills");
const files = (await readdir(root, { recursive: true })).filter((f) =>
String(f).endsWith(".md")
);
const lines = ["---", "alwaysApply: true", "---", "", "Call read_skill for the body.", ""];
for (const file of files) {
const text = await readFile(join(root, String(file)), "utf8");
const desc = (text.match(/description:\s*(.+)/) || [, ""])[1].trim();
lines.push(`- ${file}: ${desc.slice(0, 120)}`);
}
await writeFile(join(process.cwd(), ".cursor", "rules", "ecc-index.mdc"), lines.join("\n") + "\n");
{
"mcpServers": {
"ecc-skills": {
"command": "node",
"args": ["scripts/ecc-skill-server.js"],
"env": {
"ECC_SKILL_ROOT": "ecc/skills",
"OPENAI_BASE_URL": "https://b-lost.com/v1"
}
}
}
}
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: "https://b-lost.com/v1",
});
read_skill(path) returns that file and nothing else. No resource dump of skill bodies. Always-on rules landed near 1.2k tokens. Truncation warning gone.
Invariant
Always-on Cursor rules get an ECC index, never a skill body. If the merged prompt estimate exceeds 8k tokens before the user message, do not start the turn. A 200 with a truncation warning is a failed run.
Top comments (0)