Skip to main content

kiro-fix-session-images

Repair Kiro CLI sessions that stopped working with this error:

At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels

A screenshot larger than 2000px (usually a Retina capture) gets stored in the session history, so every later request that replays it fails. This tool scans each session's messages.jsonl, downscales every embedded image above the limit to 1900px on its longest side, and rewrites the file in place. The original is kept next to it as messages.jsonl.bak.

Warning: Close the session in Kiro before running, then resume it.

Install

With uv (recommended):

uv tool install kiro-fix-session-images

Or run it once without installing:

uvx kiro-fix-session-images --all --dry-run

Or with pip:

pip install kiro-fix-session-images

Usage

# Fix one session
kiro-fix-session-images sess_<id>

# The sess_ prefix is added automatically if you omit it
kiro-fix-session-images <id>

# Fix every session
kiro-fix-session-images --all

# Report what would change without touching any file
kiro-fix-session-images --all --dry-run

# Use a smaller target size (default 1900, must be below 2000)
kiro-fix-session-images --all --max 1600

# Scan a different sessions directory (default ~/.kiro/sessions)
kiro-fix-session-images --all --root /path/to/sessions

Each affected session is printed as sess_<id>: resized X/Y images, followed by a done: N oversized image(s) fixed summary. With --dry-run the wording changes to would resize and found.

How resizing works

Images are resized with Pillow, which is installed as a dependency, and saved back in their original format (PNG, JPEG, GIF or WEBP). On macOS the built-in sips tool is used as a faster path for PNG and JPEG when it is available; if it fails, Pillow takes over.

Platforms

macOS, Linux and Windows. Requires Python 3.9 or newer.

License

MIT

Metadata

Release files for kiro-fix-session-images 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kiro-fix-session-images 0.1.0
File Size Uploaded
kiro_fix_session_images-0.1.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kiro-fix-session-images 0.1.0
File Interpreter ABI Platform
kiro_fix_session_images-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / kiro_fix_session_images-0.1.0.tar.gz

Download URL kiro_fix_session_images-0.1.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
536924ed87b448674a0f6e9bd6f2fbd8dea6475d1c08c6e990c84fe7c2065136
BLAKE2b-256 checksum
How to use checksums
0eb744c5ab6824f6be5c538ceec158834125efee22a6ffea2d3a80c5ef4c4da2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.19

Release files / kiro_fix_session_images-0.1.0-py3-none-any.whl

Download URL kiro_fix_session_images-0.1.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c620cdd45c07b1f0006fc41da0c2dd1293417b5bde7b6312846eeb9f2ba3ed36
BLAKE2b-256 checksum
How to use checksums
ebcd1323a2a7df20bd55c78a6b1202aeab66dbae5231fa8b1be999f28e88302e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.19

Release history Release notifications | RSS feed

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page