akm docs

Data and Telemetry

akm keeps your data on your machine. It sends no crash reports. It records local-only counts of its own commands and, at most once a day per surface, sends an anonymous usage report built from them. Apart from that report it makes network requests only to the endpoints you configure or the commands you run, listed below. This page covers what akm sends, and what it stores and where.

Network destinations

Where akm stores data

On Linux and macOS the directories follow the XDG Base Directory conventions. Windows uses per-user app-data directories (%LOCALAPPDATA%\akm\data, %LOCALAPPDATA%\akm\state).

Config directory

$XDG_CONFIG_HOME/akm (default ~/.config/akm/). Override with AKM_CONFIG_DIR. credentials.json and models.json always live here, even when --config or AKM_CONFIG_FILE selects a config file elsewhere.

Path Contents
config.json Your configuration: connections, harnesses, improve strategies, bundles, registries and experimental opt-ins. See Configuration. Deleting it resets all settings.
config.json.lck Write sentinel held while config.json is saved.
credentials.json The API keys akm holds for your connections and for the embedding service, each with the endpoint it was stored for, written with mode 0600 (see Credentials). Deleting it removes those keys; akm sends requests without them.

Data directory

$XDG_DATA_HOME/akm (default ~/.local/share/akm/). Override with AKM_DATA_DIR.

Path Contents
index.db The search index. Rebuilt by akm index --full.
state.db Durable local state: events, usage records, proposals, task history, improve runs, workflow runs. Not regenerable.
logs.db Log lines from scheduled task runs. Old lines are purged by akm improve.
metrics.db Local CLI usage counts, in tables named cli_usage_* (see CLI usage counts). Deleting it only discards those counts.
akm.lock The lockfile: resolved version, revision and integrity of each installed bundle. akm.lock.lck is its write sentinel.
index.rebuild.lock, index.db.write.lock Lock files for akm index and asset writes.
secret-locks/ Per-secret lock files taken while a secret is written.
state.db.pre-<migration id>.bak A copy of state.db taken before a migration that drops schema (018, 028) runs. Yours to delete.
workflow-run-locks/ One lock file per running workflow run.
backups/tasks/ Copies of task files made by akm migrate apply before it rewrites them.
backups/asset-content-refs/ Copies of the markdown and YAML files akm migrate apply rewrote to the current ref spelling. akm backups prune removes the old ones.
backups/asset-engine-keys/ Copies of commands, agents, workflows and task sources made by akm migrate apply before it rewrites their engine: key.
migrate/engine-targets.json The connection or harness each old engine name became, kept by akm migrate apply until every engine: key is rewritten.
opencode-runtime/ Everything akm's own agent runtime keeps: OpenCode's config/ (with akm's plugin), data/ (logs, repositories, shell output, and data/opencode/opencode.db, the runtime's sessions, which akm proposal extract --sessions opencode reads back, read-only), cache/, state/ and tmp/ (the binary's own native pieces). Recreated on next use; deleting it loses the runtime's session history.

If akm cannot read this directory, commands fail with DATA_DIR_UNREADABLE (exit 78) naming the path; akm doctor still runs and reports it. If the directory is read-only (an agent sandbox that only allows writes in the workspace, for example), akm feedback fails with DATA_DIR_NOT_WRITABLE instead of reporting success for feedback it could not store.

State directory

$XDG_STATE_HOME/akm (default ~/.local/state/akm/). Override with AKM_STATE_DIR.

Path Contents
locks/scheduler.lock Serializes writes to the native scheduler (akm task).
locks/<bundle-key>/improve.lock Whole-run lock for akm improve, one directory per bundle.

Cache directory

$XDG_CACHE_HOME/akm (default ~/.cache/akm/). Override with AKM_CACHE_DIR. Everything here is regenerable; deleting the directory is safe.

Path Contents
config-backups/ The last 5 pre-save snapshots of config.json, plus config.latest.json. akm migrate apply also leaves credentials.json.<ts> (a copy of your API keys, taken before it re-files older entries) and models.json.<ts> (the retired file) here; those are not pruned. Owner-only (file 0600, directory 0700); on a filesystem without POSIX permissions, such as a CIFS/Azure Files share, the mount options decide them instead.
registry/ Downloaded npm and git packages for installed bundles.
registry-index/ Git mirrors (git-<key>/) and website snapshots (website-<key>/).
models/ The local embedding model downloaded from Hugging Face.
onnxruntime/ The ONNX Runtime binding and library for local embeddings, downloaded once from the npm registry.
opencode/<version>/ The OpenCode binary akm's own agent runtime runs (about 240 MB), fetched from the npm registry on the runtime's first use.
tasks/logs/ Per-run log files of scheduled tasks.
logs/index/, logs/improve/ One log file per akm index run and per akm improve run; akm improve deletes files older than improve.eventRetentionDays.

Bundle directory

~/akm/ by default; configure bundles and defaultBundle in config.json (AKM_BUNDLE_DIR still overrides it, Deprecated). This holds your asset files and is not regenerable. akm also writes into it:

Path Contents
<bundle>/<type>/... Your assets: skills, knowledge, memories, workflows, tasks, env files, secrets and the rest.
<bundle>/.akm/memory-cleanup/ Retired memories (archive/) and a log of belief changes (belief-transitions.jsonl).
<bundle>/sessions/ Session assets written by akm proposal extract and the improve extract stage.

What state.db records

index_completed metadata carries the phase timings plus totalEntries (library size after the run). Runs recorded before this field was added omit it; readers must treat it as optional.

search metadata carries source (the usage source that ran it) and searchId (a UUID). A select copies both from the search it followed, and akm doctor metrics counts one select per (searchId, ref). Events written before these fields existed have neither: they are counted as recorded, for every source, and akm doctor metrics notes the day deduplication starts.

Event types, for akm doctor log --type <type>:

Events and improve run rows older than 90 days are purged by akm improve (improve.eventRetentionDays; 0 disables). Usage records older than 90 days are purged on akm index. Read these with akm doctor log, akm doctor metrics, akm proposal list and akm doctor log --task <id>.

CLI usage counts

akm records how its own commands are used, on your machine. The counts are outside learning, feedback and ranking; the only thing sent from them is the daily usage report, as counts.

Daily usage report

On by default. Once a day each, the CLI and AKM Desktop send a report to a privately hosted service run by the akm maintainers. It holds no personal information. It shows which parts of akm are used, so the unused ones can be dropped.

What can be in it. Apart from the system fields below, every value in a report is a number. Every name in it (an event's name, a count's name) is built from akm's own definitions: its commands, the flags it declares and their fixed lists of choices, the agent harnesses it knows, its asset types. Anything you or a bundle named is counted as other or [unknown], or left out: a custom asset type, a task's own input flag, a harness akm does not know, a command that does not exist. Nothing is read from an argument's value, a ref, a path, a bundle's name or a file.

Inspect and clear

akm doctor metrics                                   # usage report for the last 30 days
akm doctor log --type search --limit 20              # recent events
akm proposal list                             # pending proposals
akm doctor info                                      # where config, bundle, cache and index live
rm ~/.local/share/akm/index.db && akm index --full   # rebuild the index
rm -rf ~/.cache/akm                                  # drop all caches

state.db has no clearing command. Removing it deletes events, proposals, task history and workflow runs. To reset everything except your bundle files, remove the config, data, state and cache directories.

Environment variables

Variable Effect
AKM_CONFIG_DIR, AKM_DATA_DIR, AKM_STATE_DIR, AKM_CACHE_DIR Override the config, data, state and cache directories
AKM_BUNDLE_DIR Deprecated: register the bundle and select defaultBundle. Default bundle directory (~/akm/)
XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME XDG bases; akm appends /akm
AKM_SQLITE_JOURNAL_MODE Deprecated, no replacement; removed in 0.11. SQLite journal mode: WAL (default), DELETE or TRUNCATE. akm falls back from WAL to DELETE on its own when the data directory is on a detected network filesystem (NFS, SMB/CIFS, 9p, CephFS, FUSE such as sshfs or virtiofs); detection works on Linux only, so a data directory on a network filesystem on macOS or Windows is unsupported. In containers that are thrown away, keep SQLite on local disk and use snapshots.
AKM_NPM_REGISTRY Base URL of an npm mirror. Replaces registry.npmjs.org for npm bundle resolution.
AKM_REGISTRY_URL Comma-separated registry URLs that replace the configured registries in every registry search akm performs; akm registry list, akm doctor info and the egress-endpoints health advisory still show the configured list. Prefix an entry with <provider>:: (for example skills-sh::https://skills.sh) to choose a provider; the default is static-index.