Skip to content

LucidDelta/ue5-claude-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude Python — Unreal Engine Plugin

An AI-powered Python scripting assistant embedded in the Unreal Editor. Describe what you want to do in plain English, and the plugin generates and executes Python to do it.

License Unreal Engine Python Platform Language Claude Code Release

Interface


🤔 What is this for?

  1. Batch collision setup
  2. Batch LOD configuration
  3. Asset renaming and folder organization
  4. Lightmap resolution normalization
  5. Material slot batch replacement
  6. Kit-bashing layout assembly
  7. Actor transform operations
  8. Dependency and reference auditing
  9. Texture audit and validation
  10. CSV-driven level population
  11. Post-process and rendering setup
  12. Blueprint and asset auditing

Assembling multiple subfolders of static meshes into a grid.

Demo


⚡ Prerequisites

Before enabling the plugin, make sure the following are in place:

1. Visual Studio 2022 Required to compile the plugin's C++ source. Install with the "Desktop development with C++" workload (includes the MSVC compiler and Windows SDK). Download: https://visualstudio.microsoft.com/

The Epic Games Launcher will prompt you to install this automatically when you first open a C++ project in UE 5.5 — follow that prompt if you haven't already.

2. Unreal Engine 5.5 Only tested on UE 5.5. Other versions may require source changes.

3. Python Editor Script Plugin + Editor Scripting Utilities These are automatically enabled when you enable the ClaudePython plugin — no manual action required. If you ever see build errors about a missing PythonScriptPlugin module, verify that "Python Editor Script Plugin" is enabled in Edit → Plugins.

4. Install the Claude Code CLI Download and install from: https://claude.ai/download

5. Authenticate the CLI Open a terminal and run:

claude login

Follow the browser prompt. You only need to do this once per machine.


🚀 Installation

  1. Copy the ClaudePython folder into your project's Plugins/ directory.
  2. Open the project in UE 5.5. The editor will detect the new plugin and ask to compile it — click Yes.
  3. After compilation, enable the plugin via Edit → Plugins → search "Claude Python" → enable → restart.

🗂️ Opening the Panel

Tools → AI Tools → Claude Python

The panel opens as a dockable tab. You can dock it anywhere in the editor layout like any other panel.

You can also right-click any asset in the Content Browser and choose Ask Claude about this asset to open the panel with the asset pre-filled in the prompt.


🖥️ UI Overview

Context Bar

Shows chips representing the current editor state that will be sent to Claude as context:

  • The active level
  • Selected actors in the viewport
  • Selected assets in the Content Browser
  • The current renderer (SM5, Nanite, etc.)

Click Snap Selection to refresh the chips from the current editor state. Chips do not update automatically when selection changes — you need to snap manually.

Prompt Area

Type your request in plain English. The token counter in the top-right of this pane gives a rough estimate of your prompt length.

Click Execute (or press Enter with focus in the prompt box) to send to Claude.

Settings Row

Control What it does
Preview before execute When checked, generated code is shown for review before running. You must click Execute manually to run it. When unchecked, code runs immediately after generation.
Auto-fix errors If the generated code throws a Python error, the plugin automatically sends the error back to Claude and retries.
Max retries How many auto-fix attempts to allow before giving up (1–5).
Conversation mode Keeps a running history of your prompts and Claude's responses, and includes them in each new request. Useful for iterative tasks where each step builds on the last.
Model Choose between claude-sonnet-4 (faster, cheaper) and claude-opus-4 (more capable, slower).

Generated Code Panel

Displays the Python code Claude generated. By default it is read-only.

Button What it does
Edit / Lock Toggle the code box between editable and read-only. Edit before running if you want to tweak the generated code.
Copy Copies the generated code to the clipboard.
Reject Clears the generated code without running it.
Execute Runs the code. Only visible when Preview before execute is on and code is waiting to run.

A red warning banner appears at the top of this panel if the generated code contains potentially destructive operations (clear_level, delete_asset, destroy_actor). Review carefully before executing.

Execution Output

Shows the stdout/stderr output from the Python execution, color-coded:

  • White — normal output
  • Green — success confirmation
  • Red — Python errors
  • Yellow — auto-fix retry messages

If auto-fix is enabled and an error occurs, a Send error to Claude button appears to manually trigger a retry.

Command History

A log of every prompt you've sent, with the generated code and whether it succeeded. Click any row to reload that prompt and code. Use Export .py to save the history as a single Python file. Use Clear History to wipe it.


💡 Tips

  • Be specific about what is selected. Claude uses the context chips to know what actors or assets to operate on. Select what you want to modify in the viewport or Content Browser before sending your prompt, then hit Snap Selection.

  • Preview mode is recommended for destructive operations. Enable "Preview before execute" when asking for anything that modifies or deletes assets.

  • Auto-fix works well for simple errors (wrong variable name, missing import) but may loop on fundamentally incorrect code. Set Max retries to 1 or 2 if you want it to give up quickly.

  • Conversation mode is best for multi-step tasks. For example: "Create a new material" → "Make it metallic" → "Apply it to the selected mesh." Each prompt builds on the last.

  • The generated code runs in the editor's Python environment. It has full access to the unreal module and all editor scripting APIs. There is no sandbox — be careful with destructive prompts.

  • Temp files are written to {ProjectDir}/Saved/ClaudePython/ during each invocation and cleaned up automatically. If a run fails unexpectedly, you can inspect claude_prompt.txt and claude_output.txt there for debugging.


#unrealengine #ue5 #claude #anthropic #python #gamedevelopment #ai #automation #editorscripting #editorplugin #unrealplugin #gamdev

About

AI-powered Python scripting assistant for Unreal Engine 5.5, powered by the Claude Code CLI

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors