Tutorial 2 of 729% complete
All tutorials
8 minBeginner

Fluent AI Memory

How automatic context loading works

Fluent AI Memory

How Continuity makes your AI proactive about decisions.

How It Works

Continuity generates instruction files that your AI reads on startup. These files contain specific triggers that tell the AI when to use memory tools:

TriggerAI Action
User asks architectural questionSearch for related decisions first
User explains reasoningOffer to log as a decision
User considers changesCheck for conflicts with past decisions
User mentions being stuckTrack as a blocker
Session endsOffer to save summary

When your AI follows these instructions, it behaves proactively without you having to ask.

What the Instruction Files Contain

Continuity generates CLAUDE.md (for Claude Code), .cursorrules (for Cursor), and .github/copilot-instructions.md (for Copilot).

Here's what they tell the AI:

markdown
## WHEN TO USE CONTINUITY TOOLS

### When User Asks Architectural Questions
When the user asks "should we use X?" or "what about Y for Z?":
→ Call search_decisions with the relevant topic BEFORE answering
→ Share what you found: "I found decision-X about this topic..."
→ Base your recommendation on existing decisions when relevant

### When User Explains a Choice
When the user says "let's use X because Y" or explains their reasoning:
→ Offer to log it: "Want me to log this decision?"
→ If they agree, call log_decision with question, answer, and tags

### When Suggesting Changes
Before recommending architecture changes or new dependencies:
→ Call search_decisions to check for existing decisions
→ If conflicts exist, mention them: "This would conflict with decision-X..."
→ Let the user decide whether to proceed

See the Proactive Behavior

Architectural questions

You: "Should we use WebSockets or polling for real-time updates?"

AI: Reads instruction file, searches decisions

"Let me check what we've decided about real-time features... I found decision-34 where you chose Firebase for push notifications and noted a preference for managed services. Given that, you might consider a managed WebSocket service. What's your preference?"

Offering to log

You: "Let's use Redis for the job queue because it has atomic operations and we're already using it for caching."

AI: "That makes sense — consolidating on Redis instead of adding another dependency. Want me to log this decision? We'll remember the reasoning if it comes up later."

Detecting conflicts

You: "What if we use SQLite instead of PostgreSQL?"

AI: Searches database decisions

"Before we go that direction, I found decision-12 where you chose PostgreSQL specifically for ACID transactions with financial data. SQLite would handle that differently. Should I search for more context on why PostgreSQL was important?"

Why This Works

The instruction files include:

  1. Specific triggers — "When the user asks X, do Y"
  2. Clear actions — Search, offer to log, check conflicts
  3. Example dialogues — Shows the AI expected responses
  4. Tool syntax — How to call each MCP tool

AI assistants follow instructions they read at conversation start. The more specific the instructions, the more reliable the behavior.

What Gets Generated

The instruction files include:

  • Project statistics — Total decisions, last updated
  • Known topics — Top tags from your decisions
  • Recent decisions — Last 10 decisions with IDs and summaries
  • Behavioral triggers — When to search, log, check conflicts
  • Tool syntax — How to call each Continuity tool

Files are regenerated:

  • On extension startup (if older than 24 hours)
  • After logging a new decision
  • Manually via "Continuity: Regenerate Instruction Files"

If Your AI Isn't Proactive

Some AI tools don't reliably read instruction files. If the proactive behavior isn't happening:

Check the files exist

bash
ls CLAUDE.md .cursorrules .github/copilot-instructions.md

Regenerate them

output
Cmd+Shift+P → "Continuity: Regenerate Instruction Files"

Remind your AI

You: "Read the CLAUDE.md file and follow its instructions about using Continuity."

Fall back to explicit requests

The tools always work when you ask directly:

  • "Search for decisions about authentication"
  • "Log this decision: We chose X because Y"
  • "What decisions do we have for this project?"

Customizing the Behavior

The generated section is marked and won't overwrite your own content. You can add custom instructions above the marker:

markdown
# My Project

## Custom Rules
- Always use TypeScript strict mode
- Prefer functional components

<!-- AUTO-GENERATED BY CONTINUITY - DO NOT EDIT BELOW THIS LINE -->
[generated content here]

Your custom rules will be preserved when Continuity regenerates.

Key Takeaways

  1. Instruction files drive behavior — AI reads them at session start
  2. Specific triggers work best — "When X happens, do Y"
  3. Files auto-regenerate — Kept fresh with recent decisions
  4. Fallback to explicit — Direct requests always work
  5. Custom rules preserved — Add your own above the marker

← Quick Start | Decision Logging →