[Bug] Code generation creates redundant file I/O in loop iterations

Resolved 💬 3 comments Opened Dec 8, 2025 by Mortoc Closed Feb 9, 2026

Bug Description
Just the worst understanding of how this should work. Wrote code that would spawn a .gltf file every frame. This is basic and stupid enough that I felt it was worth a bug rather than just typical "LLMs are dumb, deal with it" attitude. Here's the very stupid code it generated (using Bevy 0.17):


fn stream_in_level_assets(
    lobby_state: Option<Res<State<LobbyState>>>,
    levels_manifest: Res<LevelsManifest>,
    asset_server: Res<AssetServer>,
    mut commands: Commands,
) {
    let Some(lobby_state) = lobby_state else {
        return;
    };

    match lobby_state.get() {
        LobbyState::SearchingForMatch(search_context) => {
            let level = levels_manifest.get_level_by_id(search_context.level_id).unwrap();
            let scene_handle: Handle<Scene> = asset_server.load(&level.scene_path);
            commands.spawn(SceneRoot(scene_handle));
        }
        _ => {}
    }
}

Environment Info

  • Platform: linux
  • Terminal: tmux
  • Version: 2.0.31
  • Feedback ID:

Errors

[{"error":"AxiosError: Request failed with status code 403\n    at uR (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:25:1136)\n    at Unzip.<anonymous> (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:30:9845)\n    at Unzip.emit (node:events:531:35)\n    at Unzip.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1698:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at m7A.request (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:32:2129)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async rp2 (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:3623:15232)","timestamp":"2025-12-08T15:56:47.944Z"},{"error":"Error: Request was aborted.\n    at vl._createMessage (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:209:4515)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-12-08T15:58:04.224Z"},{"error":"Error: Request was aborted.\n    at Ck.makeRequest (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:359:3850)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-12-08T16:00:09.765Z"},{"error":"Error: Request was aborted.\n    at vl._createMessage (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:209:4515)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-12-08T16:21:44.639Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at Module.readFileSync (node:fs:441:20)\n    at Object.readFileSync (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:299)\n    at Ac2 (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:3616:956)\n    at Object.call (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:3441:1247)\n    at call.next (<anonymous>)\n    at Mq (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:727:1190)\n    at file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:1270:1385\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-12-08T16:23:46.478Z"},{"error":"Error: Request was aborted.\n    at vl._createMessage (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:209:4515)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-12-08T16:43:01.552Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at Module.readFileSync (node:fs:441:20)\n    at Object.readFileSync (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:299)\n    at Ac2 (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:3616:956)\n    at Object.call (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:3441:1247)\n    at call.next (<anonymous>)\n    at Mq (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:727:1190)\n    at file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:1270:1385\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-12-08T17:03:18.132Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at $D (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:1180:4413)\n    at file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:1180:4141\n    at Array.map (<anonymous>)\n    at _F (file:///nix/store/zav9df577vynbpqf6r1ld9cvzrzj5yxh-claude-code-2.0.31/lib/node_modules/@anthropic-ai/claude-code/cli.js:1180:4132)\n    at JSQ (file:///nix/store/zav9df577vynbpqf

Note: Error logs were truncated.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗