agentc
GitHubagentc-sh/agentc
agentc
GitHubagentc-sh/agentc
›Introduction
Get started›Concepts in 5 minutes›Build your first agent›Add your first tool›Serve and connect
Concepts›Architecture overview›The manifest›The compilation pipeline›Archetypes›The graph›Tools and capabilities›Runtime libraries›Skills›Agents and prompts›Serving and protocols›Observability
Guides›Author a manifest›Write a tool›Give your agent a filesystem›Control network egress›Connect external tools via MCP›Connect agents via A2A›Use the bash tool›Control tool access with capabilities›Write templated prompts›Manage prompts with Langfuse›Pass context from the client›Configure a model provider›Connect a CopilotKit frontend›Deploy a standalone binary›Deploy with Docker and PostgreSQL›Instrument with OpenTelemetry›Extend code generation with blocks
Reference
Manifest
Runtime
Standard library
Filesystem
›TypeScript
HTTP
›Observability

Filesystem

The virtual filesystem the runtime provides to component code.

The filesystem is a POSIX-style filesystem assembled by the runtime. It is not the host filesystem. What a component sees at a path is what the agent's manifest mounted there, which may be an in-memory store, a directory on the host, a read-only view of either, or an overlay of two.

Availability
TypeScript
agentc:fs

The runtime provides agentc:fs to every TypeScript component it executes.

What the runtime controls

The filesystem a component sees is assembled from mounts, and component code cannot reach around it. There is no path that escapes the mount table, and a mount backed by a host directory exposes that directory and nothing above it. See filesystem for how the mounts are declared.

Paths

Paths are POSIX-style regardless of the host platform, so separators are forward slashes on every host. An absolute path resolves from the root of the virtual filesystem. A relative path resolves against the working directory.

Errors

Every failure is an error the calling code can catch. Errors carry a message, and matching on the message is how code distinguishes them.

CategoryRaised when
Not foundA path that must exist does not.
Already existsA path that must not exist does.
Not a directoryA path component that must be a directory is not.
Is a directoryAn operation on a file was given a directory.
Permission deniedThe mode bits, or a read-only mount, refuse the operation.
Path escapes authorityA path resolves outside the authority the mount grants.
Cross-backend renameA rename would move a path from one backend to another.
UnsupportedThe backend does not implement the operation.

Differences you can observe

  • readlink returns an absolute path, because a symbolic link's target is resolved against the working directory and stored absolute when the link is created.
  • readdir results are sorted.
  • rm removes a symbolic link itself rather than following it to its target.
  • mkdir and mkdtemp return the path they created.

Operations that are absent

link, utimes, futimes, realpath, statfs, watch, cp, and opendir are not present. Their absence is deliberate.

Bindings

See TypeScript for every export of agentc:fs.

← PreviousTypeScriptNext →TypeScript

© 2026 pogue.dev. All rights reserved.

Creative CommonsCC BY 4.0
On this pageWhat the runtime controlsPathsErrorsDifferences you can observeOperations that are absentBindings

Search docs

Search the agentc documentation