Skip to main content

TodoScope

TodoScope finds maintenance comments (TODO, FIXME, ...) in your code and prints a clean report. Optionally, it asks an AI to interpret each comment and estimate its priority — without ever sending your source code anywhere.

todoscope src/

What it does

  • Scans Python, JavaScript, TypeScript, JSX/TSX, and Rust files for comments that start with your markers (TODO by default).
  • Only real comments count: TODO inside strings, template literals, JSX text, or raw strings is ignored.
  • Respects your .gitignore and an optional exclusion list.
  • Works fully offline — the AI part is optional.
  • When AI is on, it sends only each comment's ID, marker, and text. No file names, no paths, no line numbers, no code.

Install

Requires Python 3.12+.

pipx install todoscope        # recommended
# or
uv tool install todoscope     # if you use uv
# or
python3 -m pip install todoscope

Use

todoscope src/                # scan a folder recursively
todoscope src/main.py         # scan one file
todoscope .                   # scan the whole project
todoscope src/ --no-ai        # normal report, skip AI
todoscope src/ --quiet        # one line per finding, no headings, no AI
todoscope src/ --verbose      # extra details on stderr

That's it. Findings are sorted by folder depth, then path, then line.

Configuration

Everything optional lives in a .todoscope.json in your project root:

{
  "markers": ["TODO", "FIXME"],
  "extensions": [".py", ".js", ".jsx", ".ts", ".tsx", ".rs"],
  "exclude": ["tests/fixtures/", "generated/"],
  "model": "your-ai-model-id",
  "max_ai_characters": 20000
}
Key What it does
markers Replaces the default marker list (["TODO"]). Matching is case-sensitive and prefix-based; the longest matching marker wins.
extensions Replaces the default scanned extensions.
exclude Skips exact project-root-relative paths or directory prefixes.
model Required for AI analysis. There is no default model.
max_ai_characters Lower AI payload limit (hard ceiling: 100,000).

Invalid configuration stops with a clear error (exit code 3).

AI analysis

To enable it you need both:

  1. An API key — from your shell (TODOSCOPE_API_KEY) or a .env file in the project root:

    TODOSCOPE_API_KEY=...
    TODOSCOPE_SECONDARY_API_KEY=...
    

    Shell values win over .env. If a key comes from .env, that file must be ignored by your .gitignore, otherwise AI is refused for safety.

  2. A model in .todoscope.json.

When enabled, TodoScope makes one request and then prints one complete report: per finding you get a short interpretation and an estimated priority (High / Medium / Low / Unclear), plus an overall summary. If the request fails and a secondary key is configured, an interactive terminal offers one retry with it — the secondary key is never used silently.

Priorities are estimated from comment text only. No source code was provided to the AI.

Using DeepSeek (or another OpenAI-compatible provider)

The OpenAI SDK reads OPENAI_BASE_URL from your environment. For DeepSeek:

export OPENAI_BASE_URL=https://api.deepseek.com
todoscope .

or as a permanent alias in ~/.zshrc:

alias todoscope="OPENAI_BASE_URL=https://api.deepseek.com /home/$USER/.local/bin/todoscope"

Privacy

The only data from your repository that reaches the AI is each finding's ID, marker, and extracted comment text. Everything else stays local. Comments are treated as untrusted data — instructions written inside a comment can never change TodoScope's behaviour. Never put credentials or secrets in code comments, because comment text may be sent to the AI.

Exit codes

  • 0 — scan finished (including local-only results after any AI problem)
  • 1 — unexpected failure
  • 2 — bad path/usage, or an ignored target refused in non-interactive mode
  • 3 — configuration error

Development

uv sync                       # set up the environment
uv run pytest                 # tests
uv run ruff check .           # lint
uv run ruff format --check .  # format check
uv build                      # wheel + sdist

Docs

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

todoscope-0.1.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

todoscope-0.1.1-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file todoscope-0.1.1.tar.gz.

File metadata

  • Download URL: todoscope-0.1.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for todoscope-0.1.1.tar.gz
Algorithm Hash digest
SHA256 68e8cabcbec049816de299b8c404bd181fc11c5cb98c63a7ffc6308b4d7d7c30
MD5 60a40903b07ca01f12a2db9b85c4c0d3
BLAKE2b-256 244889c93717c447d071286c6735eb4bcda2bfe52c45f9e20f532d6be1420139

See more details on using hashes here.

File details

Details for the file todoscope-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: todoscope-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for todoscope-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11a226dfa53986e75239b48e1e6cbb8a19ca8d8c45d7c83b8dc56b4d55f6300d
MD5 ce0b3adfc7487fad9dffb26f5ec1c8f8
BLAKE2b-256 d4d2f3fdca5816620b6cb039fa323d3844cfed91c68b9b6fdcb6bf5147e787ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page