Give it a task. Get back a tested branch.
Zenith is an autonomous coding agent. It plans the change, waits for your approval if you want it to, edits the code, runs your project's own tests, fixes what they catch, and hands back a branch and a pull request. It works with OpenAI, Anthropic, Gemini, AWS Bedrock, Ollama or your own gateway.
go install github.com/divmora/zenith/cmd/zenith@latestAn agent you can hand real work to
The model proposes and edits. Zenith decides what counts as done: it runs the checks itself and never takes the model's word that tests pass.
Plan first, if you want
A read-only planning phase proposes the change and stops. Approve it, add a note, or send feedback for a new plan. Planning resumes from a checkpoint, even in a fresh sandbox.
Verified by your own checks
Zenith finds your project's checks (make test, Go, npm/pnpm/yarn/bun, cargo, pytest, composer) and runs them before and after. New failures go back to the agent to fix.
Your checkout stays yours
With --worktree, the work happens in a separate git worktree. Your branch and uncommitted changes are never touched. Every run ends in a commit on its own zenith/ branch.
Built-in personas
Specialists for security, performance, UX, maintainability, tests and docs. Each picks one focused improvement and keeps a journal in the repository, so the next run builds on the last.
Pull requests on GitHub and GitLab
zenith publish pushes the verified commit and opens a pull request or merge request, with the summary, files, checks before and after, and every command the agent ran.
Safe with untrusted code
The agent's commands never see your API keys or git tokens. Files stay inside the workspace, .git is off limits, and planted git hooks or config are undone after every run.
Budgets and long tasks
Limits on steps, tokens and time, with clear exit codes. Long runs are compacted to fit the model's context, keeping the task, the approved plan and the latest work.
Machine-readable from end to end
A JSON event stream, a result file and a checkpoint file with a versioned schema, so a CI job or a control plane can run Zenith and act on what it did.
Ready-made container
ghcr.io/divmora/zenith ships Go, Node.js (npm, pnpm, Yarn), Python with pytest, make and gcc, and runs as any user, with or without network.
One task, one process, one branch
Each run does one task in one repository. Pushing is a separate step that no model takes part in.
Start clean
Zenith records the base commit, snapshots the repository's git config and hooks, and creates the branch (in a worktree, if you ask).
Baseline
It runs the project's checks once before any change, so failures that were already there aren't blamed on the agent.
Plan (optional)
With
--approve-plan, the agent explores with read-only tools, proposes a plan and stops with exit code 10.Work
The agent reads, edits and runs commands in the workspace, with a scrubbed environment and output and time limits.
Verify
When the agent says it's done, Zenith runs the checks itself. New failures go back to the agent, for up to three rounds.
Commit
Zenith commits the result on the branch, restores the git config, and writes the result file.
Publish
zenith publish, run outside the sandbox with your code-host token, pushes the commit and opens the pull request.Review
You review it like any contribution. The description says an agent wrote it and shows exactly what was run.
Specialists that need no task text
Run zenith run --persona NAME and the specialist picks one worthwhile improvement on its own, or pass --task to aim it. Write your own as a Markdown file and use --persona-file.
sentinelSecurity
Finds and fixes one real security weakness, most severe first, and lists what it found but did not fix.
boltPerformance
Makes one measurable performance improvement without changing behaviour.
paletteUX and accessibility
Makes one small, visible UX or accessibility improvement in the interface.
sweeperMaintainability
Cleans up one piece of technical debt without changing behaviour.
probeTests
Adds meaningful tests for important code that has none, and fixes any bug they expose.
scribeDocumentation
Fixes one gap or inaccuracy in the documentation, checked against the code.
Switch providers with one flag
Pick a model with --model or ZENITH_MODEL as provider:model, comma-separated for fallbacks. Tool calling and streaming work the same way on every provider, and prompt caching is used where the provider has it.
# the provider's usual key variable is read export ZENITH_MODEL=anthropic:claude-sonnet-5-5 ANTHROPIC_API_KEY=... export ZENITH_MODEL=openai:<model> OPENAI_API_KEY=... export ZENITH_MODEL=gemini:<model> GEMINI_API_KEY=... export ZENITH_MODEL=bedrock:<model-id> AWS_REGION=us-east-1 export ZENITH_MODEL=ollama:<model> # local, no key export ZENITH_MODEL="anthropic:<model>,bedrock:<model-id>" # fallback chain
Your first task in a minute
Run it in a container or VM: the agent edits files and runs commands chosen by a model. Nothing is pushed until you run zenith publish.
# install (or download a binary from Releases, or use the image) go install github.com/divmora/zenith/cmd/zenith@latest export ZENITH_MODEL=anthropic:claude-sonnet-5-5 ANTHROPIC_API_KEY=... zenith run --worktree --workspace ./repo --result /tmp/result.json \ --task "Fix the off-by-one in pagination and add a test" zenith personas # sentinel, bolt, palette, sweeper, probe, scribe zenith run --persona sentinel --worktree --workspace ./repo
# read-only planning; exits 10 with a checkpoint zenith run --workspace ./repo --approve-plan --checkpoint /tmp/plan.json --task "..." # ask for changes: a revised plan, exit 10 again zenith resume --checkpoint /tmp/plan.json --feedback "Keep the public API unchanged" # approve, optionally with a note: implement, verify, commit zenith resume --checkpoint /tmp/plan.json --approve --note "Name the helper clampPage"
# GitHub: contents + pull-requests write. GitLab: GITLAB_TOKEN with api scope. GITHUB_TOKEN=... zenith publish --result /tmp/result.json GITHUB_TOKEN=... zenith publish --result /tmp/result.json --draft --base develop # GitHub Enterprise or self-managed GitLab GITLAB_TOKEN=... zenith publish --result /tmp/result.json \ --remote https://git.example.com/group/proj.git --platform gitlab
# the entrypoint is zenith; mount the repository at /workspace docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/workspace" \ -e ZENITH_MODEL -e ANTHROPIC_API_KEY \ ghcr.io/divmora/zenith:0.1.0 run --task "..." # other stacks: build FROM ghcr.io/divmora/zenith and add your toolchain
Repository content is untrusted
Code, comments, READMEs and issue text can all carry prompt injection. Zenith is built so that a steered agent can't do much harm outside the branch it's working on.
- No secrets in the agent's commands: an environment allowlist drops API keys, cloud credentials, git tokens and SSH agents. Add a variable on purpose with
--pass-env. - No push during a run: the code-host token is used only by
zenith publish, which runs without a model. - Confined files: file tools resolve symlinks, stay inside the workspace and can't write to
.git.
- Git can't be turned against you: Zenith's own git calls disable hooks, fsmonitor, filters and pagers, and the repository's git config and hooks are restored after every run.
- Safe pull request text: @mentions and GitLab quick actions in the model-written description are neutralised.
- Your sandbox does the rest: run Zenith in a disposable container with network limited to your model provider and package registries. See SECURITY.md for the known limits.
Four commands
| Command | What it does |
|---|---|
run | Do one task and commit it on a new branch. Task: --task, --task-file, --persona, --persona-file. Where: --workspace, --worktree, --branch. Plan: --approve-plan, --checkpoint. Limits: --max-steps, --max-tokens, --timeout, --context-tokens. Checks: --verify, --no-verify, --max-fix-attempts. Output: --result, --events, --quiet. |
resume | Continue from a plan checkpoint: --approve (with an optional --note) or --feedback. |
publish | Push the run's verified commit and open a pull request or merge request: --result, --remote, --base, --title, --draft, --allow-incomplete, --platform, --api-url. |
personas [NAME] | List the built-in personas, or print one. |
Exit codes: 0 done, 10 awaiting plan approval, 20 budget exceeded, 30 failed, 1 internal error, 2 usage. The event stream, result and checkpoint are versioned JSON for other tools.
Running it for a team?
Zenith Console is planned: task intake from issues and chat, a queue, sandboxed runs, plan approval in the browser and history, running this CLI in Docker or Kubernetes. Until then, Zenith runs from any CI job or script.