GDSense features

Automatic Project Context in GDSense: Open Script and Project Map

See how GDSense includes your open script and a compact project map, how to leave either out, and what is never sent automatically.

Published Updated

All documentation

The short answer

GDSense gives every conversation a head start. In Chat, it attaches the script or shader open in your editor and a compact project map listing your project name, Godot version, main scene, autoloads, and scenes and scripts by folder. Agent Mode receives the same map on every start, plus the open script as a starting point. Each attachment appears as a chip above the prompt box: select × to leave it out of one message, or turn either off under Settings → Context. Scripts that contain a recognized private key or live API key are held back, and credential files such as export_presets.cfg, .env files, keystores, and certificates are never included, along with folders marked with .gdignore and editor caches.

What does GDSense include automatically?

Two attachments travel with your questions so answers fit your code from the first message: the script you are working on, and a short map of the project around it. Both are shown before you send, and both are sent only when they add something new to the conversation.

Automatic attachments in Chat and Agent Mode
AttachmentWhat it containsIn ChatIn Agent Mode
Open scriptThe GDScript, C#, or shader file active in the script editor, including unsaved editsSent once per conversation, and again after you change itA saved script is passed as a starting point the Agent reads when the task needs it
Project mapProject name, Godot version, main scene, autoloads, and scenes and scripts grouped by folderSent once per conversation, and again when files are added, removed, or renamed or an autoload changesIncluded with every Agent start

Keep in mind: When a script changes after GDSense has sent it, the new copy is marked as updated so the answer works from your latest code rather than an older version earlier in the conversation.

What does the project map look like?

The map is a compact outline, not a file dump. Scene, script, resource, and shader files are listed by name, other files such as art, audio, and data are counted per folder, and third-party addons are summarized in one line. Its size is capped, so a large project produces a folder-level outline rather than a longer block. The map never contains file contents.

Because the map names your real scenes, scripts, and autoloads, answers can refer to them directly instead of guessing at plausible names. In Agent Mode it also lets a run go straight to the right files instead of spending its first steps exploring the project.

Example project map for a small platformer
## Project Map
Project: Skyward (Godot 4.7), main scene res://scenes/main.tscn
Autoloads: AudioBus = res://autoload/audio_bus.gd, GameState = res://autoload/game_state.gd
res:// (2 files)
res://art/ (48 files)
res://autoload/: audio_bus.gd, game_state.gd
res://scenes/: level_1.tscn, main.tscn, player.tscn
res://scripts/: enemy.gd, player.gd
res://addons/ (1 addon)
(7 of 61 files listed)
Godot project organization guidelines

How do I leave an attachment out or turn it off?

Hover over a chip for details. The script chip shows the file’s full path, and the map chip previews the first lines of the map. When a tooltip says the attachment is already in this conversation, it is not sent again until its content changes, and the context meter counts only what the next message will actually carry.

  1. 1

    Leave it out of one message

    Select × on the Project map chip or the script chip above the prompt box. The attachment is skipped for that message only and returns for your next question.

  2. 2

    Turn it off entirely

    Open Settings → Context and clear Attach the open script automatically, Attach a project map automatically, or both. The choice is saved with your GDSense settings.

  3. 3

    Choose the exact copy yourself

    Type @openscript, or an @file that names the open script. Your command takes over and the automatic copy steps aside, so the file is never sent twice.

    @file res://scripts/player.gd#apply_gravity

What is never included automatically?

Automatic context is built to share your code, not your secrets. The open script is attached only when it is a script or shader file, and only when it does not contain a recognized private key or live API key. When GDSense holds a script back for that reason, its chip says so plainly.

The best protection is to keep secrets out of scripts altogether: read keys from environment variables or from a config file that stays out of version control. If a project must keep a secret in a script, turn off Attach the open script automatically under Settings → Context.

  • Scripts that contain a recognized private key or live API key are held back from the automatic path.
  • Scenes, resources, configuration, and other data files are never attached automatically; the map lists only the names of scene, script, resource, and shader files, never their contents.
  • Credential-bearing files such as export_presets.cfg, keystores, .env files, certificates, and service-account or credential JSON files are left out of the map entirely.
  • Folders marked with a .gdignore file are skipped, exactly as Godot skips them.
  • Editor caches, repository internals, and Godot’s .uid and .import sidecar files are excluded.

Keep in mind: A file held back from the automatic path is still yours to share: naming it with @openscript or @file sends it deliberately. Review any file for keys before attaching it that way.

Where does automatic context apply?

Automatic attachments apply to Chat questions and Agent Mode starts. Explain already sends the function and its script, so it skips them. Quick Edit and Refactor work on the code you selected, and autocomplete reads the code around your caret.

Automatic attachments do not change what a request costs: credits follow the reasoning mode you select. Retry resends a failed message with the same attachments it originally carried.

A first question that needs no context commands
Why does my player keep sliding after I release the arrow keys?
Keep the existing input actions and maximum speed.

Try this workflow inside Godot

Use GDSense to ask questions, attach the context you choose, and review proposed changes without leaving the editor.