[Bug] Claude Code generates Python code with incorrect leading whitespace in inline scripts

Status Open
Reported on v2.1.263
Maintainer reply None cached
Activity 0 comments · opened Sep 6, 2026

Bug Description
When ever you mention that run this python script it has extra space character in front: spatel@rocky brmarket_bot]$ python3 -c "
import psycopg2
c = psycopg2.connect(host='127.0.0.1', port=15432, dbname='platform', user='posjournal')
c.autocommit = True
cur = c.cursor()
cur.execute('GRANT SELECT ON posjournal.msm_details, posjournal.movement_headers, posjournal.tender_lines, posjournal.transaction_lines TO posjournal_ro')
cur.execute('ALTER DEFAULT PRIVILEGES FOR ROLE posjournal IN SCHEMA posjournal GRANT SELECT ON TABLES TO posjournal_ro')
c.close()"
File "<string>", line 2
import psycopg2
IndentationError: unexpected indent

Environment Info

  • Platform: linux
  • Terminal: gnome-terminal
  • Version: 2.1.263
  • Feedback ID: 358e907b-c46b-48b9-8e1e-46c093ff84d2

Errors

[]

View original on GitHub ↗