Coding-Agent Integration
There are two ways a coding agent on your machine meets Vagaris:
- Governed —
vagaris devspawns it under a lease (the preferred path; see Developer Mode). - Self-driven — you launch
claudeorcodexyourself and give it an agent API key so it can read and write issues through the API or the MCP server. That is what this page sets up.
Create an agent key and shell exports
vagaris agent local-cli <agent-id-or-shortname> --company-id <company-id>
The command looks up the agent, creates an API key for it (--key-name, default local-cli), and prints:
Agent: <name> (<id>)
API key created: local-cli (<key-id>)
# Run this in your shell before launching codex/claude:
export ...
The export block sets the API base, company id, agent id and the new key. Paste it into the shell you will launch the agent from. With --json the same data comes back as an object with agent, key (including token), skills and exports.
The key is shown once. Treat it like any credential; vagaris auth logout does not revoke agent keys — remove them from the agent's settings in the UI.
Installing skills into the agent's home directory
Vagaris ships skills that teach a coding agent its task workflow, comment conventions and approval handling. agent local-cli can symlink them into ~/.codex/skills and ~/.claude/skills, but only with explicit consent because those directories belong to other tools:
vagaris agent local-cli <agent> --company-id <company-id> --install-skills
Without --install-skills nothing is written and nothing is asked. With it, the CLI asks for confirmation at a terminal; pass --yes to consent non-interactively. In a non-interactive or --json run, --install-skills without --yes is a refusal, not a silent skip. The output reports, per tool, what was linked, removed, skipped and failed. vagaris uninstall later removes these links while they still point into the recorded skills source, and keeps and names any that were replaced or re-pointed.
Governed Claude Code hooks
The Claude Code hooks that govern a workstation (the reflex gates, the secret redaction, the session checks) ship as one versioned bundle, installed and checked through this CLI instead of being copied into ~/.claude/hooks by hand.
vagaris claude-hooks install --dry-run --bundle <dir>
vagaris claude-hooks install --yes --bundle <dir>
vagaris claude-hooks verify --json
vagaris claude-hooks install --rollback --dry-run
vagaris claude-hooks install --rollback --yes
The bundle lives in the CLI's own home: ~/.vagaris/claude-hooks, or $VAGARIS_HOME/claude-hooks when VAGARIS_HOME is set (the global --data-dir sets it, as it does for the rest of the CLI's state). install validates the bundle (schema, every listed file present, each sha256 matching), copies it to claude-hooks/<digest>/ with each file's mode from the manifest, points claude-hooks/current at it, backs up ~/.claude/settings.json, rewrites only the hooks the bundle manages to run from current, and sets the bundle's env keys (the reflex gates do nothing unless VV_REFLEX_GATES is on). Every other setting and every hook the bundle does not know is left as it was. It writes another tool's settings, so it asks first; pass --yes to consent non-interactively. --dry-run prints the planned changes and writes nothing, and a second install with nothing to change writes nothing; an installed copy whose bytes or mode drifted is copied again. --rollback restores the backup the last install took; --rollback --dry-run prints that plan, writes nothing and needs no consent. Without --bundle the bundle is read from $VAGARIS_REPO/packages/adapters/claude-local/src/workstation, then from the vagaris checkout the CLI runs from; the published package does not ship the workstation bundle, because some of its files carry operator-local paths.
The bundle digest, the identity a later release signs, covers every file's sha256 and mode, the bundle's env keys and values, and its hook entries.
verify reads Claude Code's effective hook configuration from the settings files Claude Code reads: ~/.claude/settings.json and settings.local.json (or $CLAUDE_CONFIG_DIR), the platform's managed settings file, and, with --project, that project's .claude/settings.json and .claude/settings.local.json. A project's overrides are not seen without --project. It reports each managed hook as installed (file present, sha256 and mode matching) and registered (its command present under its event and matcher), honours allowManagedHooksOnly, and lists hooks the bundle does not know as unknown. Where the precedence between settings files is inferred rather than proven it fails closed: disableAllHooks: true in any file reads unhealthy even when a higher-precedence file sets it false, and each of the bundle's env keys must be set, with every file that sets it setting the bundle's value. Some bundled hooks still call helpers at fixed ~/.claude/... paths; verify finds those paths in the installed files and checks that each helper there is the bundle's copy (sha256 and mode), and lists them. It exits 0 when healthy, 1 when unhealthy (a gate missing, altered, unregistered, disabled, switched off by env, calling a helper that is not the bundle's copy, or still pointing at its old local path), and 2 when nothing is installed. vagaris doctor shows the same health whenever a bundle is installed. It checks the configuration on disk as Claude Code reads it, not a running session's in-memory copy, and it does not see hooks that plugins supply, flags on a claude command line, or the environment claude starts in.
Which skills the agent gets
Skills the company has installed are attached to agents with vagaris skills agent sync; the local symlink step above only mirrors the bundled skill files. The two are independent:
vagaris skills browse
vagaris skills install github-pr-workflow --company-id <company-id>
vagaris skills agent sync <agent> --skill github-pr-workflow --company-id <company-id>
vagaris skills agent list <agent> --company-id <company-id>
See the agent-developer guide Writing a Skill.
Talking to Vagaris from inside the agent
With the exports in place the agent can use either the REST API directly or the MCP server, which exposes issue, comment, document, approval and workspace tools. MCP has the configuration.
The session envelope
When vagaris dev spawns the agent with --agent or --native, it sets VAGRIS_SESSION_ENVELOPE to a JSON document describing the organization, repository (path, branch, head commit, dirty flag), authority, budget ceiling, model policy, tool policy, evidence requirements and run lineage. An agent frontend that understands the envelope configures itself from it; one that does not simply ignores the variable. The envelope is the single cross-boundary contract — it is materialised once, from the server session plus the verified lease, and the delegated and native forms are byte-identical apart from the delegated flag.
Adapters versus executors
The adapters documented under Adapters run on the server. Only Claude Code and Codex can also be hosted by the CLI under a lease today; see Executors.