Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/0xranx/golembotWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/0xranx/golembot/engine-internals)<a href="https://agentmods.dev/rules/0xranx/golembot/engine-internals"><img src="https://agentmods.dev/badge/rules/0xranx/golembot/engine-internals/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/0xranx/golembot/engine-internals"><img src="https://agentmods.dev/badge/rules/0xranx/golembot/engine-internals.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01960 |
| Opus 5.5 | $0.00000 | $0.00784 |
| Sonnet 5.5 | $0.00000 | $0.00392 |
| Haiku 4.5 | $0.00000 | $0.00196 |
Grade A, and why
engine-internals scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- Uses standard `child_process.spawn` — no PTY (node-pty) needed since CLI version 2026.02+ How it starts
The opening of the file, as written. The whole thing — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cursor Engine Implementation Details
Agent CLI Invocation
- Binary path:
~/.local/bin/agent(notcursor, norcursor agent) - Uses standard
child_process.spawn— no PTY (node-pty) needed since CLI version 2026.02+ - Key flags:
--output-format stream-json --stream-partial-output --force --trust --sandbox disabled --approve-mcps
stream-json Output Format
Output is clean NDJSON on stdout; stripAnsi() is retained as a safety net but is not expected to be needed.
One JSON object per line, main types:
{ "type": "system", "subtype": "init", "session_id": "xxx", ... } → Init; does not signal end of conversation
{ "type": "assistant", "message": { "content": [{ "type": "text", "text": "..." }] } } → Assistant text delta
{ "type": "tool_call", "subtype": "started", "tool_call": { "<XxxToolCall>": { "args": {...} } } } → Tool call started
{ "type": "tool_call", "subtype": "completed", "tool_call": { "<XxxToolCall>": { "args": {...}, "result": {...} } } } → Tool call completed
{ "type": "result", "subtype": "success", "is_error": false, "session_id": "xxx", "duration_ms": 1234 } → Normal end
{ "type": "result", "subtype": "error", "is_error": true, "result": "error msg" } → Error end
Key Notes
- tool_call has both started and completed events — started → yield
tool_call, completed → yieldtool_result; do not treat both as tool_call (would duplicate) - tool_call name is not a fixed field — iterate over the
tool_callobject keys and find the one ending withToolCall; some tools usefunctionformat ({ "name": "...", "arguments": "..." }) --stream-partial-outputchanges assistant event granularity — with it, each assistant event is character-level delta; without it, full paragraphs. Critical: after all deltas for each segment (text between tool calls), Cursor sends one more summary event (content = concatenation of that segment’s deltas). CursorEngine uses accumulated text comparison to detect and skip summary, avoiding duplicate text- assistant.message.content is an array — multiple blocks; filter those with
type === 'text'and concatenate - system event is not a termination signal — do not end the stream on system event
- session_id appears in both system and result — use the one in result as the final session_id
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 136 lines · 0 tokens per session scan A f0c01b0f8c9a
engine-internals is a cursor rule published in the GitHub repository 0xranx/golembot (322 stars, last pushed 19d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,960 tokens. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
typescript-type-safety
Use when encountering TypeScript any types, type errors, or lax type checking - eliminates type holes and enforces strict type safety through proper interfaces, type guards, and module augmentation.
typescript-type-specialist
Enforce strict TypeScript type safety - eliminate all 'any' types, use proper type guards, and maintain zero tolerance for type safety violations.
lspsteer
Compiler-in-the-loop type checking for code edits via LSPSteer.
explicit-opt-in-over-diagnostics
Prefer requiring explicit opt-in over emitting diagnostics on intentional user paths.
angular-typescript-cursorrules-prompt-file
Cursor rules for Angular development with TypeScript integration.
nextjs-typescript-app-cursorrules-prompt-file
Cursor rules for Next.js development with TypeScript integration.