Documentation Index
Fetch the complete documentation index at: https://docs.amika.dev/llms.txt
Use this file to discover all available pages before exploring further.
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.
.amika/checks/ at the root of your repo.
Checks are designed to compose like UNIX tools, not be configured like a
CI YAML. If you can write a script, you can write a check.
How checks run
When a check is triggered, Amika spins up a sandbox loaded with your repo at the relevant branch, runs the check file, and collects its results. Each executable file inside.amika/checks/ runs in its own sandbox. If
you have three check files, you get three parallel sandboxes per trigger.
A check can be triggered from three places:
| Trigger | When it runs |
|---|---|
| GitHub PR | On every push to a pull request branch |
| Pre-commit hook | Before git commit on your local machine |
| Agent hook | When a coding agent edits your code, locally or in a sandbox |
amikalyze parser used by
code annotations) gate each individual write.
Sandboxed checks defined in .amika/checks/ run after the agent
completes a batch of edits, since spinning up a sandbox per write would
be too slow.
Two CLIs come up in this guide.
amika runs on your host machine and
manages sandboxes, hooks, and config. amikactl runs inside the
sandbox and lets a running check talk to the runner — to report progress,
log output, or attach artifacts. Anything you run from your terminal is
amika; anything inside a check script is amikactl.Write your first check
Create a.amika/checks/ directory at the root of your repo and drop an
executable file inside it. Anything with the executable bit set is treated
as a check; non-executable files (such as the sibling config.toml) are
ignored.
Here’s a contrived example:
amikactl check step and checks.step are optional but recommended —
they give the runner structured progress that surfaces in the PR check UI.
amikactl check log and checks.log append messages to the check log.
Without step calls, the runner only sees the final exit code.
A non-zero exit fails the check. Anything written to stdout and stderr is
captured as the check log.
Make a check that commits fixes
A check can modify files in the sandbox’s working copy. By default those changes stay in the sandbox and are discarded when the check finishes. To push them back to the branch, declare the check’s commit behavior in.amika/checks/config.toml:
commit_mode has three values:
| Value | Behavior |
|---|---|
"none" (default) | Changes stay in the sandbox and are discarded |
"auto" | Changes are committed to the PR branch and pushed |
"staging" | Changes go to a per-PR, per-check staging branch you can merge back into the PR branch after review |
"staging" is the safer option for checks that rewrite code with an
agent — you see the diff before it lands on the PR branch.
Here’s the corresponding format check:
"format.mjs").
Stop runaway loops
A check withcommit_mode = "auto" can re-trigger itself by pushing
commits that re-fire the PR check. Every check has a loop_limit to cap
how many times this can happen on a single PR:
loop_limit applies to every check; per-check entries
override it. Once a check hits its limit, the runner stops re-triggering
it for that PR and reports the check as halted with a warning in the
GitHub check UI (neutral status — not pass, not fail). Other checks keep
running normally.
Configure individual checks
.amika/checks/config.toml lets you attach metadata to each check without
changing the script itself.
| Field | Type | Purpose |
|---|---|---|
display_name | string | Name shown in the PR check UI |
description | string | Subtitle shown alongside the check |
size | "xs", "s", "m", "l" | Sandbox size for this check |
commit_mode | "none", "auto", "staging" | What to do with file changes |
loop_limit | integer | Max re-triggers per PR before the runner stops |
loop_limit (outside any [check."..."] table) sets a
default applied to every check that doesn’t specify its own.
Run checks locally
The same checks can run on your machine through git hooks or as an agent hook. Initialize the hooks with:init githooks installs a pre-commit hook that runs every check in
.amika/checks/ before git commit finalizes. init agenthooks
registers a hook with your local agent (Claude Code, Codex, OpenCode) so
sandboxed checks run after each batch of agent edits, and so fast
in-process checks like amikalyze can gate individual writes. Both
modes reuse the same per-check sandbox execution as the PR check.
Security
The PR check runner has two hard rules: If you need to run checks against contributions from outside your org, run them on an Amika sandbox after review.End-to-end example
Two checks that go beyond read-only analysis:validate— runs lint with auto-fix, then hands unfixable errors to the sandbox agent. Does the same for failing tests. Auto-commits any fixes.consolidate— reads the PR diff and asks the agent to replace code that duplicates existing utilities. Sends changes to a staging branch for review.
amikactl msg to message the agent running on the check’s
sandbox — the in-sandbox equivalent of amika sandbox agent-send.
.amika/checks/config.toml
validate — auto-fix lint errors and test failures
The entire check is a single message to the agent. The agent runs lint and tests, fixes what’s broken, and repeats until both pass.consolidate — replace duplicate code
The check reads the full diff of the PR branch against the base branch and passes it to the agent with a consolidation prompt. The agent searches the repo for existing implementations that the new code duplicates, then refactors. Because the changes are substantive,commit_mode = "staging"
sends them to a per-PR branch for your review before they land.
validate fixes
what it can and commits the result directly to the PR branch; if it loops
more than twice without clearing all errors, the runner halts it.
consolidate sends any refactors to a staging branch — you accept or
discard them from the PR UI before they merge.