Visitar URL original
Auto-install amikalog hooks in sandbox images by jdc123 · Pull Request #281 · gofixpoint/amika · GitHub
Skip to content

Auto-install amikalog hooks in sandbox images - #281

Merged
jdc123 merged 1 commit into
mainfrom
auto-install-amikalog-hooks
Jul 10, 2026
Merged

jdc123 merged 1 commit into
mainfrom
auto-install-amikalog-hooks

Conversation

@jdc123

@jdc123 jdc123 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

Add a RUN amikalog start step to the base preset Dockerfile (after USER amika) so every sandbox ships with the Claude Code and Codex hooks pre-registered. Users no longer need to run amikalog start themselves for the sandbox to begin capturing agent activity.

Why

The amikalog binary was recently baked into the base image (#280), but the hooks it installs still had to be turned on manually per sandbox. Registering them at image-build time makes capture work out of the box.

How it works

amikalog start (v0.2.0, the pinned AMIKALOG_VERSION) runs eventlog.Init, which in one pass:

  • writes ~/.claude/settings.json — the amikalog hook --source claude command for all 18 Claude hook events (match-all);
  • writes ~/.codex/hooks.json — the amikalog hook --source codex command for all 10 Codex events (matcher .*), honoring $CODEX_HOME;
  • strips any obsolete managed notify from ~/.codex/config.toml.

The step runs as the amika user, so both files are written into /home/amika owned by amika, with the hook command pinned to the absolute installed path /usr/local/bin/amikalog. It only writes config files (no network) and is idempotent. Every preset (coder, claude, dind, coder-dind, daytona-*) derives from base, so this covers container and Daytona VM sandboxes in one place.

Testing

Fetched the exact pinned release (amikalog@v0.2.0, via install.sh) and ran amikalog start against a throwaway HOME:

  • exit 0; wrote both ~/.claude/settings.json (18 events) and ~/.codex/hooks.json (10 events, matcher .*);
  • hook command used the absolute binary path (→ /usr/local/bin/amikalog in the image);
  • second run reported "already present" and exited 0 (idempotent).

Note

amika-mono's Freestyle/Vercel snapshot builders reproduce the preset image independently and don't install the amikalog binary yet, so they're unaffected by this change. Extending the hooks to those providers is a separate follow-up.

Run `amikalog start` in the base preset image so every sandbox ships
with the Claude Code and Codex hooks pre-registered, instead of each
user having to run it themselves.

The step runs as the `amika` user (after `USER amika`), so it writes the
per-user hook configs into this home -- ~/.claude/settings.json and
~/.codex/hooks.json -- owned by amika, with the hook command pinned to
the absolute installed binary path (/usr/local/bin/amikalog). It only
writes those config files (no network) and is idempotent, so it is safe
across rebuilds. All presets derive from base, so this covers both
container and Daytona VM sandboxes in one place.
@jdc123
jdc123 merged commit 6e5a8d3 into main Jul 10, 2026
1 check passed
@jdc123
jdc123 deleted the auto-install-amikalog-hooks branch July 10, 2026 21:31
jdc123 added a commit that referenced this pull request Jul 17, 2026
Release `amika@v0.12.0` by bumping `DEFAULT_VERSION` in `install.sh`
from `0.11.2` to `0.12.0`.

## Changes since amika@v0.11.2

**Sandbox & CLI:**
- Add top-level `amika scp` command for SSH file copy (#278)
- Add `amika snapshot create/list/delete` commands (#282)
- Add `--snapshot` flag to `amika sandbox create` (#285)
- Support remote mode in `service list` (#283)
- Add (then hide) the `--github-auth-mode` flag on `sandbox create`
(#270, #273)
- Show command aliases in `amika` CLI help output (#263)

**Sandbox images & VM snapshots:**
- Install amika and amikalog CLIs in sandbox images (#280)
- Auto-install amikalog hooks in sandbox images (#281)
- Bump L/XL sandbox disk to 24 GB / 32 GB (#279)
- Match VM snapshot sizes to container sizes; add XL (#272)
- Version linux-vm snapshots by git short hash (#276)
- Don't publish the xs VM snapshot for coder-dind (#275)
- Publish Daytona linux-vm snapshots and restore setuid on VM boot
(#271)
- Drop user@host line from sandbox shell prompt (#269)
- Clear stale dockerd pidfile before starting daemon (#268)

**TypeScript SDK:**
- Release TypeScript SDK v0.10.0 with sandbox snapshot support (#287,
#284)
- Add `*.functional.test.ts` convention and prod guard (#286)
- Document AgentCredentialRef resolution rules (#267)

**Docs & internal:**
- Keep README local-first and add Amika Cloud section (#260)
- Fix stale API route paths in CLI client comments (#264)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant