Skip to main content
Glama

context_save

Persist distilled session context for the current project: decisions, constraints, gotchas, open threads, key files, and preferences, each backed by concrete evidence from the session.

Instructions

Persist distilled session context for the current project.

When to use: ONCE per /kireo:save, after you have distilled the session. Always call project_info first and show the user the resolved project.

Each entry needs non-empty evidence — a concrete basis from THIS session (a file path, a command you ran, something the user said). If you cannot cite one, do not write the entry.

Do NOT store things re-derivable from the repo in 60 seconds — that is the code index’s job. Store decisions, constraints, gotchas, open threads, a small map of key files, and stated preferences.

Privacy: content, evidence, and files are pattern-redacted for known credential shapes, but that is NOT a privacy guarantee — it cannot catch business secrets ("customer A’s contract is worth $X") that got paraphrased into evidence/files from things the session read (.env, docker logs, a pasted SQL result). The first run is therefore FORCED into a preview by the tool itself: until a .first-run-acknowledged marker exists next to the outbox directory, every call returns the exact (post-redaction) text and writes/uploads nothing, no matter what dry_run says. Show that text to the user, and only after they confirm there is nothing business-sensitive call again with an explicit dry_run: false — that call performs the real save and records the acknowledgement. From then on dry_run is an ordinary optional preview flag (omitted = real save). A repo with a .kireo/disabled file, or the KIREO_DISABLED env var, disables this tool entirely — it returns immediately and does nothing.

Returns: { stored, deduped, failed, outbox_pending, namespace, dashboard_url }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
hostYesWhich host produced this: "claude-code" or "codex".
dry_runNoPreview only: apply redaction and show the exact text that would leave this device, without writing the outbox or uploading anything. Deliberately has NO schema default, so after parsing three states stay distinguishable: omitted (undefined), explicit false, explicit true. On the very first run (no `.first-run-acknowledged` marker next to the outbox dir) omitting it forces a preview; only an explicit `dry_run: false` performs the real save and records the acknowledgement. Once the marker exists, omitted and false both perform a real save; `true` always previews.
entriesYes
outbox_dirNo
session_idYes
audit_log_pathNo
transcript_pathNoAbsolute path to THIS session's transcript (.jsonl). Used for the literal evidence check: file paths and commands cited in `evidence` that never appear in the session mark that entry [uncertain]. Optional — for claude-code it is located automatically from `session_id`; verification is skipped (never blocked) when no transcript can be read.
uncertain_indexesNoIndexes of entries you are not fully confident in. These are UNIONed with whatever the transcript evidence check flags, and render as [uncertain] on the resume side.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and delivers exceptional disclosure: forced first-run preview keyed on a .first-run-acknowledged marker, three distinguishable dry_run states, pattern-redaction limits with explicit business-secret caveats, disable conditions (.kireo/disabled, KIREO_DISABLED), and the transcript-based evidence verification that marks entries [uncertain].

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Long but perfectly dense — every sentence carries operational weight: purpose, usage trigger, evidence rule, exclusion, privacy caveat, state machine, disable conditions, and return shape. It is front-loaded with the 'When to use' block ahead of the deep dry_run mechanics.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 9-parameter mutation tool with no annotations or output schema, the description is complete: it covers call sequencing, content constraints, the first-run state machine, privacy caveats, disable conditions, and even lists the return fields (stored, deduped, failed, outbox_pending, namespace, dashboard_url) in lieu of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 44%, so the description must compensate, and it adds real meaning: it maps the bucket enum to intent ('decisions, constraints, gotchas, open threads, a small map of key files, and stated preferences') and defines evidence as 'a concrete basis from THIS session (a file path, a command you ran, something the user said),' far beyond the schema's minLength:1. Path params like cwd, outbox_dir, and audit_log_path remain unexplained, keeping this a step below full coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource: 'Persist distilled session context for the current project.' The save operation is clearly distinct from siblings like context_load, context_archive, and memory_save by combining the verb (persist) with the scoped resource (distilled session context).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use: 'ONCE per /kireo:save, after you have distilled the session,' plus a hard prerequisite: 'Always call project_info first and show the user the resolved project.' It also gives an exclusion boundary ('Do NOT store things re-derivable from the repo in 60 seconds — that is the code index's job').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.