factorio-sensei
AI coaching copilot for Factorio 2.x β connects to your live game via RCON and gives real-time advice powered by Claude.
A Rust CLI that connects Claude to a live Factorio game via RCON, giving real-time coaching based on actual game state.
Features
- Live game state access: 10 tools query inventory, production stats, power grid, research, nearby entities, and more
- Two interfaces: Terminal REPL with colored markdown, and in-game
/senseichat command via bundled Lua mod - Built-in knowledge base: Exact Factorio 2.x ratios, belt throughputs, inserter speeds, power formulas, and crafting math
- Read-only by design: Observes and advises only β never executes game actions
Architecture
Factorio (RCON) ββ factorio-sensei (Rust) ββ Claude (Anthropic API)
Each tool implements the Rig Tool trait β generating Lua scripts, executing them via RCON, and returning structured JSON. Claude autonomously decides which tools to call based on the question.
Technical Highlights
- Built on
rig-corefor LLM agent orchestration with multi-tool-call support - Custom
factorio-rconasync Rust crate handling Factorioβs RCON quirks (single auth response, TCP fragmentation, i32 length validation) - Uses Factorio 2.xβs
helpers.table_to_json()for Lua-to-JSON conversion - Knowledge documents embedded in the binary at compile time