Kiro Product
CLI
Feature Description
Problem / background
I want to resume, verify, and audit conversations that were run with
kiro-cli chat --no-interactive (headless). To do that I need to know which session a
given run corresponds to, but there is no way to obtain that session ID in headless mode.
Concrete needs:
- Resume: continue a previous headless run. Resuming requires the session ID.
- Traceability / audit: review and trace conversations executed in CI or automation
later on, by linking a run to its session.
- External tool integration: when embedding headless as a conversation engine, manage
each run's session from the caller side.
Constraints confirmed in kiro-cli 2.5.1:
- On
--no-interactive, the session ID is not printed to stdout in a machine-readable
form. Interactive mode has /session-id and an on-exit resume hint, but neither is
emitted in headless mode.
--resume-id <a brand-new ID> does not create a new session (only existing IDs can be
resumed).
- As a workaround, you can run
--list-sessions right after a turn (newest first; the
~10s lag from 2.2.2 is gone in 2.5.1) to grab the real ID. But (a) it is printed to
stderr, and (b) if multiple conversations are started concurrently in the same
directory, they all grab the same "latest" ID and get mixed up.
Since passing a real ID to --resume-id resumes correctly regardless of cwd (confirmed),
any reliable, immediate way to obtain a run's session ID would satisfy all of the above —
including multi-turn conversations under parallelism.
Desired behavior
Any one of the following would be sufficient:
--print-session-id: print the session ID used for the run to stdout.
--output-format json (applied to chat, not just --list-models): emit the response
body, session ID, credits used, etc. as JSON.
{ "sessionId": "e0b90fad-...", "content": "...", "credits": 0.11 }
- Allow
--resume-id <arbitrary ID> to create a new session under the given ID. If the
caller can mint the ID, retrieval is unnecessary and parallel use is solved naturally.
Interactive mode already implements /session-id, so emitting the same value in headless
mode is likely low-cost.
Use Case
Example 1: Resume and audit a headless conversation (basic)
# First run: start a headless conversation and capture the session ID
SID=$(kiro-cli chat --no-interactive --print-session-id "Propose a project structure" | extract_id)
# Later / another job: resume the same conversation
kiro-cli chat --no-interactive --resume-id "$SID" "Implement the previous proposal"
With an immediately available session ID, conversations run in CI/CD or batch jobs can be
tracked and resumed per session, and reviewed afterward (validation / audit).
Example 2: AI agent orchestration
An orchestration tool invokes kiro-cli as a conversation engine and runs a multi-turn
flow (plan → implement → review → fix) while preserving context. It also runs parallel
reviews (multiple reviewers started concurrently).
- Each step is a separate process, so the session ID must be returned immediately per call.
- Especially when starting multiple conversations in parallel in the same directory,
--list-sessions "latest" cannot disambiguate them, so each call needs to reliably get
its own session ID.
Additional Context
- Test environment: kiro-cli 2.5.1 (Linux / WSL2).
- Passing a real ID to
--resume-id resumes regardless of cwd (confirmed).
--list-sessions lists newest first and is near-instant, but it prints to stderr and
cannot disambiguate concurrent new conversations.
- ACP mode (
kiro-cli acp) exposes explicit session/new / session/load with session
IDs, but having an equivalent ID-retrieval mechanism in the lightweight headless CLI
would make automation integration much easier.
Kiro Product
CLI
Feature Description
Problem / background
I want to resume, verify, and audit conversations that were run with
kiro-cli chat --no-interactive(headless). To do that I need to know which session agiven run corresponds to, but there is no way to obtain that session ID in headless mode.
Concrete needs:
later on, by linking a run to its session.
each run's session from the caller side.
Constraints confirmed in kiro-cli 2.5.1:
--no-interactive, the session ID is not printed to stdout in a machine-readableform. Interactive mode has
/session-idand an on-exit resume hint, but neither isemitted in headless mode.
--resume-id <a brand-new ID>does not create a new session (only existing IDs can beresumed).
--list-sessionsright after a turn (newest first; the~10s lag from 2.2.2 is gone in 2.5.1) to grab the real ID. But (a) it is printed to
stderr, and (b) if multiple conversations are started concurrently in the same
directory, they all grab the same "latest" ID and get mixed up.
Since passing a real ID to
--resume-idresumes correctly regardless of cwd (confirmed),any reliable, immediate way to obtain a run's session ID would satisfy all of the above —
including multi-turn conversations under parallelism.
Desired behavior
Any one of the following would be sufficient:
--print-session-id: print the session ID used for the run to stdout.--output-format json(applied to chat, not just--list-models): emit the responsebody, session ID, credits used, etc. as JSON.
{ "sessionId": "e0b90fad-...", "content": "...", "credits": 0.11 }--resume-id <arbitrary ID>to create a new session under the given ID. If thecaller can mint the ID, retrieval is unnecessary and parallel use is solved naturally.
Interactive mode already implements
/session-id, so emitting the same value in headlessmode is likely low-cost.
Use Case
Example 1: Resume and audit a headless conversation (basic)
With an immediately available session ID, conversations run in CI/CD or batch jobs can be
tracked and resumed per session, and reviewed afterward (validation / audit).
Example 2: AI agent orchestration
An orchestration tool invokes kiro-cli as a conversation engine and runs a multi-turn
flow (plan → implement → review → fix) while preserving context. It also runs parallel
reviews (multiple reviewers started concurrently).
--list-sessions"latest" cannot disambiguate them, so each call needs to reliably getits own session ID.
Additional Context
--resume-idresumes regardless of cwd (confirmed).--list-sessionslists newest first and is near-instant, but it prints to stderr andcannot disambiguate concurrent new conversations.
kiro-cli acp) exposes explicitsession/new/session/loadwith sessionIDs, but having an equivalent ID-retrieval mechanism in the lightweight headless CLI
would make automation integration much easier.