Skip to main content
Routines are deterministic Python workflows that process data consistently. Unlike skills which load instructions into context for the LLM to interpret, routines are lightweight Python files that execute directly and return results—no tokens spent on interpretation.

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
If Python code can be created by the agent, it should be encapsulated in a routine so it can be reused without spending tokens.

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:
  1. Config class - A Pydantic BaseModel defining the arguments/parameters
  2. 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 with CONTINUOUS = True.
Continuous routines must handle asyncio.CancelledError to clean up gracefully when stopped.

Running Routines

From Telegram

Access routines through the Condor menu:
Options when running:
  • 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)
To stop a running or scheduled routine:

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’s routines/ folder are specific to that agent:
This design lets you share an agent folder with someone else—they get everything needed to run it.
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:
Condor generates the Python file, and you can immediately run or schedule it. This is particularly powerful because:
  • 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
You can create routines from your phone via Telegram. Describe what you need, have Condor write the code, schedule it, and receive reports—all without touching a keyboard.