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) with their EXIF metadata and color profile intact.
If a session contains an image Pillow cannot read, that session is skipped with a message on stderr and the rest of the sweep continues; the exit status is 1.
Platforms
macOS, Linux and Windows. Requires Python 3.9 or newer.
License
MIT
Metadata
Release files for kiro-fix-session-images 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kiro_fix_session_images-0.2.0.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kiro_fix_session_images-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.2 kB
Release files / kiro_fix_session_images-0.2.0.tar.gz
| Download URL | kiro_fix_session_images-0.2.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01594ab8f671d9bc3a80f4045653936848da645611428a53d730c8872280ef42
|
|
BLAKE2b-256 checksum How to use checksums |
a354b44cb506201b30fdf41eebee02535e0da0577d49ff201b98576946a457fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / kiro_fix_session_images-0.2.0-py3-none-any.whl
| Download URL | kiro_fix_session_images-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
141d4ed807eb062cd8c6a16636a18a0e04ee5903ae4ed3b2281a494ad1ea9ce0
|
|
BLAKE2b-256 checksum How to use checksums |
19699a35f79cb2ad747a8285365cd469dac277872ca50d3169833b6b730c1271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|