Skip to main content
Research preview. Interfaces, config formats, and CLI commands described here may change before general availability. Reach out on Discord or email help@amika.dev to join the early access program.
amikalog is an open-source CLI that captures every Claude Code and Codex session as plain, append-only files on disk. Your past agent work becomes data that future agents, scripts, and pipelines can read, search, and build on. It ships from the amika repo but is a standalone tool — you can use it on its own.

Install

amikalog is versioned and installed independently of the amika CLI. Pass --component amikalog to the install script:
Pin a version with --install-version (amikalog releases under tags of the form amikalog@v*), or build from source with make build-amikalog.

Turn on capture

Enable capture once, globally:
That’s it. Use Claude Code and Codex exactly as before — every session is now recorded. amikalog rides the agents’ own hook systems, so there is no daemon, no proxy, and no change to how you invoke the agent. amikalog start idempotently installs hook entries into:
  • ~/.claude/settings.json — one entry per Claude Code agent-activity hook event (tool use, prompts, permissions, subagents, tasks, turns, context compaction, and session lifecycle).
  • ~/.codex/hooks.json — one entry per Codex lifecycle event (honors $CODEX_HOME).
The hooks are global: they fire in every repository. Capture is best-effort — a failure to record is reported on stderr but never blocks the agent or alters its behavior.
Codex requires trusting the hooks before they run. On first run Codex marks newly added hooks for review and skips them until trusted, printing a warning that points you to its /hooks command — review and trust the amikalog hook there, and Codex sessions start producing events. Claude Code needs no such step.
Sessions started before amikalog start are not captured. Only sessions that begin after capture is on produce a record.
To turn capture off, run:
stop removes only the hooks amikalog installed; unrelated hooks and already-captured events are left alone.

What gets captured

amikalog records every session as append-only JSON events under a predictable directory tree on your own disk. Each event carries the raw hook payload plus the git state it fired in — repository, commit, branch, and whether the tree was dirty. Events are written under the amika state directory, resolved in order: AMIKA_STATE_DIRECTORY if set, otherwise $XDG_STATE_HOME/amika, otherwise ~/.local/state/amika. amikalog start prints the resolved paths. Events land at:
Each session is a single append-only JSONL file — one JSON event per line, and earlier lines are never modified. The files are ordinary text you can grep, jq, sync, or load into a database. Each line records: For example, pull every PostToolUse event a session recorded:

Why capture

Local capture is just JSON on disk, so you can close the loop with whatever you already have — jq, a script, a cron job, or your agent’s own file tools. Past sessions feed forward into future runs:
  • Memory — have a new session read past sessions’ event logs in the same repo, so agents stop rediscovering the same context.
  • Guardrails — mine past sessions for the rules your team keeps learning the hard way and write them into the instruction files (CLAUDE.md, AGENTS.md) that future runs load.
  • Evals — each session is the full sequence of what an agent actually did, pinned to the exact commit it ran on. Real sessions make the best test cases.
Claude Code and Codex events share one schema, so anything you build on top works across agents.

Share sessions with your org

Org sync is in beta.
Local capture works entirely offline. To pool your org’s sessions in one place, two beta commands sync the event log with a storage bucket that the hosted Amika platform manages for your organization. Both authenticate with an org API key set in AMIKA_API_KEY:
beta:push uploads your not-yet-pushed events to the org bucket. Pushed files are tracked by size, so repeated runs re-upload only sessions that grew new events, and re-pushing is idempotent. beta:fetch downloads the org bucket into a local directory — your whole org’s sessions as ordinary files.
beta:push uploads message contents, tool arguments, file paths, and commit messages to Amika’s servers. Treat captured transcripts the same way you treat the source code your agents read.

Command reference

Environment variables

Next steps

Send a message to an agent

amikalog on GitHub