It scans a fixed set of locations for instruction files, skills, and MCP configuration, then pushes the result to Coder as a single context snapshot.
Chats never scan the workspace themselves; they read the snapshot the agent pushed.
A workspace-attached chat pins one snapshot.
The pinned copy is what the agent's system prompt and tool list are built from, so a chat keeps working with a consistent view of your skills and MCP tools even while you edit files in the workspace.
The lifecycle of an edit looks like this:
1. You add a skill, edit `.mcp.json`, or change an instruction file in the workspace.
1. A file watcher notices the change, and the agent re-scans after a short period and then pushes a new snapshot.
1. Chats that have not pinned a snapshot yet pin the new one immediately.
1. Chats that already pinned an older snapshot are marked out of date instead of being switched over.
1. Selecting **Refresh context** in the chat re-pins that chat to the latest snapshot.
This is why an in-flight chat can keep using an older snapshot: a push never rewrites a chat's pinned context.
The pin only moves when the chat is first hydrated or when you refresh it.
The agent publishes nothing until the workspace is ready.
Until startup scripts finish, the agent holds an empty snapshot, so a chat opened during workspace startup can show no skills and no MCP tools until the first real push lands.
### Where the agent looks
Each scan location is a scan root.
The agent scans the following:
- The workspace working directory
-`~/.coder` and `~/.coder/skills`
-`~/.claude/plugins/cache`
- Any additional source you declare through the agent's context sources API
Declared sources contribute instruction files and skills only.
A `.mcp.json` file inside a declared source appears in the context inventory, but the agent does not connect to the servers it lists; MCP servers load only from the workspace working directory.
Discovery is shallow.
Instruction files (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`) and `.mcp.json` are read only at the top level of a scan root, and skills are read only from the fixed container directories described below.
The agent never walks further down the tree and never climbs to a parent directory.
To pick up context in another directory, declare that directory as its own source.
### Snapshot limits
A snapshot is capped so a large workspace cannot flood a chat's prompt:
| 64 KiB per file resource | The resource is reported with an oversize status and no content, so the chat lists it but cannot read it |
| 2 MiB of file content across a snapshot | Resources past the cap are reported as excluded with no content |
| 500 resources per snapshot | Resources past the cap are reported as excluded with no content |
The byte caps measure file contents, such as instruction files and skill files.
MCP server entries count toward the 500-resource cap, but their tool definitions are not measured by the byte caps.
Excluded and oversize resources still appear in the chat's context list with their status and error, so a dropped skill or instruction file is visible rather than silently missing.
Because `~/.coder/skills` is itself a scan root, skills placed directly under it are discovered too.
Each discovered skill contributes its name and description to the `<available-skills>` block in the agent's system prompt.
The full instructions are loaded only when the agent calls a tool, and they are served from the chat's pinned snapshot rather than read live from the workspace.
A skill added after a chat pinned its snapshot appears in that chat after you refresh its context.
A larger file is reported with an oversize status and contributes no content to the chat.
- Supporting files have a maximum size of 512 KB.
Files exceeding the limit are silently truncated.
A skill with its frontmatter missing, unparsable, not kebab-case, or not matching its directory name is reported as invalid and contributes no instructions.
`SKILL.md` file can be up to 64 KB, and each user can create up to 100 personal skills.
Personal skills are stored in Coder, not in the workspace, so they are not part of a workspace context snapshot and do not depend on a pin or a refresh.
`.mcp.json` file in the workspace working directory.
The agent connects to these servers, reports their tools in the context snapshot it pushes, and chats register those tools alongside their built-in tools.
The agent connects to the servers declared in `.mcp.json` once startup scripts finish.
Servers that fail to connect are skipped, and the rest still contribute their tools.
A single set of connections is shared by tool discovery and tool execution, so each declared server is launched once.
When the connected tool list changes, the agent re-scans and pushes a new snapshot.
Editing `.mcp.json` does not require a workspace restart.
The agent notices edits to the file and reloads its servers automatically.
The reload changes the pushed snapshot, but an MCP-only change does not mark existing chats out of date, and the dashboard offers **Refresh context** only on chats that are marked out of date.
New chats and chats that have not pinned a snapshot yet receive the new tool set immediately.
An existing chat keeps its current tool set until another context change, such as editing an instruction file or a skill, marks it out of date; refreshing then re-pins the whole snapshot, including the new MCP tools.
The snapshot carries tool definitions only, not a way to run them.
Every workspace MCP tool call is proxied back through the workspace agent, so a chat can list workspace MCP tools while the workspace is unreachable, but calling one requires a running workspace with the server connected.