Skip to main content

debug Python with claude.ai

Project description

claude-here

debug Python with claude.ai

usage

Just

pip install claude-here

then

import claude_here

and any uncaught exceptions will automatically launch a new conversation in claude.ai pre-filled with information for Claude to help you debug the error.

To debug something that isn't causing an exception, just add

breakpoint()

where you want to debug and it will automatically launch Claude with info about the current locals to help you debug.

nice things

Some extra features to note:

  • If a breakpoint is hit multiple times, or an uncaught exception is raised after hitting a breakpoint, the information sent to Claude will be cumulative.
  • If claude_here detects that webbrowser will use a text-based browser by default, it will instead print an OSC-8-compliant hyperlink to the terminal for you to open using a graphical browser. This is especially useful if you are debugging a remote machine.

breakpoint

breakpoint additionally supports some optional arguments:

  • base_debugger determines the debugger to call in addition to launching Claude. Defaults to pdb.set_trace. Setting to None will set up a simple prompt to ask you when you're ready to continue execution.
  • just_gather_info=True will gather information to send to Claude later (on an uncaught exception or breakpoint without just_gather_info=True) without actually launching Claude or the base_debugger.

environment variables

claude_here supports some additional configuration via environment variables:

  • CLAUDE_HERE_PROJECT_ID can be set to a Claude Projects UUID (https://claude.ai/project/<this-part-here-is-the-uuid>) to launch your debugging conversations in.
  • CLAUDE_HERE_MAX_CONTEXT_ITEMS can be set to an integer that will determine the maximum number of prior breakpoint contexts that will be sent to Claude.

Project details


Download files

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

Source Distribution

claude_here-0.1.7.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

claude_here-0.1.7-py3-none-any.whl (51.1 kB view details)

Uploaded Python 3

File details

Details for the file claude_here-0.1.7.tar.gz.

File metadata

  • Download URL: claude_here-0.1.7.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for claude_here-0.1.7.tar.gz
Algorithm Hash digest
SHA256 008136fc9a74d2f22192ddfd6811efa93585700a48256b5c2796d0a46c3432c6
MD5 1e3f5638af374a27b03aa18b2b035157
BLAKE2b-256 f3fe17b5897d52e2b14b7bed6e0ea7ea33df7abdb64d264fa84cef5350fa37a0

See more details on using hashes here.

File details

Details for the file claude_here-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: claude_here-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 51.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for claude_here-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 85df9971c194632883257013d0d78dede689f81ed475a7697989afe40f9032e8
MD5 d69eb02053874ac8056aada5951d5ef6
BLAKE2b-256 5a7871874016c394e27e6a1c773974105728369e83dfe05647610ca42ff1718d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page