# Viliha with Claude Code, Codex and other agents

Without an agent, Viliha is your project's memory. With an agent, it governs the agent's work.

## The loop

1. **Before the task:** the agent asks Viliha for the context: the requirement, the rules that apply, past decisions, all cited.
2. **Before every edit:** the gate checks the agent read the required rules and stays inside the requirement.
3. **While it works:** it asks Viliha instead of guessing a rule.
4. **Before the merge request:** it reviews its own change against the standard.
5. **At the merge request:** the Decision Audit records a verdict and its evidence; a person signs off sensitive changes.
6. **After:** what it learned is proposed for a person to approve.

## Claude Code, today

Viliha runs inside Claude Code through its hooks: at session start, on every prompt, before every tool use and at finish. The
project's workspace carries a generated `CLAUDE.md` and `.claude/settings.json` that point Claude Code at the record. The tools
(context, search, cited answers, proposals) come through the Model Context Protocol (MCP).

## One command for every tool (coming)

A hosted MCP endpoint at `https://api.viliha.com/mcp`, with browser sign-in, so nobody copies a token:

```
claude mcp add --transport http viliha https://api.viliha.com/mcp
```

Codex, Cursor, VS Code, and your own agents on the Claude or OpenAI APIs connect to the same address. Each tool's exact setup is
published here when it ships and has been checked against that tool's current version.

## How fast

Viliha's own work in an answer takes about 25 milliseconds on the server. What you feel is mostly the network, and agents keep
one connection open, so tool calls stay well under a second.
