Skip to content

File mentions

Type @ in the input and Polyglot pops up a fuzzy-search list of the project’s files. Pick one (arrow keys, Tab or Enter to insert) or just type the path. On send, every @<path> in the message is replaced with the file’s contents inline, so the model has the file from the first token instead of spending a read_file call to go get it.

> what does @src/agent/loop.ts do, and where is the retry logic?

The transcript keeps your @-text as written and adds a dim note (attached src/agent/loop.ts (312 lines)) so it’s clear what was sent.

The picker lists files under the working directory, with these left out:

  • anything matched by the repo’s root .gitignore and .git/info/exclude
  • node_modules, .git, dist, build, coverage, and the usual build/cache dirs
  • secret files - .env, *.pem, anything under .ssh/

It’s loaded once when the session starts and capped at 2,000 entries, so on a very large repo type the path rather than scrolling.

  • The @<path> token is replaced with a <file path="…">…</file> block.
  • 64 KB per file. Anything past that is cut with a [... truncated] marker.
  • A @<path> that doesn’t resolve to a readable file is left untouched - it’s just text.
  • Secret files are never inlined. A @.env gets a skipped .env (secret file) note instead, so a stray mention can’t leak one into the prompt.

Inlined file contents go to the model provider like any other prompt text - see Data handling.

The same @ picker suggests agent definitions and skills when you have them. @<agent> <task> at the start of a message runs that agent; @<skill> anywhere in a message activates that skill.

File mentions work in -p mode too:

Terminal window
polyglot -p "summarize @CHANGELOG.md for a release announcement"