rota

mcp
Guvenlik Denetimi
Basarisiz
Health Uyari
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Basarisiz
  • rm -rf — Recursive force deletion command in install.sh
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Tells coding agents and scripts when they may use your machine's CPU, RAM and GPU, and keeps your blocked time yours. Runs locally on macOS and Linux.

README.md

Rota

Whose turn is it on your machine?
A local gatekeeper that lets coding agents and scripts share one machine without fighting over CPU, memory and GPU, and without taking it over when you need it.

CI Latest release Rota MCP server – quality and maintenance score on Glama macOS 14+ Linux Go 1.27 SQLite MIT license Runs locally

The Rota dashboard: a CPU forecast for the next 16 hours, with each job as a coloured band kept under the limit line

Demo · Why · How it works · Install · Connect your agents · Quick start · Agent instructions · Enforcer mode · Linux · Architecture · FAQ · Contributing

See it in action

Blocking the next two hours in the Rota dashboard: running jobs are asked to pause, waiting jobs move to after the block, and the week view shows the new plan

Week plan Menu bar
The Week view: every project's bookings for the next seven days, with blocked time hatched The menu bar app: load, warnings, what runs next and a Block next hour button
Jobs My time
The Jobs view: each job with its trigger, needs, priority and answer The My time view: blocked time on a calendar

The dashboard has Light, System and Dark themes.

Why Rota

You run Claude Code in one repo, Codex in another, a nightly test suite and a
video render. Each one assumes it has the whole machine. They start at the same
time, the fans spin up, everything slows down, and the end-to-end tests time out
in the middle of your video call.

Rota gives the machine a schedule:

  • Agents ask before they start. Rota answers go or wait until 10:10.
  • Your time wins. Block an hour and running jobs are asked to wrap up first.
  • Higher priority goes first, and lower jobs slip in only where they fit.
  • Projects book known work a week ahead, so there are fewer surprises.
  • Usage limits are tracked. Rota warns when a job may run out of a tool's
    quota. It warns only and never holds a job back.

By default Rota is a gatekeeper, not a runner. It never starts, pauses or
kills a process. Each agent runs its own job and checks in. That keeps Rota
small, and it works with any tool that can run a shell command.

If you want Rota to hold jobs to the plan itself, turn on the optional
enforcer mode. Rota then runs plain commands through
pueue and can pause, resume or stop them, and hooks let live agent sessions wrap
up and resume around your time.

Platforms: macOS and Linux.

How it works

Sequence diagram: an agent announces a job, asks and is told to wait until 10:10, later gets a go, checks in every few minutes, and is told to wrap up by 14:00 when you block 14:00 to 16:00; it then reports done or paused

This is the default mode: Rota only answers, and the agent starts and stops its
own work. With the optional enforcer mode, Rota
starts, pauses and resumes plain commands itself.

Every answer is also an exit code, so a shell script can act on it without
parsing output:

Answer Exit code What the agent does
go 0 Start now.
wait until 10:10 75 Ask again later. rota wait does this for you.
continue 0 Keep going.
wrap up by 14:00 10 Stop at a safe point by then, then rota done ID --paused.
pause 11 Stop at the next safe point, then rota done ID --paused.

An answer takes into account:

  • Triggers. A job can run at a time (--at), on a schedule
    (--cron "0 2 * * *"), only inside a window (--window 22:00-06:00@mon,tue),
    or only once the machine has been idle for a while (--idle 10m). With no trigger
    it is due as soon as it is announced.
  • Priority. low, normal, high or urgent. When a higher job has waited
    too long (10 minutes by default), lower running jobs are asked to wrap up.
  • Resources. Each job estimates its cores, memory, GPU share and run time.
    Rota counts both what jobs declared and what the machine is really using, and keeps
    the total under your limit (85% of the CPU and all but 4 GB of memory by
    default).
  • Your blocked time. The machine is open to jobs around the clock until you
    block time. A job that would run into your time waits until after it.

Install

One line (macOS 14+ on Apple silicon or Intel, or Linux with systemd):

curl -fsSL https://raw.githubusercontent.com/psardana/rota/main/install.sh | sh

It downloads the latest release, checks its checksum, puts rota in
~/.local/bin, starts the background service (launchd or systemd) and, on
macOS, adds the menu bar app to ~/Applications. Read
install.sh first if you like; it is short.

Homebrew:

brew tap psardana/rota https://github.com/psardana/rota
brew install rota
rota service install

Go: go install github.com/psardana/rota/cmd/rota@latest, then
rota service install.

From source (Go 1.27 or later; no C compiler needed, the SQLite driver is
pure Go; on macOS also the Xcode command line tools for the menu bar app):

git clone https://github.com/psardana/rota.git
cd rota
make install

make install builds rota into ~/.local/bin, registers the daemon with
launchd so it runs in the background and starts at login, and puts the menu
bar app in ~/Applications. On Linux it sets up a systemd user service and a
tray icon instead; see Linux.

Then open the dashboard at http://127.0.0.1:7420:

rota open

To remove everything, run rota service uninstall and delete rota (or
make uninstall from a source checkout). Your data stays in
~/Library/Application Support/Rota.

Connect your agents

Rota speaks MCP, so agents can announce,
ask, check in and book work as tool calls (rota_announce, rota_ask,
rota_checkin, rota_done, rota_book, rota_week, rota_status,
rota_cancel) instead of shell commands.

Claude Code: install the plugin. It adds the MCP tools, a skill that tells
the agent when to use them, and the hooks that
route heavy commands and wrap sessions up before your blocked time.

/plugin marketplace add psardana/rota
/plugin install rota@rota

Or add only the MCP server: claude mcp add rota -- rota mcp.

Codex: codex mcp add rota -- rota mcp

Gemini CLI: gemini mcp add rota rota mcp

OpenCode: add this to opencode.json:

{ "mcp": { "rota": { "type": "local", "command": ["rota", "mcp"], "enabled": true } } }

Any other MCP client: run rota mcp as a stdio server. Tools that can't
use MCP use the CLI below, and every agent follows Rota best with the
instructions for coding agents.

Quick start

For agents and scripts

Wrap any heavy job in four steps.

  1. Announce the job. Rota prints the job's id.

    id=$(rota add --name "refactor checkout flow" --est 90m --cpu 3 --ram 6)
    
  2. Wait for a go. This returns when it is the job's turn.

    rota wait "$id"
    
  3. Check in every few minutes while it runs. Exit code 0 means keep going.
    10 (wrap up) or 11 (pause) means stop at a safe point and run
    rota done "$id" --paused.

    rota checkin "$id"
    
  4. Say when it is done. Add --failed if it failed.

    rota done "$id"
    

Priority, the tool's name, usage-limit estimates and JSON output are all options
on rota add. See the CLI reference. To have coding agents do this
on their own, give them the instructions for coding agents.

Booking the week ahead

  1. Book a one-off job at a set time.

    rota book --project web-app --name "e2e suite" --at "wed 23:00" --est 1h
    
  2. Book repeating work with a cron schedule.

    rota book --project api-server --name "nightly e2e" --cron "0 2 * * *" --est 40m
    
  3. See every project's next 7 days.

    rota week
    

If a slot is taken, Rota books the nearest free one and says so. Booked work goes
before ad-hoc work of the same priority.

For you

Command What it does
rota open Opens the dashboard.
rota status Shows the load now and what runs next.
rota block add --for 2h Keeps the machine to yourself for two hours.
rota feed Shows what Rota decided, and why.

Every command and option is in the CLI reference, or run rota help.

Instructions for coding agents

Agents follow Rota best when every project tells them to. Paste this into your
agent's global instructions file, and change the defaults to suit you:

## Heavy work goes through Rota

This machine is shared by several agents and by me. Rota (`rota help`) decides
whose turn it is. Anything heavy, such as browser or UI tests, renders, video
or audio work, model runs, benchmarks, large migrations or long agent runs,
must go through Rota. Ordinary builds and unit test suites are not heavy and
run as they are.

- **Book known work a week ahead.** Recurring or planned jobs for this project
  go in with `rota book --project <project> --name "<what>" --at "<time>"` or
  `--cron "<schedule>"`, with `--est`, `--cpu` and `--ram` estimates. Check the
  plan with `rota week --project <project>`.
- **Announce ad-hoc jobs and wait for a go.** Run
  `id=$(rota add --name "<project>: <what>" --est <time> --cpu <cores> --ram <GB>)`,
  then `rota wait "$id"`. Never start heavy work before Rota says go.
- **Check in while running.** Run `rota checkin "$id"` every few minutes. Exit
  code 0 means continue. 10 means wrap up by the time given, and 11 means pause.
- **Stop cleanly when told.** On wrap up or pause, reach a safe point, save
  your state, run `rota done "$id" --paused` and tell me where you stopped.
  Otherwise, finish with `rota done "$id"`, or `--failed --note "<why>"`.
- **My blocked time always wins.** Never work around a wait, a wrap up or a
  pause, and never change my blocks or priorities yourself.
- **Prefer enforcement for plain commands.** Run heavy commands with
  `rota run --enforce --name "<project>: <what>" --est <time> -- <command>`, so
  Rota can pause and resume them. If this tool has Rota hooks installed, let the
  hooks route heavy commands and follow what they say.
- **Ask when unsure.** If you can't tell whether something is heavy, or Rota's
  answer seems wrong, ask me instead of guessing.

Where each tool reads global instructions:

Tool File
Claude Code ~/.claude/CLAUDE.md for every project, or CLAUDE.md in a repo
Codex ~/.codex/AGENTS.md for every project, or AGENTS.md in a repo
OpenCode ~/.config/opencode/AGENTS.md for every project, or AGENTS.md in a repo
Gemini CLI ~/.gemini/GEMINI.md for every project, or GEMINI.md in a repo

Instructions are a request, not a guarantee. For Claude Code, the
hooks route heavy commands through Rota even when
the agent forgets.

Enforcer mode (optional)

Rota is a gatekeeper by default: it answers, and jobs run themselves. Enforcer
mode is for when you want Rota to really hold the reins. It is built on
pueue, which you install yourself (Rota
never installs it):

brew install pueue
brew services start pueue

Then check that Rota can reach it:

rota enforce

Plain commands opt in one at a time:

rota run --enforce --name "api-server: full test suite" --est 40m --cpu 6 --ram 8 -- make test-all

Sequence diagram of enforcer mode: rota run --enforce hands the command to Rota, which holds it in pueue, starts it when the plan says go, pauses it at 14:00 when you block 14:00 to 16:00, resumes it at 16:00, and rota run exits with the command's own status

Rota holds the command in pueue's heavy group (with a parallel limit, set
under Settings) and starts it when the plan says go. When your blocked time
or a higher-priority job needs the machine, Rota pauses it there and then, and
resumes it later. A paused command keeps its memory, so Rota keeps counting it
as taken. rota run shows the output and exits with the command's own status.
--detach returns at once, and rota logs ID [--follow] shows the output,
which Rota keeps after the run ends. Cancelling an enforced job stops it.
Commands that send work outside their process group (nohup, setsid,
docker run, a trailing &) are flagged as not fully enforceable, because
pausing or stopping them would miss those processes.

Live agent sessions are never frozen. Instead, hooks let them work with
Rota. Claude Code is the first tool supported. The
Claude Code plugin brings the hooks with it. Without the
plugin, this adds them to ~/.claude/settings.json and keeps a .bak copy. Use
rota hooks print claude-code to see them first.

rota hooks install claude-code

With the hooks in place, each session shows up as a job. Heavy commands it
runs (browser and UI tests, renders and other media or model work; see the
built-in list in internal/enforce/classify.go, or set your own patterns) go
through rota run --enforce. Builds and unit tests run as they are. A heavy
command that would run into your blocked time is turned away with the reason,
so the agent can do something else. Before your
time starts, the session is told to reach a safe stopping point and end its
turn. Afterwards, Rota resumes it with the tool's resume command
(claude --resume <session> -p …) through pueue. The hooks keep Claude Code's
normal permission checks. Set ROTA_HOOK_DECISION=ask to have every rerouted
command shown to you first.

Backstop: if a session is still working a few minutes after its wrap-up
time (5 by default), Rota stops the session's heavy child processes (busy
CPU or large memory), never the agent itself, and tells you which ones.

Linux

Rota runs on Linux with systemd (Ubuntu, Debian, Fedora, Arch and most others).
The one-line install works there too. From a source checkout:

make install

Either way, rota goes into ~/.local/bin, with a systemd user service
(~/.config/systemd/user/rota.service) that starts at login, adds a "Rota"
launcher that opens the dashboard, and starts the tray icon now and at login.
To keep Rota running from boot on a machine nobody logs in to, run
loginctl enable-linger once.

What Rota reads on Linux:

Source
CPU /proc/stat
Memory /proc/meminfo (total minus available)
GPU nvidia-smi on NVIDIA, gpu_busy_percent on AMD; other GPUs are not measured
Idle time GNOME's idle monitor, the freedesktop ScreenSaver service (KDE and others), or xprintidle. A machine with no desktop session counts as idle. If the desktop reports none of these, jobs that wait for idle time keep waiting and say why.
Notifications the desktop's notification service over D-Bus (gdbus, or notify-send)

The tray icon (rota tray) needs a panel that shows StatusNotifierItem icons:
KDE, Ubuntu, XFCE and Cinnamon do out of the box; stock GNOME needs the
AppIndicator extension. rota tray --panel light draws dark bars for a light panel.

Files live in ~/.local/share/rota (database) and ~/.local/state/rota (log).

GPU readings have been tested against sample output only. If you run Rota on
an NVIDIA or AMD machine, please report what rota status shows.

Architecture

Architecture diagram: agents and scripts reach the Rota daemon on 127.0.0.1:7420 through the rota CLI, rota mcp or Claude Code hooks; the daemon keeps jobs, blocks and activity in SQLite, reads the machine's CPU, RAM and GPU, serves the dashboard and menu bar, and can drive pueue in optional enforcer mode

Path What lives there
cmd/rota The rota command, the launchd and systemd service setup, and the Linux tray.
internal/gate The decision engine. It plans the coming hours and answers each job. Pure Go, no I/O.
internal/server The daemon: HTTP API, background loop and booking logic.
internal/store SQLite storage for jobs, blocked time, readings and the feed.
internal/sysinfo CPU, memory, GPU and idle readings, for macOS and Linux.
internal/enforce Optional enforcer mode: the pueue backend and agent session hooks.
internal/platform Where Rota keeps its files on each operating system.
internal/cronexpr A small cron expression parser.
internal/notify Desktop notifications on macOS and Linux.
web/ The dashboard: plain HTML, CSS and JavaScript, built into the binary.
macos/ The SwiftUI menu bar app.
linux/ Desktop launcher files for Linux.

Built on

  • Go's standard library for the daemon, the API and the command line.
  • SQLite through the pure-Go driver
    modernc.org/sqlite, so no C compiler is needed.
  • launchd on macOS and a systemd user service on Linux to keep the daemon running.
  • The system's own tools for readings: sysctl, ps, vm_stat and ioreg on
    macOS, /proc on Linux.
  • SwiftUI for the macOS menu bar app and fyne.io/systray
    for the Linux tray.
  • pueue, only if you opt in to enforcer mode.

Security

Rota listens only on 127.0.0.1, answers only requests addressed to this machine,
and refuses changes that come from other web pages. Nothing leaves your machine.
To report a vulnerability, see SECURITY.md.

FAQ

Why not nice, cgroups or systemd slices? Those share the CPU among
processes that are already running. Rota decides whether a job should start at
all, and when it should stop, based on memory, the GPU, your blocked time and
priorities. Memory is the main reason: two jobs that each need 10 GB on a 16 GB
machine don't just get slower under nice, they swap or get killed. You can
still run a job Rota let through under nice.

Why not just a job queue like pueue? A queue runs commands for you. An
agent session isn't one command: it runs many and has to stop at a sensible
point, which the agent knows better than a scheduler. So by default Rota only
answers. For plain commands, enforcer mode does use
pueue underneath.

What stops an agent from ignoring Rota? In the default mode, nothing: it's a
request, like the instructions you give it.
For Claude Code, the hooks send heavy commands through Rota even when the agent
forgets, turn away a heavy command that would run into your blocked time, and,
a few minutes past a wrap-up time, stop the session's heavy child processes
(never the agent itself).

Does it work with my tool? Anything that speaks MCP can use rota mcp, and
anything that can run a shell command can use the CLI and its exit codes.

Windows? Not yet. macOS 14+ and Linux with systemd.

Roadmap

  • A dedicated job machine. Run Rota on an always-on Mac mini that does the
    heavy work while your laptop stays free.
  • More agent hooks beyond Claude Code, for tools that offer them.
  • GPU readings confirmed on real NVIDIA and AMD machines, and Windows support.

Ideas and opinions are welcome in issues.

Contributing

Contributions are welcome, from a typo fix to a new platform. Start with
CONTRIBUTING.md, and look at
good first issues if you want somewhere easy to
begin. Please follow the code of conduct.

License

Rota is released under the MIT License.

Yorumlar (0)

Sonuc bulunamadi