bg3se-macos: Instructions file for Claude Code

CLAUDE.md

bg3se-macos CLAUDE.md is an instructions file for Claude Code from tdimino/bg3se-macos. It costs 5,371 tokens per session, scanned A, original, MIT.

A macOS port of Script Extender, a tool that lets Baldur’s Gate 3 mods interact with the game’s internal systems.

In plain words
What is it for?
Implementing or debugging the macOS modding toolkit, its Lua and Osiris interfaces, crash logging, entity handling, and RPG statistics systems.
Why use it?
It provides the project’s technical reference for building and maintaining the macOS version, including its injection, scripting, logging, and game-data components.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is tdimino/bg3se-macos's own configuration. It tells Claude Code how to work on bg3se-macos itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything bg3se-macos configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/tomdimino/Library/Application.

Reuse

Borrowing it

Nothing to install: this file belongs to tdimino/bg3se-macos. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tdimino/bg3se-macos/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/tdimino/bg3se-macos

Made for: Claude Code.

Wrote 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.

agentmods badge for bg3se-macos CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tdimino/bg3se-macos/claude-md/github.svg)](https://agentmods.dev/instructions/tdimino/bg3se-macos/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/tdimino/bg3se-macos/claude-md"><img src="https://agentmods.dev/badge/instructions/tdimino/bg3se-macos/claude-md/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.

agentmods 80×15 button for bg3se-macos CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tdimino/bg3se-macos/claude-md"><img src="https://agentmods.dev/badge/instructions/tdimino/bg3se-macos/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5,371 This file is loaded in full into every session.
When invoked 5,371 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.05371 $0.05371
Opus 5 $0.02686 $0.02686
Sonnet 5 $0.01074 $0.01074
Haiku 4.5 $0.00537 $0.00537

Measured 10d ago against content hash 1e7a56c8983d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

bg3se-macos CLAUDE.md 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 10d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# Web integrations (Nexus + bg3.wiki — stdlib urllib, 24h file cache)
CLAUDE.md · 294 lines

How it starts

The opening of the file, as written. The whole thing — 294 lines — stays where its author put it; the contents beside it link to each section on GitHub.

BG3SE-macOS

macOS port of Norbyte's Script Extender for Baldur's Gate 3. Goal: scope-corrected 100% parity across the supported macOS surface.

Version: v0.43.0 | Parity: approximately 94.8% from the ROADMAP.md matrix (behavioral accounting with per-function contract diffs — stubs score zero, macOS-only extras earn no credit) | Target: 100% of the supported macOS surface | Deferral registry: docs/deferrals.md

Stack

  • C23/C++20, Universal binary (arm64 + x86_64)
  • Dobby (inline hooking), Lua 5.4, lz4, zlib
  • Injection: insert_dylib static Mach-O patching (LC_LOAD_WEAK_DYLIB) — DYLD_INSERT_LIBRARIES is dead (crashes through Steam)
  • Launcher bypass: defaults write com.larian.bg3 NoLauncher 1 (set automatically by harness)

Structure

  • src/injector/main.c - Core injection, hooks, Lua state, Osi dispatch
  • src/core/crashlog.c - Crash-resilient logging (mmap ring buffer, signal handler, breadcrumbs)
  • src/lua/lua_*.c - Ext.* API implementations
  • src/osiris/ - Osiris types, function cache, handle encoding, pattern scanning
  • src/stats/ - RPGStats system + prototype managers
  • src/entity/ - Entity Component System (GUID lookup, components)
  • src/lua/lua_gate.c/h - Recursive mutex serializing all Lua VM entry points (thread safety)
  • src/hooks/arm64_hook.c/h - ARM64 inline hooks with MAP_JIT trampolines
  • ghidra/offsets/ - Reverse-engineered offsets documentation

Modding Toolkit

# Core pipeline
PYTHONPATH=tools python3 -m bg3se_harness status            # Game/socket/patch state
PYTHONPATH=tools python3 -m bg3se_harness launch --continue # Autonomous: auto-loads most recent save
PYTHONPATH=tools python3 -m bg3se_harness test [filter]     # Full pipeline: build+patch+launch+continue+test → JSON

# Game inspection
PYTHONPATH=tools python3 -m bg3se_harness entity <GUID> [--component X]  # Inspect entity
PYTHONPATH=tools python3 -m bg3se_harness stats <name> [--diff OTHER]    # RPG stats + comparison
PYTHONPATH=tools python3 -m bg3se_harness components [--namespace eoc]   # List 1,999+ component types
PYTHONPATH=tools python3 -m bg3se_harness probe <0xADDR> [--classify]    # Memory inspection

# Development
PYTHONPATH=tools python3 -m bg3se_harness run "<lua>"       # Inline Lua
PYTHONPATH=tools python3 -m bg3se_harness eval script.lua   # File/stdin Lua (piping)
PYTHONPATH=tools python3 -m bg3se_harness watch script.lua  # Hot-reload on save
PYTHONPATH=tools python3 -m bg3se_harness screenshot        # Game window (1568px, JPEG, Claude Code safe)
PYTHONPATH=tools python3 -m bg3se_harness dump spells       # Bulk extract game data
PYTHONPATH=tools python3 -m bg3se_harness events --subscribe SessionLoaded  # Stream events (JSONL)

# Diagnostics
PYTHONPATH=tools python3 -m bg3se_harness crashlog          # Parse crash ring buffer (no socket)
PYTHONPATH=tools python3 -m bg3se_harness benchmark "Ext.Stats.Get('WPN_Longsword')"  # Perf measurement
PYTHONPATH=tools python3 -m bg3se_harness diff-test base.json curr.json   # Test regression comparison

# Mod management (delegates to BG3MacModManager or pure Python fallback)
PYTHONPATH=tools python3 -m bg3se_harness mod list          # Installed mods + enabled/SE status
PYTHONPATH=tools python3 -m bg3se_harness mod install <path.pak|nexus:ID>  # Install local PAK or Nexus download (--links-only: URLs only)
PYTHONPATH=tools python3 -m bg3se_harness mod enable <name> # Enable in modsettings.lsx
PYTHONPATH=tools python3 -m bg3se_harness mod search <query>  # Search Nexus Mods API

# Web integrations (Nexus + bg3.wiki — stdlib urllib, 24h file cache)
PYTHONPATH=tools python3 -m bg3se_harness mod changelog <id>       # Nexus changelogs (HTML stripped, newest-first)
PYTHONPATH=tools python3 -m bg3se_harness mod versions <id>        # Nexus file list (file_id, version, category, size)
PYTHONPATH=tools python3 -m bg3se_harness mod updated --period 1w  # Recently-updated mods (1d/1w/1m)
PYTHONPATH=tools python3 -m bg3se_harness wiki spell "Fireball"    # Parsed {{Feature page}} template fields
PYTHONPATH=tools python3 -m bg3se_harness wiki item "Longsword +1" # Parsed {{WeaponPage}} / {{ArmourPage}} fields
PYTHONPATH=tools python3 -m bg3se_harness wiki verify "Fireball" --expect-uid Projectile_Fireball  # Offline uid cross-check
PYTHONPATH=tools python3 -m bg3se_harness wiki clear-cache         # Wipe ~/.config/bg3se-harness/wiki_cache/

# Parity + compatibility + diagnostics
PYTHONPATH=tools python3 -m bg3se_harness parity scan       # Compare Ext table vs Windows baseline
PYTHONPATH=tools python3 -m bg3se_harness parity scan --contract  # Score vs Wave 7 contract manifest (offline)
PYTHONPATH=tools python3 -m bg3se_harness parity missing    # List gaps (offline)
PYTHONPATH=tools python3 -m bg3se_harness compat list       # Available test scenarios
PYTHONPATH=tools python3 -m bg3se_harness compat run mcm --launch --auto-install  # Full autonomous vet: install+launch+assert+quit
PYTHONPATH=tools python3 -m bg3se_harness compat matrix [--launch --auto-install]  # All scenarios, summary matrix
PYTHONPATH=tools python3 -m bg3se_harness compat diff mcm   # Compare latest run vs docs/compat-reports/baseline/
PYTHONPATH=tools python3 -m bg3se_harness compat vet mcm    # Vet mod: probe SE, scan logs, JSON report
PYTHONPATH=tools python3 -m bg3se_harness doctor            # Verify all prerequisites
PYTHONPATH=tools python3 -m bg3se_harness save list         # Available saves with metadata
PYTHONPATH=tools python3 -m bg3se_harness save snapshot <name>  # Save → fixture (records source dir in fixture_meta.json)
PYTHONPATH=tools python3 -m bg3se_harness save restore <name>   # Fixture → its recorded source dir (backs up outside save tree)
PYTHONPATH=tools python3 -m bg3se_harness author new MyMod  # Scaffold new mod

# Menu automation (Vision OCR + CGEvent click)
PYTHONPATH=tools python3 -m bg3se_harness menu detect       # OCR main menu buttons → JSON
PYTHONPATH=tools python3 -m bg3se_harness menu click "Continue"  # Click button by name

# RE + flags
PYTHONPATH=tools python3 -m bg3se_harness flags             # 40 discovered game CLI flags
PYTHONPATH=tools python3 -m bg3se_harness ghidra decompile <name|0xADDR>  # Ghidra RE bridge

Read the full file on GitHub · 294 lines

Changes

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.

  1. 10d ago First seen · 294 lines · 5,371 tokens per session scan A 1e7a56c8983d

Subscribe to this mod's changes

bg3se-macos CLAUDE.md is an instructions file published in the GitHub repository tdimino/bg3se-macos (58 stars, last pushed 29d ago), licensed MIT. It adds 5,371 tokens to every session, about $0.0269 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens