Developers working with autonomous agents like Claude Code or Codex often hit a frustrating wall the moment they switch machines or start a new session. An agent that spent three hours mapping out a complex codebase on a Mac mini suddenly becomes a stranger when the same project is opened on a MacBook. This memory fragmentation is not just a convenience issue; it is a fundamental architectural flaw in how AI agents handle state. Currently, context is trapped within individual session logs or volatile memory, forcing developers to manually feed previous decisions back into the prompt or rely on cumbersome API-based database calls to maintain continuity.

The Infrastructure of a Shared Brain

To bridge this gap, sfs introduces a shared brain filesystem designed specifically for the needs of AI agents. Rather than treating agent memory as a series of database entries, sfs treats it as a synchronized volume that exists across multiple devices and sessions. This allows different agents, regardless of where they are running, to read and write to the same set of wikis, memory files, planning documents, and task artifacts in real-time. The system is built for macOS and Linux, allowing developers to integrate it into their existing workflows via Homebrew using the following command:

bash
brew install runbear-io/tap/sfs

Once installed, sfs transforms a local folder into a synchronized volume by linking it to a remote backend. The connection is established through a straightforward mount command:

bash
sfs mnt ./shared --remote s3://my-bucket/workspace

The system supports industry-standard backends, specifically Amazon Simple Storage Service (S3) and Google Cloud Storage (GCS). By mounting these remote buckets as local volumes, sfs ensures that any decision recorded by an agent in one session is immediately visible to an agent in another. This creates a persistent, shared state that mimics a collective consciousness for a fleet of AI agents.

Beyond Cloud Storage and the Latency Trap

At first glance, sfs might look like a standard cloud synchronization tool, but its internal logic is optimized for the specific way Large Language Models (LLMs) interact with data. Traditional cloud drives often employ offloading techniques, where files are removed from the local disk to save space and fetched from the cloud only when accessed. For a human, a two-second delay in opening a document is negligible. For an AI agent, however, network blocking during a file read can break the inference flow, introduce timeouts, or cause the agent to hallucinate based on incomplete data.

To solve this, sfs adopts a local-first approach. Every file in the synchronized volume is maintained as a physical file on the local disk at all times. This eliminates network-induced latency, ensuring that the agent can perform near-instantaneous read and write operations. To maintain the integrity of this distributed system, sfs utilizes content-addressable storage. This means that files are not just overwritten; their history is preserved. If an agent accidentally deletes a critical piece of logic or overwrites a plan, the previous state remains recoverable. Users can track the evolution of the shared brain and identify which device modified a file and when by using the following command:

bash
sfs log

The system also handles the volatility of remote connections. If a developer goes offline, the agents can continue to read and write to the local volume without interruption. Once the network connection is restored, sfs automatically pushes the local changes to the remote backend, ensuring the shared brain remains up to date across the entire ecosystem.

One of the most complex challenges in distributed filesystems is the conflict that arises when two agents edit the same file simultaneously. sfs resolves this through a deterministic playback mechanism based on a specific hierarchy: Lamport timestamps, wall-clock time, and device identifiers. By using Lamport timestamps—a logical clock used to determine the partial ordering of events in a distributed system—sfs can establish a clear causal relationship between edits. This ensures that all devices eventually converge on the same file state, preventing the dreaded conflict files that plague traditional sync tools.

This architectural shift moves AI state management away from the traditional API-driven database model and toward a filesystem-centric model. When agents share a folder rather than a database table, the barrier to collaboration drops. A support agent handling a customer ticket and an engineering agent fixing the underlying bug can both point to the same shared folder. They share the same context, the same logs, and the same resolution plan without requiring a single custom API integration. This continuity extends to hardware transitions, allowing a seamless handoff between a powerful workstation and a portable laptop.

For organizations, this provides a blueprint for a company brain. As team members use their respective agents to update a common wiki or technical specification within an sfs volume, every agent across the company gains access to the latest institutional knowledge. The focus for the developer shifts from managing the plumbing of data retrieval to optimizing the actual reasoning flow of the LLM, knowing that the underlying infrastructure handles the persistence and synchronization of context.

This transition toward filesystem-based shared memory marks the beginning of an era where AI agents are no longer isolated tools, but interconnected collaborators with a persistent, collective memory.