codecloud
HomeDocsBlog
All posts

Scheduled Agents: Put Your Code Maintenance on Autopilot

February 16, 20265 min read

Every engineering team has a "someday" list. The dependency updates that are three major versions behind. The linter errors that you've temporarily suppressed. The old feature flags that need to be cleaned up.

These tasks are important, but they're never urgent enough to displace product work. So they pile up, turning into tech debt that slows everyone down.

Today, we're introducing Scheduled Runs for codecloud. You can now schedule AI agents to run on a recurring basis—daily, weekly, or monthly—to handle these maintenance tasks automatically.

The Nightly Janitor

Think of Scheduled Runs as a nightly janitor for your codebase. While you sleep, the agent wakes up, clones your repo, performs the maintenance task you've defined, and opens a Pull Request with the changes.

When you log in the next morning, you don't have to start by updating dependencies or fixing style violations. You just review a PR that's already green, merge it, and get on with your day.

How it works

Scheduled Runs work just like standard agent runs, but with a timing component. You provide a cron expression (or a specific future date) along with your prompt and repository details.

Here's how to create a weekly schedule that updates your npm dependencies every Monday at 4 AM:

curl -X POST https://codecloud.dev/api/v1/schedules \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "recurring",
    "cron_expression": "0 4 * * 1",
    "repo": "your-org/frontend-app",
    "prompt": "Run npm audit fix to resolve security vulnerabilities. Then check for major version updates for react and next, and attempt to upgrade them. If anything breaks, fix the code to match the new API.",
    "model": "claude-sonnet-4-5",
    "auto_create_pr": true,
    "pr_title": "Weekly Dependency Updates"
  }'

You can also manage your schedules directly from the codecloud dashboard, where you can view upcoming runs, pause schedules, or trigger them immediately for testing.

Top 3 Use Cases

1. Dependency & Security Updates

Tools like Renovate or Dependabot are great at opening PRs, but they can't fix the code when breaking changes occur. A codecloud agent can. It can read the changelog, update the library, run the build, see the errors, and rewrite your code to match the new library version.

2. Code Quality & Linting

If you're migrating to a new style guide or trying to improve type safety, it's painful to do it all at once. Instead, schedule an agent to run daily with a prompt like: "Find 5 files with 'any' types and refactor them to use strict types." Over time, your codebase improves automatically.

3. Cleanup & Housekeeping

After a big launch, your code is often littered with temporary flags, old comments, and dead code. Schedule a monthly "cleanup" run that scans for unused exports, TODOs older than 6 months, or specific feature flags that have been fully rolled out.

Availability

Scheduled Runs are available now for all users on the Starter and Pro plans. You can create up to 10 active schedules on the Starter plan and 50 on Pro.

Stop letting tech debt accumulate. Set up a schedule, and let the agents handle the chores.