Metadata-Version: 2.4
Name: artikeep
Version: 0.5.1
Summary: One place for everything your AI agents make, with every version and the reason behind it: a local archive of Claude Code, Codex, opencode and chat artifacts, with a gallery and an MCP server.
License: MIT
Project-URL: Homepage, https://github.com/aquahitt/artikeep
Project-URL: Changelog, https://github.com/aquahitt/artikeep/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/aquahitt/artikeep/issues
Keywords: claude,claude-code,codex,chatgpt,mcp,artifacts,ai-agents,archive,versioning,local-first
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: System :: Archiving :: Backup
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# artikeep

**One place for everything your AI agents make, with every version and the reason behind it.**

English · [Русский](https://github.com/aquahitt/artikeep/blob/main/README.ru.md)

[![test](https://github.com/aquahitt/artikeep/actions/workflows/test.yml/badge.svg)](https://github.com/aquahitt/artikeep/actions/workflows/test.yml)
[![PyPI](https://img.shields.io/pypi/v/artikeep?color=2E5E4E)](https://pypi.org/project/artikeep/)
![Python 3.9+](https://img.shields.io/badge/python-3.9%2B-2E5E4E)
![dependencies: none](https://img.shields.io/badge/dependencies-none-2E5E4E)
![macOS | Linux](https://img.shields.io/badge/platform-macOS%20%7C%20Linux-2E5E4E)
[![MIT](https://img.shields.io/badge/license-MIT-2E5E4E)](https://github.com/aquahitt/artikeep/blob/main/LICENSE)

You ask agents for pages, mock-ups and reports, in Claude Code, Codex, opencode, in chats, from several
accounts. What they make lands on someone else's server, in a chat, in a temp folder. artikeep copies
each result to your disk the moment it exists, and then it is more than a backup:

- **One place for all of it.** Pages, Design canvases, documents and files from every agent, account
  and chat export, in one gallery and one search. A link that died, an account you lost, a chat you can
  no longer open: the copy is still here.
- **Agents reuse their own work.** Through MCP an agent searches the archive before it rebuilds a
  report, and `restore` hands it the old page to continue or publish again under the new account.
- **Every version, with the reason.** Each change is a version that keeps the request that caused it.
  Compare any two side by side, with a slider, or as a difference, and mark the one you chose.

**On Claude Code it is a plugin: two commands, no setup.**
[Jump to the quick start](#claude-code-the-plugin-recommended).

![Search the archive, open an item, compare its first and current versions](https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/demo.gif)

### Without it, and with it

| | By hand | With artikeep |
|---|---|---|
| A hosted artifact link dies or changes owner | the page is gone | the copy is in the archive; `restore` brings it back |
| You want yesterday's version | you hope you kept a file | every change is a version, one click to compare |
| "Why did we do it this way?" | scroll an old chat, if it is still there | each version carries the request behind it |
| You start a report an agent already wrote | it is written again | the agent finds the old one by MCP search |
| Work from several agents and accounts | scattered across tabs and folders | one gallery, filter by project, source or collection |
| Send a page to someone | screenshots, or share your account | `artikeep export`: one file, opens offline |

Saving by hand, a claude.ai project or a git commit each cover a piece of this; none of them
follows an agent that works in another tool, and none of them knows what you asked for.

**In real use.** One archive after a few months: about 190 items from three sources across two
projects, 330 versions, one canvas with 22. About a hundred of the items were captured by hooks
with nobody asking; the rest were added by hand with `add` and `import`.

It stays out of your way:

- **Automatic where it can be.** Hooks in Claude Code and Codex, a plugin in opencode, capture without the
  model having to remember anything.
- **Plain files, in git.** The archive is a folder of HTML, Markdown and JSON. It opens
  without artikeep, and syncs between machines through a private git remote, checked for secrets
  before every push.
- **No dependencies.** Python 3.9+ standard library. Nothing to `pip` install for capture.

## Quick start

### Claude Code: the plugin (recommended)

Two commands inside Claude Code, nothing to install first:

```
/plugin marketplace add aquahitt/artikeep
/plugin install artikeep@artikeep
```

That's it. The plugin brings the hooks and the MCP server, updates through `/plugin`,
and needs nothing but `python3` 3.9+, already there on most Macs and Linux machines.
From the next session on, every page, canvas and document Claude Code makes lands in
`~/artikeep`, each change as a version. Open `~/artikeep/index.html` to see the gallery.

From a terminal instead:
`claude plugin marketplace add aquahitt/artikeep && claude plugin install artikeep@artikeep`.

Two optional extras, a command each (`uvx` comes with [uv](https://docs.astral.sh/uv/) and
runs artikeep without installing it):

- **Backup and sync:** `uvx artikeep init ~/artikeep` makes the archive a git repository;
  add `--remote git@github.com:you/my-artifacts.git` (a **private** repo) to sync machines.
- **Longer transcripts:** set `"cleanupPeriodDays": 3650` in `~/.claude/settings.json`, so
  a lost artifact can still be recovered from its session.

### Codex, Claude Desktop, or everything at once

```bash
uv tool install artikeep        # or: pipx install artikeep
artikeep init ~/artikeep        # the archive folder (a git repo)
artikeep install                # hooks + MCP for the agents found
artikeep doctor                 # check
```

From now on, whatever Claude Code or Codex makes lands in `~/artikeep`. Open the
gallery with `artikeep open`, or `artikeep serve --open` for the local app. Already have
the plugin? Limit it to the rest: `artikeep install --agents codex,claude-desktop`.

No package manager? A clone works as is, with no install step:
`git clone https://github.com/aquahitt/artikeep ~/artikeep-src`, then
`python3 ~/artikeep-src/bin/artikeep init ~/artikeep` and so on.

## What gets captured

| Source | How | What |
|---|---|---|
| Claude Code | hooks, automatic | pages published with the `Artifact` tool (with all their files), Claude Design canvases, Claude Docs documents (exported tab by tab), unpublished pages in the session scratchpad |
| opencode | plugin, automatic | the same for opencode sessions, read from its session database; `artikeep install --agents opencode` adds the plugin and the MCP server |
| Codex | hooks, automatic | documents a session writes that git does not keep — reports, pages, tables in temp folders, untracked or ignored files — plus the session's visualizations |
| Claude Desktop chat | MCP, on request | ask Claude to save what it made; the chat has no hooks, so this is the only live way in (the Code tab of Desktop is Claude Code and is captured automatically) |
| ChatGPT | `artikeep import chatgpt <export.zip>` | canvas documents, with every edit replayed as a version |
| claude.ai | `artikeep import claude-ai <export.zip>` | artifacts from chats, with every update as a version; React components open as live pages, offline too |
| Anything else | `artikeep add <file or folder>`, or the MCP `save_artifact` tool | whatever you point it at |

Files git already tracks are skipped: they are safe where they are.

## The gallery

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/gallery-dark.png">
  <img alt="The gallery: items from Claude Code, Codex, Claude Desktop, ChatGPT and claude.ai with filters by project, source and type" src="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/gallery-light.png">
</picture>

`index.html` at the archive root: a static page that works from disk. Grid or list,
filters (project, source, type, how the copy was made), groups, full-text search,
a panel per item with its version history, side-by-side comparison of any two versions
with the changed text lines. Light and dark, English and Russian, usable on a phone.

<table>
  <tr>
    <td width="50%"><picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/versions-dark.png">
      <img alt="An item's panel: preview, where it came from, and its version history" src="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/versions-light.png">
    </picture></td>
    <td width="50%"><picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/compare-dark.png">
      <img alt="Two versions side by side, with the text lines that changed" src="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/compare-light.png">
    </picture></td>
  </tr>
  <tr>
    <td>Every save that changes something is a version, with its time, label and size of change.</td>
    <td>Compare any two versions: both pages live, plus what changed in the text.</td>
  </tr>
  <tr>
    <td><img alt="Full-text search across every item, with matches highlighted" src="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/search-light.png"></td>
    <td align="center"><img alt="The gallery on a phone" src="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/mobile-light.png" width="210"></td>
  </tr>
  <tr>
    <td>Full-text search across every item and source, in any language.</td>
    <td>Works on a phone too.</td>
  </tr>
</table>

Compare has a slider and a difference mode; the item panel shows a thumbnail of every version; in `serve` you can mark a version chosen or rejected and star an item, and filter by both.

Keyboard: `/` search, `G` / `L` grid or list, `←` `→` previous and next item, `C` compare
first and current versions, `Esc` close, `?` all shortcuts.

### As a local app

`artikeep serve` runs the gallery on `http://127.0.0.1:8765` (archived files on the next
port; `--port` changes both). On top of the file version it searches the full text of every
item and highlights the match, updates by itself when an agent saves something, lets you
rename and describe an item, make an old version current (as a new version: nothing is
overwritten), delete an item (it stays in the archive's git history), show it in Finder, and
add files or chat exports by dropping them on the page. Pages that load their own files with
`fetch()` or ES modules, which browsers refuse over `file://`, work here. In Chrome, "Install
as app" gives it its own window and dock icon.

When capturing fails, artikeep also says so on the desktop (macOS notification, or
`notify-send` on Linux), at most once an hour per kind of failure; `"notify": false` turns it off.

## Install, in detail

`install` finds Claude Code (`~/.claude`), Codex (`~/.codex`) and Claude Desktop, adds its
hooks next to yours (nothing else is touched; every edited file is backed up first),
registers the MCP server with each agent's own `mcp add` (for Desktop, in
`claude_desktop_config.json`; reopen Desktop after), and puts a short rules block into
`~/.claude/CLAUDE.md` and `~/.codex/AGENTS.md`. If `~/.local/bin` is on your `PATH`, it also
links the `artikeep` command there. `--agents claude-code,codex,claude-desktop,opencode` limits it,
`--dry-run` shows the changes, `--uninstall` removes them.

To sync across machines, give the archive a **private** remote:
`artikeep init ~/artikeep --remote git@github.com:you/my-artifacts.git`. The background
pass commits after each capture and pushes.

Claude Code deletes session transcripts after 30 days by default. `install` raises
`cleanupPeriodDays` to ten years: transcripts are the last place a lost artifact can be
recovered from.

### Claude Code plugin

The plugin ([quick start](#claude-code-the-plugin-recommended)) is the same capture as
`install --agents claude-code`, packaged so Claude Code manages it:

- **Hooks** copy every page published with the `Artifact` tool, every Claude Design canvas
  and Claude Docs document, and unpublished pages from the session scratchpad. At session
  start they pick up publishes a hook missed in the last three days.
- **The MCP server** gives Claude `search_artifacts`, `read_artifact`, `list_versions` and
  `diff_versions`, so it looks in the archive before redoing work.
- **Updates and removal** go through Claude Code: `claude plugin update artikeep@artikeep`,
  `claude plugin uninstall artikeep@artikeep` (or the same under `/plugin`). The archive
  stays where it is.

`uvx artikeep doctor` shows what the plugin is doing. Use the plugin or `install` for
Claude Code, not both: every artifact would be saved twice (`doctor` flags it). For the
rest of what `install` does, run it for those parts: Codex and Claude Desktop with
`artikeep install --agents codex,claude-desktop`; `cleanupPeriodDays` you set yourself
(`doctor` reminds you). The plugin adds no rules block to `CLAUDE.md`; the MCP server's
own instructions tell Claude when to search.

## Use

```bash
artikeep open                      # the gallery as a file: filters, versions, compare
artikeep serve --open              # the same gallery as a local app
artikeep search kitchen layout     # full-text, any language; --agent, --type, --project, --json
artikeep add ~/Downloads/report.pdf --title "Q3 report"   # joins the repository you run it in; --project PATH, --no-project
artikeep digest --days 7                     # what the agents made lately, by project (--format md to paste)
artikeep collection add "Portal splash" <id> <id>  # group related items; filter by it in the gallery, `search --collection`
artikeep attach <id> --pr N [--from vA --to vB]  # before/after of a page as a PR comment (--dry-run shows it first)
artikeep export <id> [--version N] [--format html|zip|pdf] [-o FILE]  # one file to send; also in `serve`
artikeep restore <id> [--version N]  # copy an item out to publish it again (dead link, other account)
artikeep import chatgpt ~/Downloads/chatgpt-export.zip
artikeep scan codex --all          # archive deliverables from past Codex sessions
artikeep scan claude-code          # recover publishes missed in the last 30 days (--days N, --all)
artikeep rebuild                   # rebuild gallery and search index, commit and push
```

(`artikeep` here is the command `uv tool` or `pipx` installed, the one `install` linked into
`~/.local/bin` for a clone, or `python3 <clone>/bin/artikeep`. With only the plugin, run
any of them as `uvx artikeep …`.)

**From any agent**, through MCP:

| Tool | Does |
|---|---|
| `search_artifacts` | find items by words, source, type, collection |
| `read_artifact` | metadata, file list and text of an item or one of its versions |
| `list_versions` | versions with time, label and size of change |
| `diff_versions` | changed text lines between two versions |
| `restore_artifact` | copies an item's files out and says how to publish them again; the new artifact joins the same item as a new version |
| `save_artifact` | keep a page or document (off unless `--mcp-save`) |

By default an agent sees only items made in the repository it works in. See
[SECURITY.md](https://github.com/aquahitt/artikeep/blob/main/SECURITY.md) for why, and how to widen it.

## Settings

The archive is `~/artikeep` unless `artikeep init <path>` chose another folder (remembered in
`~/.config/artikeep/config.json`) or `$ARTIKEEP_HOME` is set. Behaviour lives in
`artikeep.json` at the archive root, so it travels with the archive:

| Key | Default | Does |
|---|---|---|
| `git_push` | `true` | push to the archive's remote after each commit |
| `secret_scan` | `"block"` | before a push, look for secrets in what is about to leave: `"block"` holds it back and says why (`artikeep secrets`, `artikeep allow`), `"warn"` pushes and says so, `"off"` skips it |
| `thumbnails` | `"auto"` | gallery thumbnails, if Playwright is importable by `python3`; `"off"` disables |
| `issue_links` | `true` | link items to GitHub issues that mention them (needs `gh`), once a day |
| `lang` | `"auto"` | gallery and hook messages: `"en"`, `"ru"`, or follow the browser / locale |
| `notify` | `true` | desktop notification when capturing fails |
| `continue_republished` | `true` | when the same file is published again in a session under a new artifact link (after the Claude account changed), continue the existing item instead of making a copy; `false` keeps them apart |
| `provenance` | `true` | keep the request (up to 500 characters) and session behind each version; `false` stops recording them |
| `mcp_scope` | `"project"` | `"all"` lets agents see every project's items |
| `mcp_save` | `false` | let agents save through MCP |
| `codex_extensions` | `.html .htm .svg .md .pdf .docx .pptx .xlsx .csv` | which files a Codex session made count as deliverables |

## How it works

<img alt="Claude Code, Codex, Claude Desktop, chat exports and any file flow into ~/artikeep, a git repository; the gallery, the MCP server and a private remote read from it" src="https://raw.githubusercontent.com/aquahitt/artikeep/main/docs/media/how-it-works.svg" width="100%">

Hooks only copy files and start a detached background pass, so an agent never waits on
disk or network. The background pass renders viewers (Design canvases, Markdown
documents, React components with the libraries claude.ai artifacts may import: React,
Tailwind, recharts, lucide-react, lodash, d3, mathjs, PapaParse, SheetJS, three, Tone,
Chart.js, and stand-ins for shadcn/ui), makes offline copies with CDN scripts and fonts
vendored, updates the search index (SQLite FTS5) and the gallery, then commits and pushes.
The on-disk layout is specified in [FORMAT.md](https://github.com/aquahitt/artikeep/blob/main/FORMAT.md); any tool can write into it.

## Limits, honestly

- **macOS and Linux.** Windows is not supported (file locking uses `fcntl`).
- **Host formats are undocumented.** The hook inputs of Claude Code's `Artifact` tool,
  Codex rollouts and the Claude Docs export can change with any release. artikeep logs
  every raw hook input to `.hooklog/payloads.jsonl`, and on session start checks recent
  transcripts for publishes it missed and archives them late. `artikeep doctor` shows
  when each source last saved something.
- **Importers are checked against documented shapes and synthetic exports**, not yet
  against many real ones. Anything they do not recognise is counted and reported, not
  guessed. Please open an issue with an anonymised sample if an import comes out wrong.
- **Codex has no artifact tool.** artikeep recognises deliverables by extension, by being
  outside git, and by being named in the final answer. A file a script wrote and the
  answer never mentioned is missed.
- **Web chats are not captured live.** ChatGPT and claude.ai come in through their data
  exports, which you request by hand.

## Development

```bash
python3 -m unittest discover -s tests -t .     # the test suite, no dependencies
scripts/e2e-codex.sh                           # live check of the Codex adapter: one real Codex request
scripts/readme-media/make.sh                   # rebuild the README screenshots and GIF
```

The screenshots come from a synthetic archive (`scripts/readme-media/seed.py`), not from
anyone's real one; rebuilding them needs Playwright with Chromium and Pillow.

A release is a pushed tag `vX.Y.Z`: `.github/workflows/publish.yml` tests, builds, publishes
to PyPI and creates the GitHub release from the CHANGELOG entry. The helpers are in
`.github/ci/`; the steps, for a person or for Claude Code (`/release`), are in
[`.claude/skills/release/SKILL.md`](https://github.com/aquahitt/artikeep/blob/main/.claude/skills/release/SKILL.md).

## License

MIT. Changes are listed in [CHANGELOG.md](https://github.com/aquahitt/artikeep/blob/main/CHANGELOG.md).
