django-orbit CLAUDE.md

Instructions for Django Orbit, a reusable Django app that provides a dashboard for inspecting web requests, database queries, logs, errors, background jobs, and other application activity. Django is a Python web framework.

In plain words
What is it for?
Installing Django Orbit, running its tests and checks, starting its demo, and working on its debugging dashboard.
Why use it?
They explain how to install and test the app while keeping its monitoring features from disrupting the host application or database setup.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/astro-stack/django-orbit/claude-md
Clone the repo
git clone --depth 1 https://github.com/astro-stack/django-orbit
Per session 1,333 This file is loaded in full into every session.
When invoked 1,333 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01333 $0.01333
Opus 5 $0.00666 $0.00666
Sonnet 5 $0.00267 $0.00267
Haiku 4.5 $0.00133 $0.00133

Measured 2d ago against content hash a2a75f8b0b70, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

django-orbit CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What This Is

Django Orbit is a reusable Django app (published to PyPI as django-orbit) that provides "satellite observability" — a debugging/monitoring dashboard at /orbit/ that records requests, SQL queries, logs, exceptions, cache operations, model events, background jobs, and more. It is inspired by Laravel Telescope.

The key design constraint: Orbit must never interfere with the host app. Every watcher must fail gracefully (WATCHER_FAIL_SILENTLY), and all writes to OrbitEntry must be guarded by _table_exists() to prevent poisoning migrations on a fresh database.

Commands

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

# Run all tests
pytest

# Run a single test file
pytest tests/test_core.py

# Run a single test by name
pytest tests/test_core.py::test_middleware_captures_request

# Run with coverage
pytest --cov=orbit --cov-report=html

# Format and lint
black orbit tests
isort orbit tests
flake8 orbit tests
mypy orbit

# Run the demo server
python demo.py setup    # Populate sample data
python manage.py runserver

Architecture

Central model: OrbitEntry (orbit/models.py)

A single polymorphic model storing all telemetry. All event types share one table with a type discriminator and a JSONField payload. Entries are grouped across a request lifecycle via family_hash.

Data flow

HTTP Request
    → OrbitMiddleware (orbit/middleware.py)
        → installs OrbitQueryWrapper on connection (orbit/recorders.py)
        → sets family_hash context for log handler (orbit/handlers.py)
        → calls get_response()
    → Response captured → OrbitEntry(type='request') saved
    → All SQL queries → OrbitEntry(type='query') saved
    → All log calls → OrbitEntry(type='log') via OrbitLogHandler

Watcher system (orbit/watchers.py)

install_all_watchers() is called from OrbitConfig.ready(). Each watcher monkey-patches a Django/Python subsystem:

  • Command watcher: patches BaseCommand.execute
  • Cache watcher: patches cache.get/set/delete
  • Model watcher: connects to post_save/post_delete signals
  • HTTP client watcher: patches urllib3 / requests
  • Mail watcher: patches EmailMessage.send
  • Signal watcher: patches Signal.send
  • Redis watcher: patches redis.StrictRedis
  • Job watcher: hooks into Celery/Django-Q/RQ signals

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 122 lines · 1,333 tokens per session scan A a2a75f8b0b70

Subscribe to this mod's changes

django-orbit CLAUDE.md is an instructions file published in the GitHub repository astro-stack/django-orbit (176 stars, last pushed 9d ago), licensed MIT. It adds 1,333 tokens to every session, about $0.0067 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.