Artifacts
When the model produces a file — code, an image, a CSV, a Mermaid diagram — Kenaz captures it as an artifact: a first-class object you can preview, download, and reference from later turns.
What becomes an artifact
The model has a save_artifact tool. It calls it whenever it produces output that's a "file" rather than chat text:
- A code file the model wrote (Python, TypeScript, Markdown, …)
- An image the model rendered (via a tool — vision-capable models don't generate images themselves)
- Structured data (JSON, CSV, YAML)
- A diagram (Mermaid, GraphViz)
The model can also re-save an updated version under the same name; Kenaz versions them automatically.
Where they live
Per-session, in a content-addressed local store:
$XDG_DATA_HOME/kaneaz-harness/artifacts/<session-id>/
The Artifacts view in the Kenaz UI mirrors this directory. Files have stable filenames; versions are tracked in metadata, not by suffixing.
Operations
- Preview — click an artifact to render. Code is syntax-highlighted, Mermaid diagrams are rendered, CSV becomes a table, images preview inline.
- Download — save to your filesystem. Default save location is the project root; falls back to
~/Downloads. - Reference in next turn — drag an artifact into the chat input. The model gets the artifact name + content as context.
- Pin — pinned artifacts survive session deletion and can be referenced from any session.
- Diff — when an artifact has multiple versions, the Diff action shows a unified diff between any two.
Programmatic export
Sessions → ⋯ → Export → JSON includes all artifacts inline (base64 for binaries). Useful for archiving a project's full output trail.
The local artifact directory is a real filesystem directory you can grep / rsync / version-control as you see fit.
Audit
Every artifact write fires kind = "artifact.saved" with the session ID, name, version, and a content hash. The audit log doesn't store the content (would balloon the log), but the hash matches what's on disk so you can verify integrity later.