Skip to main content

prioritykit

CI PyPI Python versions License

prioritykit applies one prioritization system the same way for a person at a terminal and for an AI agent acting as a chief of staff. You rate each task from 1 to 5 on importance and urgency, a 5 × 5 table maps the pair to P0, P1, P2, or drop, and each day holds exactly three goals that trace to quarterly and annual goals. The background, the evidence, and the figures are in Why P2 work rarely gets done, and how I pick three goals a day.

Each function computes its result from its arguments, and your goals, today's plan, and P2 list live in a plain TOML file that you keep under your own version control. The core library and the command line interface (CLI) use only the Python standard library, and an optional Model Context Protocol (MCP) server exposes the same functions to agents.

Install

Python 3.11 or later.

uv tool install "prioritykit[mcp]"
# or
pip install "prioritykit[mcp]"

Drop [mcp] if you only want the CLI and library.

The rules

Importance is defined by your goals, and urgency by how fast the cost of waiting grows:

Score Importance: what it does for your goals Urgency: how fast waiting gets costly
5 Directly advances an annual goal, or prevents serious harm to health, family, or a commitment others depend on Cost rises within hours; start today
4 Directly advances a quarterly goal Cost rises within days; this week
3 Supports a goal indirectly, or meets an obligation with moderate consequences Cost rises within weeks
2 Small benefit; no goal moves Waiting a month costs little
1 No effect on any goal Waiting a quarter costs nothing

The default table gives importance precedence over urgency:

importance \ urgency    1     2     3     4     5
                    5     P1    P1    P1    P1    P0
                    4     P1    P1    P1    P1    P0
                    3     P2    P2    P2    P1    P1
                    2   drop  drop  drop    P2    P2
                    1   drop  drop  drop    P2    P2
cells: 2 P0, 10 P1, 7 P2, 6 drop
Level Action
P0, interrupt Rewrite today's three goals around it, and name the goal it displaces.
P1, schedule Give it a slot in one of the next few days' three goals.
P2, list Put it on the P2 list and plan as if it will not happen. The weekly review promotes it to P1 or deletes it.
drop Decline it or delete it now.

P0 needs importance of at least 4 and urgency 5, so work that grows costly within days waits for the next morning's plan instead of interrupting today. Urgency alone never lifts work of importance 1 or 2 above P2. Multiplying the two scores, as a risk matrix does, would rank a very important task with no deadline (5 × 1 = 5) below an unimportant urgent one (2 × 5 = 10).

A P2 task that blocks P1 work takes on the importance of the work it blocks, so rescore it instead of waiting for the review to notice.

CLI

prioritykit classify -i 5 -u 2          # Importance 5, urgency 2: P1 (schedule). ...
prioritykit matrix                      # the 5 x 5 grid
prioritykit anchors                     # anchors and level actions
prioritykit check examples/priorities.toml --today 2026-11-24 --departures 3
prioritykit validate-matrix my-matrix.json

Every command takes --json. check exits with status 1 when the goal tree or today's plan breaks a rule, so it can run in a pre-commit hook or a scheduled job. It counts P2 ages from the run date, which is the current date unless you pass --today, and warns when [today] is dated before the run date; --strict exits 1 on warnings too. It lists goals due within 28 days of the run date (--due-within) as information, not as warnings. python -m prioritykit runs the same CLI when the console script is not on your PATH. Output for the example:

goal tree: ok (4 annual, 4 quarterly)
today (3 goals): ok
  Review a design doc with a teammate <- Mentor a junior scientist <- Grow as a technical lead
  Dinner and bedtime, phone in another room <- Protect weekday evenings <- Be present with my family
  45-minute strength session <- Strength train 3 times a week <- Stay strong and fit
  annual goals with no slot today: Publish technical writing
last 7 days (2026-11-18 to 2026-11-24): plans on 3 days (1 proposed)
  quarterly goals slotted only in proposed plans: One post a month
  annual goals slotted only in proposed plans: Publish technical writing
due within 28 days:
  Mentor a junior scientist (due 2026-12-18, 24 days left; slotted in a confirmed plan)
P2 list: 3 items
  promote: Renew the passport before the spring trip (P1, proposed)
  delete (older than 90 days): Reorganize the photo library
  keep: Try a new note-taking app
  expected wait for a new item: 1.0 months

The priorities file

[[goal]]
id = "lead"
title = "Grow as a technical lead"
horizon = "annual"

[[goal]]
id = "mentor"
title = "Mentor a junior scientist"
horizon = "quarterly"
parent = "lead"
due = 2026-12-18   # optional; listed within --due-within days, a warning once it has passed

[today]
date = 2026-11-24
goals = [
  { title = "Review a design doc with a teammate", parent = "mentor" },
  # ... exactly three entries; a P0 entry is { title = "...", p0 = true, displaces = "..." }
]

[[day]]          # optional history: each morning, move yesterday's [today] here
date = 2026-11-23
confirmed = false   # optional, here or on [today]; an agent proposed this plan, you have not confirmed
goals = [
  { title = "Pair on the eval harness with a teammate", parent = "mentor" },
  # ...
]

[[p2]]
title = "Renew the passport before the spring trip"
added = 2026-10-01
importance = 4   # optional; rescored items that now map to P1 or P0 are promotion candidates
urgency = 3
confirmed = false   # optional; an agent added or scored it and you have not confirmed

examples/priorities.toml is a complete file. A P2 item older than 90 days that still scores P2 or lower, or was never scored, is a deletion candidate; change the threshold with --max-age. An old item marked confirmed = false goes on a separate "confirm or delete" list instead, so approving the delete list never removes an item nobody has looked at.

With [[day]] history, check lists the quarterly and annual goals that no plan gave a slot in the last 7 days (--window), counting [today], and says how many of those days had a plan. A plan with confirmed = false is a proposal: the JSON output lists goals without a slot both ways (quarterly_without_slot counts every plan, quarterly_without_confirmed_slot only confirmed ones), and the text output names the goals slotted only in proposals. [today] with confirmed = false prints as proposed and carries "confirmed": false in the JSON. Each goal in due_soon carries days_left and slot: "confirmed", "proposed", or "none", judged from the last 7 days of plans plus any later plan such as tomorrow's [today], or null when there is no plan to judge by. Keep one plan per date. A [[day]] with the same date as [today] is ignored, with a warning, and two [[day]] entries with one date are an error.

Goal titles can name employer-internal projects or private matters, so keep your priorities file in a private repository, not a public one.

MCP server for agents

The server speaks stdio and exposes eight tools. All but check_workspace are pure functions:

Tool What it returns
get_rubric anchors, level actions, the grid, and the daily goal count
classify_task the level and action for an importance and urgency pair, and requires_confirmation (true for P0)
check_day_plan whether today holds exactly three goals, each traced to quarterly and annual goals
replan_for_p0 today's plan with one goal replaced by a confirmed P0, rechecked
check_week goals no day plan gave a slot over the last N days, counting all plans and confirmed plans only, how many days had a plan, and goals due soon with their slot
review_p2 promote, delete, confirm, and keep lists for a P2 review
wait_estimate expected months on a list, by Little's law
check_workspace all of the above for a local priorities.toml, plus warnings such as a stale [today] date

Claude Code:

claude mcp add --transport stdio --scope user prioritykit -- prioritykit-mcp

Claude Desktop (claude_desktop_config.json):

{ "mcpServers": { "prioritykit": { "command": "prioritykit-mcp" } } }

The server's instructions tell the agent to propose scores with a reason for each and wait for the human to confirm, or record them as proposed (confirmed = false) when no human is present; never to label work P0 on its own; to call check_day_plan before presenting a day's three goals and check_week before saying a goal has gone without a slot; to favor goals that are due soon and have no slot; and to raise P2 items only during a review. Work the agent generates for itself is scored like any other task. The same protocol is written out as an agent skill in skills/prioritykit/SKILL.md; copy it into ~/.claude/skills/ or adapt it for an AGENTS.md file.

check_workspace is the only tool that reads a file. It runs with your permissions and reads only paths that end in .toml once symlinks are resolved. For an agent that also reads untrusted content such as email, where a prompt injection could choose the path, narrow it further:

  • PRIORITYKIT_ROOT=/path/to/dir refuses files outside that directory.
  • PRIORITYKIT_TOOLS=pure leaves check_workspace out, so no tool reads a file. A script reads the file and passes the goal tree and plan to the other tools.

Your own table

Start from prioritykit matrix --json > my-matrix.json or a copy of src/prioritykit/data/default_matrix.json, change the anchors, cells, or level names and actions, and pass it with --matrix. Set PRIORITYKIT_MATRIX to use it everywhere: the CLI reads it when --matrix is absent and the MCP server always reads it, so a script and an agent classify with the same table. The four levels (P0, P1, P2, drop) are fixed, because the agent instructions and the P2 review depend on what each one means, and the MCP server has no tool that changes the table. prioritykit validate-matrix rejects a table in which raising a score lowers the level, and warns when urgency alone lifts low-importance work above P2, when P0 cells fall outside the top-right corner, or when more than 4 cells are P0.

Limits

The scores are ordinal judgments. Two people can score the same task differently, and ordinal risk matrices are known to compress very different risks into one rating (Cox, 2008). The number three is an operating rule from experience; the research behind the surrounding practices (specific goals, if-then plans, written progress checks) is summarized in the background post.

Development

uv sync --group dev
uv run pytest
uv run ruff check . && uv run ruff format --check . && uv run mypy

License

Apache-2.0.

Metadata

Release files for prioritykit 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prioritykit 0.4.0
File Size Uploaded Provenance Actions
prioritykit-0.4.0.tar.gz 38.4 kB With provenance Details for prioritykit-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prioritykit 0.4.0
File Interpreter ABI Platform Actions
prioritykit-0.4.0-py3-none-any.whl Python 3 none any Details for prioritykit-0.4.0-py3-none-any.whl

Total release size: 71.0 kB

Release files / prioritykit-0.4.0.tar.gz

Download URL prioritykit-0.4.0.tar.gz
Size 38.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1c16844ef95207ab04c28797aa8eabba1519f4230237b41e475182d193a2eb23
BLAKE2b-256 checksum
How to use checksums
eddca5a2a063f3ea85fa69412a4cce1549cc8ae6c0eafaacc73f4c1d653ee7ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / prioritykit-0.4.0-py3-none-any.whl

Download URL prioritykit-0.4.0-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94b6f3478cea4cc3ae935ca37ca530f7798a3f685ae44d06a4f225d91b4ba784
BLAKE2b-256 checksum
How to use checksums
12216e97f7cec3ff3df2e640aa0bbb329752aa6af3f3405d45b7cd48586dfb53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for prioritykit 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for prioritykit-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page