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.
npx agentmods add rules/0xranx/golembot/engine-internalsgit clone --depth 1 https://github.com/0xranx/golembotWhat 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 | $0.00000 | $0.01960 |
| Opus 5 | $0.00000 | $0.00980 |
| Sonnet 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 2d 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.
- 2d 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 (319 stars, last pushed 15d 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
skill-conventions
Project conventions for creating and editing Obsidian vault skills.
vibe-coding-playbook
Engineering discipline for AI coding (Vibe Coding Playbook).
moyu
当检测到过度工程模式时自动激活:修改用户未要求的代码、创建不必要的抽象层、 添加未要求的注释/文档/测试、引入不必要的依赖、重写整个文件而非最小编辑、 diff 超出请求范围。用户说"太多了"、"只改 X"、"简单点"时触发。 Activates on over-engineering: modifying unrequested code, unnecessary abstractions, unsolicited comments/docs/tests, unrequested dependencies, full file rewrites, scope-exceeding diffs. Triggers on "too…
skill-and-agent-references
Reference skills, agents, and commands by their registered name (never by filesystem path), and decompose oversized commands or agents by extracting sections into skills with by-name references.
cursorrules
🧠 Fast, zero-dependency structured knowledge base (.agent-kb/) with 2D neural graph visualizer │ & MCP server for Claude, Codex, PI, Cursor, Windsurf, Zed & Other AI coding agents.
cursor-doctor
Use cursor-doctor prescription plan and CLI when working on docs, rules, or skills.