Example requests
Ask your coding agent which reference material an agent should always have on hand. It can attach those documents as files.“Give the sales agent our pricing sheet and competitor comparison to reference on every call prep.”
“Attach our refund policy and support macros so the support agent can read them before drafting replies.”
How files work
Files live in your project undersrc/files/, grouped into folders called file sets. Attach a set with sandbox: defineSandbox({ files }) on defineAgent(), and Keystroke materializes its contents into /workspace/agent before a prompt runs.
src/agents/support.ts
defineSandbox({ files: true }), Keystroke uses the file set matching the agent’s slug (here, src/files/support/). The folder layout is preserved under /workspace/agent, so src/files/support/context/seed.txt becomes /workspace/agent/context/seed.txt. Point the agent at the paths it should read from the systemPrompt.
Files vs skills
Files and skills both materialize into the agent workspace, but they serve different purposes:| Files | Skills | |
|---|---|---|
| What it is | Static context: documents to read | A playbook: instructions for a task |
| Where it lands | /workspace/agent/{path} | /workspace/agent/skills/{slug}/ |
| Attach with | sandbox: defineSandbox({ files: true }) or defineSandbox({ files: "set" }) | skills: ["name"] |
| Reach for it when | The agent needs reference material | The agent needs procedural guidance |
Files vs memory
Files, the agent’s own file system, and memory all involve “files,” but they answer different questions: what you give the agent, what the agent writes during a run, and what the agent remembers across runs.Files (src/files/) | Agent file system (/workspace) | Memory | |
|---|---|---|---|
| Who owns it | You, authored in your project and version-controlled | The agent, scratch space it reads and writes during a run | The agent, written and recalled automatically |
| What it’s for | Static context the agent should read | Working files for the current task | Carrying knowledge between sessions |
| Where it lives | Seeded into /workspace/{path} | /workspace | A memory area outside /workspace (MEMORY.md, USER.md, archived notes, searchable past sessions) |
| Lifetime | Re-seeded the same way every session | The session’s workspace | Persists across sessions |
memory: false on an agent to make it stateless.
Files and the sandbox
Files seed the agent’s/workspace, the same sandbox the agent uses for its file system and bash tools. Seeding is idempotent: files are written once per session and the agent’s own edits during a run are preserved.
Next steps
Attach files to agents
Use the agent’s set or a shared set.
Skills
Give agents reusable playbooks alongside files.
Build agents
Configure models, tools, skills, and files.
Sandboxes
How the agent workspace and file system work.