Skip to content

Sharing Context Between Agents

Agents don’t communicate with each other directly — but they don’t need to. The file system is the shared medium. One agent writes a file; another reads it. This is how you build multi-agent pipelines that compound in value over time.

Everything an agent produces is saved as a file. That file can be read by any other agent in any other session. You coordinate the handoff simply by pointing the second agent at the right file.

Example pipeline:

  1. Summarisation agent reads last week’s call recordings and produces customer-pain-points.md.
  2. Content agent reads customer-pain-points.md and drafts 5 blog posts addressing those themes.
  3. Sales agent reads customer-pain-points.md and personalises outreach emails to leads who have expressed similar pain points.

Three agents, three separate folders, one shared file. No complex orchestration required.

Pointing an Agent at a File from Another Folder

Section titled “Pointing an Agent at a File from Another Folder”

You can reference any file on disk in your prompt — regardless of which folder you’re currently in:

“Read ~/call-summaries/customer-pain-points.md and use the findings to plan the next 10 blog posts.”

Or drag the file into the CLI to pre-fill the path.

Having One Agent Produce Output for Another

Section titled “Having One Agent Produce Output for Another”

When asking an agent to produce output that will be consumed by another agent, tell it:

  • The exact filename to use (so it’s predictable).
  • The format to use (Markdown is usually the most portable).
  • The location to save it (the target folder).

For example:

“Summarise all customer objections from last month’s calls. Save the output as ~/sales-outreach/objection-summary.md so the outreach agent can reference it.”

The same principle applies when multiple people are involved. If your team shares a Git repository or a shared drive:

  • One person’s agent produces a research file and commits it.
  • Another person’s agent reads that file in their local session.
  • Both agents are building on the same growing knowledge base.

Over time, this shared context becomes a significant asset — the team’s collective knowledge, encoded in files, accessible to any agent at any time.

Because agents can read files written by other agents, you can use this to enforce consistency. If you want your sales agent to write with the same tone as your blog agent:

  1. Ask the blog agent to produce a sample piece.
  2. Point the sales agent at that sample: “Read ~/blog-posts/sample-post.md and match this tone of voice in all emails.”

This is particularly effective because the CLI is purpose-built to mimic patterns from existing context. Providing strong examples is often more effective than writing detailed tone-of-voice instructions.

  • Files on disk are the shared medium between agents — one writes, another reads.
  • You build multi-agent pipelines simply by directing agents to read each other’s output files.
  • Use predictable filenames and locations to make handoffs reliable.
  • Shared folders (via Git or a shared drive) let teams build a collective knowledge base over time.
  • Providing example files is often more effective than writing detailed style instructions.