Why Routines Matter
When testing agents, we found they waste enormous amounts of tokens processing data and computing indicators during runtime. An agent might get candles, then write Python code to compute EMAs and support/resistance—spending tokens on computation that should be deterministic. By moving this into routines:- Session time dropped from 2 minutes to under 1 minute
- Token usage reduced significantly
- Results became reproducible and debuggable
Routines vs Skills
Skills and routines serve different purposes:
When to use routines: Specific tasks you want done reliably every time—fetching market data, running technical analysis, generating reports, monitoring conditions.
When to use skills: Teaching an agent how to approach a category of problems where interpretation and judgment are needed.
Routines vs LLM Reasoning
Routine Structure
Every routine is a Python file with two components:- Config class - A Pydantic BaseModel defining the arguments/parameters
- Async run method - The entry point that executes the routine
The
Config class docstring becomes the routine’s description in the UI. Use Field(description=...) to document each parameter.Execution Modes
One-Shot Routines
Execute once and return a result. Can be scheduled to run at regular intervals.Continuous Routines
Run indefinitely with a while loop until stopped. Useful for monitoring and alerting. Mark withCONTINUOUS = True.
Running Routines
From Telegram
Access routines through the Condor menu:- Run once - Execute immediately in the current chat
- Run in background - Execute and send output to chat when complete
- Schedule - Run at regular intervals (e.g., every 30 seconds, hourly)
From Agent Sessions
Agents can invoke routines as part of their decision process—see Calling Routines below.Types of Routines
Global Routines
Routines in~/condor/routines/ are available to all agents. These include built-in routines for common tasks like technical analysis, funding rates, and volume analysis.
Agent-Specific Routines
Routines in an agent’sroutines/ folder are specific to that agent:
Agent-specific routines override global ones with the same name.
Calling Routines
Agents invoke routines via MCP tools:View Available Routines
Ask Condor what routines are available:Built-in Routines
Condor includes several built-in routines in~/condor/routines/:
Creating Routines with Condor
Condor can write routines for you. Simply describe what you want:- Zero coding required - Describe what you want in natural language
- Instant feedback - Run the routine and see results immediately
- Iterative refinement - Ask Condor to modify the routine based on output

