Context Injection in the System Prompt

The Idea

The agent needs to know what it’s working with. The system prompt is the cleanest place to tell it. Three sections do most of the work:

Available resources — what exists in the workspace:

## Available Data
- 12 notes in /notes
- Most recent: "Project kickoff"
- three projects in /projects
- Preferences at /preferences.md

Capabilities — what the agent can do:

## What You Can Do
- Create, edit, tag, delete notes
- Organize files into projects
- Search across all content
- Set reminders (write_file)

Recent activity — relevant context:

## Recent Context
- User created "Project kickoff" (two hours ago)
- User asked about Q3 deadlines yesterday

For long sessions, provide a way to refresh context mid-loop so the agent stays current as the workspace evolves underneath it.

Why It Matters

Without context injection, the agent operates on guesses. The most common failure isn’t that the agent can’t do something — it’s that the agent doesn’t know it can do something, or doesn’t know the thing the user just asked about exists. Injection costs a few hundred tokens and prevents most of those failures.