Self-Verifying 3D Loops: Claude Code & DeepSeek-V4.1-Flash Three.js Boeing 747 Tips
Build a self-verifying 3D modeling loop using Claude Code's /goal command and DeepSeek-V4.1-Flash to autonomously inspect, diagnose, and refine Three.js scenes.
Victor Mustar (@victormustar), a designer at Hugging Face, has shared an autonomous prompt engineering technique combining the Claude Code terminal harness with the open-source DeepSeek-V4.1-Flash model to build a self-verifying, long-horizon improvement loop that proceduralizes high-fidelity Three.js 3D Boeing 747 models.

Image source: Victor M (@victormustar) via X
When generating complex 3D scenes in WebGL or Three.js using AI coding agents, a recurring failure mode is the agent's inability to see its own rendered output. Blinded to spatial distortion, inverted normals, or misaligned meshes, agents often stall prematurely or mark incomplete models as finished. By pairing Claude Code's goal-driven execution architecture with multimodal visual inspection, Mustar demonstrated that an open-source model can sustain an iterative inspection loop over several hours without losing context.
Autonomous Verification with /goal and Multi-Angle Vision Feedback
The central breakthrough of this workflow lies in prompting the model to construct its own verification harness rather than requesting a one-off code snippet. Mustar provided the following prompt within the Claude Code terminal environment:
Harness: Claude Code
Prompt: "/goal create the most realistic boeing 747 using THREEJS - use your vision capatilities to create a self verifiable system, enter a loop until you are 100% satified about the result (you can build a camera system to inspect each angle)"
This prompt establishes three operational directives that govern the agent's autonomous behavior:
- Clear Objective Definition: Instead of a generic aircraft silhouette, the agent is tasked with building the most realistic Boeing 747 possible using Three.js.
- Mandated Self-Verification Infrastructure: The prompt explicitly instructs the agent to utilize its multimodal vision capabilities by building an in-scene virtual camera inspection system to render and inspect each angle.
- Unbounded Iteration Until Satisfaction: By telling the agent to remain in an iterative loop until 100% satisfied with the outcome, the harness prevents premature termination.
Driven by this directive, Claude Code captures the rendered WebGL scene and feeds visual frames back to DeepSeek-V4.1-Flash. The model executes a continuous six-stage improvement loop:
- Inspect: Orbiting the virtual camera system across front, profile, dorsal, and ventral perspectives to survey current render status.
- Spot Defect: Identifying geometric and procedural flaws, such as incorrect nose curvature, misangled wing sweep, or missing turbofan fan blades.
- Zoom In & Diagnose: Repositioning the inspection camera close to problematic assemblies to evaluate vertex transformations, normals, and material reflection.
- Fix: Modifying Three.js mesh coordinates, geometry segments, and shader properties to resolve the observed discrepancy.
- Repeat: Rebuilding the scene, re-capturing camera angles, and confirming whether the defect has been eliminated before moving to the next component.
While conventional models frequently lose coherence or freeze after early iterations, DeepSeek-V4.1-Flash maintained this inspect-diagnose-fix rhythm continuously over hours, demonstrating sustained task prioritization over a long horizon.
Harness Configuration and Sustaining Long-Horizon Execution Loops
Running an open-weight model like DeepSeek within the Claude Code harness requires configuring the runtime environment for third-party provider access and visual tooling. Mustar shared a companion profile guide on Hugging Face Spaces outlining the integration pattern:
- OpenAI-Compatible Endpoint Configuration: Pointing Claude Code's custom profile configuration toward DeepSeek's API endpoint enables the open model to drive tool calling, code editing, and execution workflows.
- Visual Capture Toolchain Support: The agent requires access to a local development server and automated screenshot capabilities so that browser-rendered Three.js viewports can be converted into multimodal image inputs.
- Modular Assembly Patterns: Generating an entire airliner in a single generation step risks exhausting token context. The most effective loops assemble the aircraft modularly: fuselage tube and cockpit canopy, main wings and winglets, four turbofan engines with pylons, horizontal and vertical tail stabilizers, and landing gear.
The completed 3D scene, deployed as an interactive Hugging Face Space (Mike0021/deepseek-v41-flash-boeing-747), features full 360-degree OrbitControls navigation, realistic metallic PBR materials, and detailed engine assemblies, validating the high fidelity achievable through iterative visual feedback.
Practical Considerations: Token Budgeting and Three.js Optimization
Developers adapting visual self-verification loops for production tasks should account for three practical constraints:
First, token consumption and API expense management. An autonomous /goal loop running for several hours with repeated high-resolution screenshot inputs consumes substantial context window bandwidth and token volume. Setting programmatic iteration limits, execution timeouts, or milestone checkpoints within the harness is essential to prevent unintended cost overruns.
Second, toolchain and vision harness prerequisites. The agent's ability to self-correct depends entirely on reliable visual inputs. If the CLI harness cannot capture browser viewports or headless renderer output reliably, the agent falls back to blind text-based assumptions, defeating the purpose of the self-verifying architecture.
Third, Three.js rendering performance and geometry budgets. As the model refines visual realism, it may iteratively subdivide meshes or add procedural texture calculations that increase draw calls and reduce browser frame rates. Incorporating explicit optimization targets, such as geometry instancing, sensible segment counts, and draw call caps, directly into the initial prompt ensures the final asset remains performant on standard client hardware.
Original source
- Victor Mustar (@victormustar) Original Thread on X: Claude Code & DeepSeek-V4.1-Flash Boeing 747 Autonomous Loop Announcement — The original post by Hugging Face designer Victor Mustar detailing the self-verifying Three.js modeling loop, prompt structure, and video demonstrations.
- Hugging Face Spaces Boeing 747 3D Demo: DeepSeek-V4.1-Flash Three.js Boeing 747 Interactive Viewer — Live WebGL 3D inspection demo generated entirely through the autonomous vision improvement loop.
- Claude Code DeepSeek Profile Setup Guide: Claude Code Custom Profile Configuration Guide — Step-by-step documentation for integrating DeepSeek models into the Claude Code harness (Alternative mirror: townbox mirror guide).