Examples
Examples
Section titled “Examples”Real-world CTX statements organized by use case. Each example shows the CTX syntax and what it does.
Tool Discovery & Execution
Section titled “Tool Discovery & Execution”// Discover tools matching a keyword?t github
// Search for tools by role?t #code ^10
// Inspect a specific tool's schema!t github.issues.create
// Call a tool with arguments>t github.issues.create title="Fix SSE heartbeat" labels="bug,p1"
// Call with multiple arguments>t godot.assets.decimate_mesh sourcePath="res://dragon.glb" targetRatio=0.1
// List issues with filters>t github.issues.list state="open" labels="security" ^5Knowledge Search
Section titled “Knowledge Search”// Semantic search with time window and limit?k "mesh decimation algorithm" #pipeline @7d ^3
// Search by tag only?k #architecture @30d ^10
// Multi-tag search?k "authentication" #code #security ^5
// Search with project scope?k "deploy process" *my-project @30d
// Ingest a document+k "api-reference" source="docs/api.md"
// Exact lookup by ID!k doc-abc123Memory Operations
Section titled “Memory Operations”// Store a decision+m auth-decision #architecture "JWT for API, session tokens for WebSocket"
// Store a lesson learned+m "singleton-antipattern" #my #lesson "Singleton breaks parallel tests"
// Recall recent memories?m #architecture @7d ^5
// Recall team decisions?m #team #decision @30d
// Update a memory~m auth-decision "Updated: switched from JWT to PASETO"
// Delete obsolete memory-m old-decision
// Search by memory kind?m #fact @30d ^10?m #lesson #my @7d
// Search by memory layer?m #my @7d Individual memories?m #team @30d Team memories?m #org @90d Organization memoriesMemory Decorators
Section titled “Memory Decorators”// Find similar memories (vector search)?m @similar "auth-decision" #k:5
// Graph traversal?m @traverse auth-decision #depth:3
// Create a graph relationship+m @relate auth-decision->informs->api-design "JWT choice shapes API"
// Track changes?m @changes #since:2026-03-01
// Promote memory to a higher layer+m @promote lesson-42 #layer:team
// Ground a statement in existing memory+m @grounded memory-abc "verified against original decision"
// Filter by decay threshold?m @decay #threshold:0.7Skills
Section titled “Skills”// Find relevant skills?s "process 3D assets" ^3
// Inspect a skill!s godot-mcp-roles
// Register a new skill+s deploy-pipeline "Steps: lint, test, build, deploy"
// Execute a skill>s deploy-pipeline env="staging"Agent Coordination
Section titled “Agent Coordination”// Discover available agents?a "code reviewer"
// Delegate work to an agent^a code-review agent="claude-opus" context="PR #42"
// Unregister an agent-a agent-123Pipeline Verbs (Cognition Traces)
Section titled “Pipeline Verbs (Cognition Traces)”// A typical reasoning workflow+m:context "reviewing PR #42 for security vulnerabilities"+m:check "OWASP top 10 compliance verified"+m:edge "SQL injection possible via search endpoint query param"+m:escalate "injection vulnerability found" #p0 #security+m:cross_ref "see ADR-006 for parameterized query patterns"+m:task "refactor search to use parameterized queries" #todo+m:complete "security review finished, 1 critical finding"
// Handoff to next agent+m:handoff "security review done, remediation needed" #stateHybrid Mode (Mixed Prose + CTX)
Section titled “Hybrid Mode (Mixed Prose + CTX)”I need to check if authentication is already implemented.?k "auth" #code ^3Looks like we have JWT but no refresh token support. Let me store that gap.+m "auth-gap" #architecture "no refresh token implementation"I'll delegate the implementation to the security specialist.^a implement-refresh agent="security-agent" context="add refresh tokens"LLM Operations
Section titled “LLM Operations”// Direct LLM inference>l "Summarize the architectural decisions from this sprint" model="claude-sonnet"
// Generate embeddings>l:embed "mesh decimation algorithm" model="text-embedding-3"Inspection
Section titled “Inspection”// Query the CTX grammar at runtime?i grammar
// Returns the full operator × plane matrix, valid combinations,// filter syntax, verb list, and example statementsMulti-Statement Batches
Section titled “Multi-Statement Batches”The parser supports multiple newline-separated statements with // comments:
// Sprint review workflow?m #decision @14d ^10?m #lesson @14d ^5+m sprint-review #milestone "Q1 sprint 4 complete"
// Handoff checklist!m parser-state!m sse-state+m:handoff "sprint review complete" #state- Formal Specification → — the EBNF grammar
- Syntax Overview → — back to the basics