Sypha AI Docs
Prompting

Context Management

Master context management to unlock Sypha's full potential

Quick Reference

  • Context = All information Sypha knows about your project
  • Context Window = Maximum information Sypha can process at once (varies by model)
  • Token = Unit of text measurement (~3/4 of an English word)
  • Auto-management = Sypha automatically handles context through Focus Chain & Auto Compact

What is Context Management?

Context management defines the way Sypha preserves knowledge about your project during ongoing conversations. Consider it a shared memory space between you and Sypha - storing code, decisions, requirements, and development progress.

Context visualization showing the relationship between total context and context window

The Three Layers of Context

  1. Immediate Context - Active conversation and currently accessed files
  2. Project Context - Your codebase architecture, structure, and established patterns
  3. Persistent Context - Memory Bank, .sypharules, and project documentation

Understanding Context Windows

Each AI model features a context window - representing the upper limit of information it can handle within a single conversation. Measurement occurs in tokens:

Token Limits by Model

ModelContext WindowEffective Limit*Best For
Claude 3.5 Sonnet200,000 tokens150,000 tokensComplex tasks, large codebases
Claude 3.5 Haiku200,000 tokens150,000 tokensFaster responses, simpler tasks
GPT-4o128,000 tokens100,000 tokensGeneral purpose development
Gemini 2.0 Flash1,000,000+ tokens400,000 tokensVery large contexts
DeepSeek v364,000 tokens50,000 tokensCost-effective coding
Qwen 2.5 Coder128,000 tokens100,000 tokensSpecialized coding tasks

*Effective limit is ~75-80% of maximum for optimal performance

Token Math Made Simple

  • 1 token ≈ 3/4 of an English word
  • 100 tokens ≈ 75 words ≈ 3-5 lines of code
  • 10,000 tokens ≈ 7,500 words ≈ ~15 pages of text
  • A typical source file: 500-2,000 tokens

How Sypha Builds Context

Constructing effective context is what elevates Sypha's usefulness. Upon task initiation, Sypha takes an active role rather than passively awaiting information - proactively collecting project context, posing clarifying questions as necessary, and dynamically adapting to real-time developments. This integration of automatic discovery, user input, and adaptive responses guarantees Sypha possesses the appropriate information to address your challenges efficiently.

1. Automatic Context Gathering

Upon task initiation, Sypha takes proactive steps to:

graph LR
    A[Task Start] --> B[Scan Project Structure]
    B --> C[Identify Relevant Files]
    C --> D[Read Key Components]
    D --> E[Map Dependencies]
    E --> F[Build Mental Model]

What Sypha automatically discovers:

  • Project architecture and file organization
  • Import dependencies and relationships
  • Established code patterns and conventions
  • Configuration files and system settings
  • Recent modifications and git history (when using @git)

2. User-Guided Context

Though automatic discovery accomplishes much of the groundwork, you determine Sypha's focal points. The more precise and pertinent context you supply, the more effectively Sypha comprehends your requirements and produces accurate solutions.

You strengthen context through:

  • @ Mentioning specific files, folders, or URLs
  • Providing requirements using natural language
  • Sharing screenshots to establish UI context
  • Adding documentation via .sypharules or Memory Bank
  • Answering questions when Sypha requires clarification

3. Dynamic Context Adaptation

Sypha dynamically adjusts context throughout your interaction. It evaluates your request's complexity, remaining context window capacity, current task advancement, error messages and feedback, along with prior decisions from the conversation to identify the most critical information at every stage.

The Context Window Progress Bar

Track your context consumption in real-time:

Context window progress bar showing token usage

Understanding the Indicators

  • ⬆️ Input Tokens: Data transmitted to the model (your messages + context)
  • ⬇️ Output Tokens: Model's generated responses and code
  • ➡️ Cache Tokens: Previously processed tokens being reused (lowers costs and enhances speed)
  • Progress Bar: Visual depiction of token usage
  • Percentage: Current utilization of total available capacity

Automatic Context Management Features

Sypha incorporates intelligent mechanisms that automatically manage context:

Focus Chain (Default: ON)

Focus Chain preserves task continuity via automatic todo lists. Upon starting a task, Sypha creates actionable steps and refreshes them as work advances. This maintains critical context visibility even following Auto Compact execution, enabling progress tracking without reviewing the complete conversation.

Learn more →

Auto Compact (Always ON)

When context consumption reaches approximately 80%, Auto Compact automatically generates a thorough conversation summary. This retains all decisions and code modifications while creating space for ongoing work. A notification appears when this occurs. The task proceeds smoothly - no action required from you.

Learn more →

Context Truncation System

Should your conversation near the model's context window threshold before Auto Compact activates, Sypha's Context Manager automatically removes older conversation segments to avoid errors.

The system gives priority to essential elements:

  • Your initial task description remains preserved
  • Recent tool executions and their outcomes stay accessible
  • Current code status and active errors are maintained
  • The coherent flow of user-assistant dialogue continues

Elements eliminated first:

  • Duplicate conversation history from earlier task phases
  • Finished tool outputs no longer serving a purpose
  • Intermediate debugging procedures
  • Extended explanations that have fulfilled their function

This occurs automatically. Work continues uninterrupted, with Sypha retaining sufficient context to effectively resolve your challenges.

Best Practices

  • Be specific - Precise objectives enable Sypha to comprehend your requirements
  • Use @ mentions strategically - Reference particular files instead of complete folders
  • Monitor the progress bar - Yellow/red indicators suggest using /smol or /newtask
  • Trust auto-management - Focus Chain and Auto Compact automatically handle complexity
  • Use Memory Bank - Record persistent patterns and project conventions

Next Steps

On this page