Identity, mission contracts, and per-tool-call audit for AI agent delegation.
Ethos is a command-line tool, an MCP (Model Context Protocol) server, and a
Claude Code plugin for developers who hand work to AI coding agents in a Git
repository. It gives each agent a named identity and role, runs delegated work
under a written mission contract that limits which files the agent may change,
and logs every tool call the agent makes. It is a single Go binary that runs
locally, with no server, network telemetry, or cloud service. Private local usage
records under ~/.punt-labs/ethos never leave the machine; disable them with
ETHOS_TELEMETRY=off or PUNT_TELEMETRY=off.
Platforms: macOS, Linux (amd64, arm64).
Install ethos:
curl -fsSL https://raw.githubusercontent.com/punt-labs/ethos/ecc5fea/install.sh | shCreate your identity and team:
~/.local/bin/ethos setupThe installer places the ethos binary in ~/.local/bin, adds that
directory to PATH in your shell profile, copies starter roles, talents and
skills into ~/.punt-labs/ethos/, and, when claude
and git are available, installs the Claude Code plugin. It checks the
machine installation without enabling or modifying the current repository.
ethos setup is an interactive wizard that creates an
identity for you, an agent identity named claude, and a team of specialist
agents. After you open a new terminal (or source your shell profile), the
bare ethos command works. Full walkthrough: Onboarding.
Install without the Claude Code plugin
For a harness other than Claude Code, or a Claude Code install where organization policy blocks plugins:
curl -fsSL https://raw.githubusercontent.com/punt-labs/ethos/ecc5fea/install.sh | sh -s -- --no-pluginWhere arguments cannot pass through the pipe, set ETHOS_NO_PLUGIN=1:
curl -fsSL https://raw.githubusercontent.com/punt-labs/ethos/ecc5fea/install.sh | ETHOS_NO_PLUGIN=1 sh--no-plugin skips only the marketplace registration and plugin install. The
binary, PATH setup, starter content, and the machine health check still run.
Run the installer again without
the flag to add the plugin later.
Non-interactive setup from a YAML file
name: Mal Reynolds
handle: mal
email: mal@serenity.ship # optional; defaults to git config user.email
github: mal # optional
writing_style: concise-quantifiedRun ethos setup --file config.yaml. When email is omitted, setup uses
git config user.email. If that is also unset, setup fails and says how to
fix it, instead of creating an identity that cannot be resolved.
A mission is one unit of delegated work. Its contract is a YAML file that names the worker agent, the evaluator (the agent that reviews the work), the write set (the files the worker may change), the success criteria, and the number of review rounds allowed.
| Feature | What it does |
|---|---|
| Mission contracts | Typed contracts with write sets, success criteria and a round limit. The evaluator's identity is hash-pinned when the mission starts, so it cannot be swapped mid-mission. |
| Write-set enforcement | The PreToolUse hook blocks an edit to a file outside the write set before the edit runs |
| Audit trail | Logs every tool call with its delegation ID and mission ID, and keeps each delegation's contract, results and prompt on disk. Email addresses, credentials and home-directory paths are removed from files written to Git-tracked directories. |
| Git trailers | The commit-msg hook adds Mission: and Delegation: trailers to commits. For squash merges, ethos mission publish, ethos provenance message and ethos provenance verify carry and check the attribution in the merge commit. |
| Traceability UI | ethos ui opens a local web dashboard to browse repository files and view mission and delegation details |
| Preconditions | Block a tool call until a required earlier step has happened ("must read DESIGN.md before editing") |
| Agent identities | Each identity has a personality, a writing style and talents, written into the generated agent file |
| Teams and roles | Roles limit which tools an agent can use; teams record who reports to whom and what each role is not responsible for |
| Pipeline templates | Chain missions into multi-stage workflows from 8 built-in templates, plus 5 in the gstack team bundle |
| Lifecycle hooks | 7 Claude Code hook events: SessionStart, PreToolUse, PostToolUse, SubagentStart, SubagentStop, PreCompact, SessionEnd |
| Repo-only identities | ethos vendor copies a complete identity set into the repository; resolution: repo-only stops lookups in your home directory |
| Symlink rejection | Mission files and lock paths that are symbolic links are refused |
| Depth limits | max_delegation_depth limits how deeply delegations can nest |
| Mission queries | ethos find missions filters closed missions by date, worker and status |
| Integration | CLI, MCP server (12 tools), and plain files that other tools read; biff, vox, beadle and quarry use ethos identities when it is installed |
| Automatic storage upgrade | Converts older store layouts the first time any command, hook or MCP call runs; ethos doctor reports the result in its Storage row. See Storage Layout. |
The commit-msg hook adds Mission: and Delegation: trailers to the commit.
The prompt and audit log are kept locally under .punt-labs/local/ethos/ in
the main checkout of the repository, so a fresh clone does not have them.
Run these commands from the main checkout:
$ git blame -L 42,42 internal/hook/generate_agents.go
abc1234 (bwk 2026-05-25 42) func projectFilePatterns(repoRoot string) string {
$ git log --format='%(trailers)' abc1234
Mission: m-2026-05-25-002
Delegation: d-2026-05-25-011
$ cat .punt-labs/local/ethos/trace/missions/m-2026-05-25-002/delegations/d-2026-05-25-011/prompt.md
"Fix the hardcoded Go file-extension patterns. Detect project type
at generation time (go.mod → Go, pyproject.toml → Python)..."
$ ethos audit show --delegation d-2026-05-25-011 --format text
2026-05-25T12:49:23Z Read <repo>/internal/hook/generate_agents.go
2026-05-25T12:49:55Z Edit <repo>/internal/hook/generate_agents.go
2026-05-25T12:51:06Z Bash go test -run TestGenerateAgentFiles ...
2026-05-25T12:53:25Z Bash make check
2026-05-25T12:53:37Z Bash git commit ...
Illustrative: actual SHAs and IDs vary per repository.
The record setting in .punt-labs/ethos.yaml controls what is shared. With
the default, record: blame, prompts and audit logs stay in
.punt-labs/local/ethos/, which Git ignores; the contract, results and
delegation records are written to .punt-labs/ethos/ for you to commit. With record: full,
ethos also copies prompts, reflections and sealed audit logs recorded while
record: full was set into .punt-labs/ethos/, so they are committed with
the code. Sealing is done by
the pre-commit hook, which runs ethos audit seal to move pending log lines
into fixed archive files. Switching modes does not publish older private
history or remove history that was already published.
For a squash merge that covers one or more missions, use ethos mission publish, ethos provenance message and ethos provenance verify. They
generate the merge commit body and check the merged commit afterward. See
the merge example.
leader: claude
worker: bwk
evaluator:
handle: djb
write_set:
- internal/hook/generate_agents.go
- internal/hook/generate_agents_test.go
success_criteria:
- detect project type at generation time
- tests cover Go, Python, and generic fallback
budget:
rounds: 2
reflection_after_each: trueWhen the worker agent is spawned, the PreToolUse hook enforces the write set: an Edit to a file outside the contract is blocked before it runs.
[ethos] Subagent bwk spawned: go-specialist
[ethos] Personality: kernighan (simplicity, clarity, generality)
[ethos] Tools: Read, Write, Edit, Bash, Grep, Glob
[ethos] Anti-responsibilities: strategic direction (that's the COO's job)
Ethos generates each .claude/agents/<handle>.md file from the identity,
role and team data. The identity's personality, writing style and talents
become text in the agent's prompt. The role sets which tools the agent can
use.
The most common commands are below. Every command accepts --json. Full
reference: Agent Guide.
| Command | What it does |
|---|---|
ethos enable / disable |
Turn ethos on or off in this repository (see Enable / Disable) |
ethos setup |
Create identities and a team (interactive wizard) |
ethos whoami |
Show your resolved identity |
ethos identity schema |
Show the field reference for an identity (also role schema, team schema) |
ethos session start / end |
Open or close a session from any harness: eval "$(ethos session start)" |
ethos session iam <persona> |
Declare your persona in the active session |
ethos doctor |
Check installation health |
ethos vendor [handle...] |
Copy a complete identity set into this repository (see Repo-Only Identities) |
ethos mission create / dispatch |
Create a mission contract from a YAML file or from flags |
ethos mission claim / release |
Bind the current session to a mission, so agents it spawns run under that contract, or clear the binding |
ethos mission show <id> |
Show a contract, its results and reflections |
ethos audit show --delegation <id> |
Show every tool call made under a delegation |
ethos audit seal [--dry-run] |
Move pending audit lines into fixed local archive files (the pre-commit hook runs it) |
ethos find missions |
Query closed missions by date, worker and status |
ethos ui |
Open the traceability dashboard in a browser |
Configuration beyond the Quick Start.
Inside Claude Code, the plugin's hooks open a session for you. In any other harness, open one when the shell or harness starts:
eval "$(ethos session start --persona bwk)"Then ethos whoami reports the persona, ethos session shows who is in the
session, and ethos session end closes it. session start is safe to run
again; it exports ETHOS_SESSION, plus ETHOS_AGENT_ID when --persona is
given. Details: Harness-Neutral Sessions.
This is a pilot and is off by default. With ethos serve --opencode-session-metadata, MCP calls from OpenCode resolve identity from
the OpenCode session ID sent with each request, after you add that session
to an ethos session roster. The session ID is used for routing, not
authentication. Setup and limitations: OpenCode MCP
Identity.
By default ethos looks up an identity in the repository, then the active team
bundle, then ~/.punt-labs/ethos/. Because of that last step, an identity
missing from the repository is found in your home directory without warning,
and the gap shows up only on a CI runner or a fresh clone. ethos vendor
copies every identity, role, team and attribute that the chosen identities
need into the repository:
ethos vendor --team engineering --apply --pruneThen set resolution: repo-only in .punt-labs/ethos.yaml. A missing
reference then fails with an error that names it, and ethos doctor reports
it. Full walkthrough: Team Setup.
All worktrees of a repository share one ethos store in the main checkout.
Removing a linked worktree keeps its prompts, reflections and audit logs,
even if the session did not end cleanly. Deleting the main checkout, or its
.punt-labs/local/ethos/ directory, deletes them. Set ETHOS_REPO_ROOT to
use a different store location. Details: Storage
Layout.
ethos enable turns Ethos on for you in the current checkout. It uses an
ignored guide, CLAUDE.local.md, and .claude/settings.local.json.
Use ethos enable --scope project to share the guide, import, and grants
with the project and chain its Git hooks. Both scopes allow Ethos's CLI,
MCP tools, and skills without approval prompts.
ethos disable turns Ethos off for you; ethos disable --scope project
removes the shared integration. Add --opt-out to project disable to keep
the checkout off until the project clears the opt-out. Use ethos status
to see which marker decided the state. Identities, missions, and audit data
stay on disk. Use ethos enable --scope project --refresh to refresh shared
guides and regenerate Claude agent definitions explicitly. SessionStart
does not rewrite agent files. Details: Enable / Disable.
| Tool | What it does | Where ethos differs |
|---|---|---|
| SoulSpec | Structured agent personas | Ethos adds mission contracts, an audit trail and team structure to personas |
| Mastra | Typed Zod schemas and pre-delegation hooks | Ethos adds persistent identities, file-level write sets and a fixed evaluator |
| CrewAI | Role-based agent orchestration | Ethos uses typed YAML contracts with write sets enforced before each tool call, and links commits to missions |
| Claude Managed Agents | Hosted agent harness for long-running and asynchronous work | Ethos runs locally with any harness and keeps contracts and audit logs in the repository |
Ethos imports SoulSpec personas (ethos import --from soulspec) and exports
to SoulSpec (ethos export --to soulspec). Export is lossy: the enforcement
data has no place in SoulSpec's markdown.
| Guide | Audience |
|---|---|
| Onboarding | Install, setup, first delegation |
| Team Setup | Configuring roles, teams, bundles, vendor and repo-only resolution |
| Harness-Neutral Sessions | Running ethos outside Claude Code (Codex, plain terminal) |
| Enable / Disable | Per-repository enable and disable, Git hook chaining, ethos doctor |
| Audited Delegation | Ad hoc and contract-bound agent spawns, claim and release, audit trail, Git trailers |
| Traceability Data Assets | Every file ethos produces, organized by scope |
| Storage Layout | Where ethos stores each file, the automatic upgrade, recording modes, publication and export, and the test behind each rule |
| Traceability Use Cases | 10 forensic and compliance scenarios with query paths |
| Archetypes and Pipelines | Mission templates and multi-stage workflows |
| Architecture | System design (LaTeX) |
| Agent Guide | CLI, MCP, hooks, storage layout |
| OpenCode Setup | Native OpenCode agents, models, tools, and verification |
| Design Decisions | Architecture decision records with rationale and rejected alternatives |
| Contributing | Building ethos and running the quality gates |
| Changelog | Release history |
| Roadmap | What has shipped and what is planned |
MIT