Django error tracking your coding agent can read

The Runheed Python SDK ships a Django middleware. It records each request as a breadcrumb and reports exceptions raised in your views with the method and path. Http404 and PermissionDenied are left alone, since they are normal responses. Your agent then reads the errors in Claude Code, Cursor or any MCP client.

Set it up

  1. 1.Install the SDK.

    terminalbash
    pip install https://runheed.com/dl/runheed-0.1.0-py3-none-any.whl
  2. 2.Create the middleware in one of your apps.

    yourapp/runheed_middleware.pypython
    import os
    import runheed
    from runheed import DjangoIntegration
    
    runheed.init(dsn=os.environ["RUNHEED_DSN"], environment="production")
    
    _integration = DjangoIntegration()
    _integration.setup(runheed.get_client())
    RunheedMiddleware = _integration.create_middleware()
  3. 3.Add it near the end of MIDDLEWARE. Django calls exception hooks from the bottom of the list up, so the end is where it sees view errors first.

    settings.pypython
    MIDDLEWARE = [
        # ...Django's own middleware
        "yourapp.runheed_middleware.RunheedMiddleware",
    ]
  4. 4.Connect your agent.

    terminalbash
    claude mcp add runheed --env RUNHEED_API_KEY=al_... -- npx -y https://runheed.com/dl/runheed-mcp-0.1.0.tgz

The npm and PyPI releases are not out yet, so these commands install the same package files straight from runheed.com. Nothing else changes when the registry versions ship.

What it catches

  • Exceptions raised in views, with method and path
  • Errors logged through the logging module (on by default)
  • Errors you report with runheed.capture_exception(e)

What it does not do

  • Celery tasks and management commands need capture_exception in their own except blocks
  • Http404 and PermissionDenied are not reported
  • No performance tracing: Runheed tracks errors only

Then ask your agent

> what broke in production since the last deploy? fix the top one and resolve it with the commit hash

Common Django errors

Plans from $29/moOther agents and editorsCancel any time from the billing portal