Skip to main content
Without a project map the agent opens every task blind. It guesses directory names, guesses which programs are installed, and guesses which shell it is talking to — and every wrong guess costs a full round trip to learn something one orientation pass establishes once. The GAIA agent now runs that pass at the start of every task and puts the result in the session context at the start of the first user message.

What it contains

The token budget

600 tokens. That is 1.8% of the NPU profile’s 32,768-token window (NPU_CTX_SIZE) and 0.9% of the GPU profile’s 65,536. It is sized against the smaller window on purpose — a budget that only holds on 64K is not a budget. Measured with GAIA’s shared estimator (count_tokens — cl100k, or an estimate that leans high when tiktoken is absent), so it bounds the map to within that estimator’s error of the model’s own count rather than to the exact token. render_project_map() enforces it on every render. Sections are emitted in priority order and the directory listing carries its own sub-cap, so on a 2,000-directory monorepo the platform quirks and the command list still survive while the tree is what gets trimmed.

Which directories count as a code repository

The predicate is testable, not a judgement call. is_code_repository(path) is true when a version-control directory or a recognised manifest sits at the root — non-recursive, so a home directory full of repositories is not itself one.
.git, .hg, .svn
pyproject.toml, setup.py, setup.cfg, requirements.txt, package.json, Cargo.toml, go.mod, pom.xml, build.gradle, build.gradle.kts, CMakeLists.txt, Makefile, Gemfile, composer.json

Platform quirks

Three, and only three — the differences that change the text of a command the model emits. A contributor can check the list off:
  1. Path separator — \ on Windows, / elsewhere.
  2. Path quoting for spaces — double quotes on Windows, single quotes on POSIX.
  3. Shell dialect — cmd.exe or PowerShell on Windows; $SHELL’s basename otherwise.

Automatic code indexing

By default the code index is built on the first search_code_index, not at task start, and the map says the index is not built yet. Opt in to building it in a background thread at task start, at most once per session:

Choosing the root

Resolution order:
  1. project_root on GaiaAgentConfig
  2. the GAIA_PROJECT_ROOT environment variable
  3. the session’s working directory, or the nearest repository above it — searching upward until the home directory or the filesystem root, whichever comes first
The session’s working directory is the folder the client said it was started in — the terminal app sends its start folder with every request (/query’s working_directory) — and otherwise the agent process’s own working directory. The daemon starts the agent in its own folder, so without the client’s folder the map would describe the daemon’s folder, not your project. Sending the start folder changes only where relative paths and the map resolve; it does not change which folders the agent may read. A working directory anywhere inside GAIA’s own source tree is rejected — in dev mode the agent sidecar is launched from its package directory inside the GAIA checkout, and mapping (and auto-indexing) its own source is never what the user asked for. An explicitly configured root is exempt: pointing GAIA at GAIA is fine when you mean it. Only a source or editable checkout counts as GAIA’s own tree. Installing GAIA into a virtualenv inside your own project — the embedded-SDK layout — leaves your project mapped normally. If none of those is a repository the agent gets no map at all. That is the right answer, not a degraded one — an agent answering questions from a home directory is not in a project, and a map of ~ would spend tokens describing nothing.
A GAIA_PROJECT_ROOT that does not exist raises at startup rather than being quietly ignored.

Project instructions and skills

With a model that gets the full project context, the agent reads the project’s own instructions the way Claude Code does. Which models get it is a per-model choice, because the payoff is: on repository work Claude scores higher with them, while a smaller model such as DeepSeek V4.1 Flash scores the same and spends about half again as many input tokens.
GAIA_PROJECT_CONTEXT set in the agent’s environment overrides the config value. A value other than these three fails at startup. Switching models mid-session applies the new model’s level. With the full context:
  • AGENTS.md and CLAUDE.md at the project root go into the system prompt whole, under ==== PROJECT INSTRUCTIONS ====, as the project’s rules for how to work in it. They are marked as coming from the repository, not the user: they never override the user’s request, the agent’s safety rules, or when a tool must ask before it runs. Both are read when both exist (AGENTS.md first); an identical copy is shown once. A hosted model gets up to 60,000 characters; a local model you set to full gets half of what it allows one tool result (about 15,000 on NPU, 30,000 on GPU), so a long file cannot crowd a small window. Past the cap, the agent gets the first whole lines and the line to continue from with read_file; the rest of the file is never read into memory.
  • .claude/skills/<name>/SKILL.md under the project root are listed in the skill catalogue, so the agent can load one by name when the work matches. A Claude Code skill GAIA’s own format would reject — an uppercase or underscored name, a name that differs from its folder, a missing or very long description — still loads, with a warning in the log saying what was relaxed. Skills in ~/.claude/skills stay loadable by name but unlisted. Without the full context, project skills are loadable by name but unlisted too.
Both come from the root chosen below. Outside a project, a working directory that holds an AGENTS.md or CLAUDE.md still has it read, but the agent never searches upward for one, and never reads one from the home directory or from GAIA’s own source tree. An AGENTS.md or CLAUDE.md that is a link to a file outside the project is named in the prompt but not read. The instructions are read once per session, so editing the file mid-session takes effect in the next session. A session whose prompt carries the instructions stores no skill lessons: a lesson outlives the repository, and nothing else would mark repository text as content the user did not write. A project skill never grants itself anything when loaded: a .claude/skills folder arrives with a clone, so its tools and shell-binary permissions stay deferred. A tool-providing one is refused when the agent asks to load it. To trust one, copy it into your own skills, which take precedence over the project’s copy, then promote it:
With the full context, when the session has a mapped project (its root, found from any subfolder; never GAIA’s own source), the flagship also gets a short working in a code repository section: ground every claim in code read this session and search the whole repository before saying something is missing or counting it; follow a change across callers, tests, docs and its inverse path; verify commands and paths a change documents; fix root causes rather than the reported example and run only the tests that cover the change; and check the deliverable against the task’s and project’s rules before finishing. It is general practice, not any one repository’s rules, and is left out in fast mode.

Trusting a folder

A cloned repository can carry its own CLAUDE.md, AGENTS.md and .claude/skills, so under auto GAIA asks once per folder before putting them in a prompt, as Claude Code does. The question names the files it would read. The terminal UI, the Agent UI and gaia chat show it the first time a session with a Claude model starts in that folder; the answer is kept in ~/.gaia/project_trust.json, beside config.json, and applies to every later session there.
  • Trust: the folder behaves as before.
  • Don’t trust: the folder is treated as off: its files stay out of the prompt, and GAIA does not ask again.
  • Nobody to ask (gaia -p, a pipe, a script): an unanswered folder is not loaded and nothing waits. --full-access, and Full access in the apps, count as trusting every folder without asking.
  • project_context full is your own choice, so it never asks, and off never loads. Only auto consults the saved answers.
The answer belongs to the folder, not to what is in it. GAIA saves it under the folder’s path, with links resolved, and not against the files themselves, so a git pull that adds or changes a CLAUDE.md, an AGENTS.md or a skill brings no new question: a trusted folder loads the new files from its next session on, and a declined one stays off. Working in a subfolder of a repository uses the repository’s answer. A moved or renamed folder, or a second clone, is a new path, so GAIA asks about it again. A folder with none of these files is never asked about until one appears. To forget an answer, delete its entry from project_trust.json, or the whole file.

Caching

The map is built once per root and reused. It is rebuilt when a fingerprint over four things changes: the top-level directory listing, every manifest’s size and mtime, the VCS head, and PATH. Between changes, repeated queries reuse one walk.

Code Index

The semantic index the map triggers.

Memory

Day-0 system facts, from the same binary probe.