# Introduction

> Zidane is a hookable TypeScript agent harness, with a terminal app, a desktop app and a server built on it.

Zidane is a TypeScript agent harness. It sends your prompt to a model, runs the tools the model asks for, and repeats until the model stops. Providers, tools, sessions, compaction and sub-agents all have replaceable defaults.

```ts title="agent.ts"
import { createAgent } from 'zidane'
import { basic } from 'zidane/presets'
import { anthropic } from 'zidane/providers'

const agent = createAgent({ ...basic, provider: anthropic({ apiKey: process.env.ANTHROPIC_API_KEY }) })

await agent.run({ prompt: 'build a REST API' })
```

## Surfaces

| Surface | What it is | Start here |
| - | - | - |
| The library (`zidane`) | Build your own agent in TypeScript | [Quickstart](https://zidane.si/docs/quickstart.md) |
| The terminal app (`zidane`) | A chat app in your terminal, plus `zidane run` for scripts and CI | [Terminal](https://zidane.si/docs/tui.md) |
| The desktop app | The same chat with panels, diffs, terminals and a dev browser | [Desktop](https://zidane.si/docs/desktop.md) |
| zidane-server | Runs sessions on another machine for the apps and browsers | [Server](https://zidane.si/docs/server.md) |
| The UI kit (`zidane-ui`) | The desktop app's chat components for your own React app | [UI kit](https://zidane.si/docs/ui-kit.md) |
| The ACP adapter | zidane inside editors such as Zed | [ACP](https://zidane.si/docs/acp.md) |

The terminal and desktop apps run the same engine and share sessions. With the daemon on, they also share live runs ([one engine, two apps](https://zidane.si/docs/apps.md)).

## Design principles

| Principle | What zidane does |
| - | - |
| Token discipline | Prompt caching, read dedup and byte budgets keep long sessions cheap. [Compaction](https://zidane.si/docs/sessions.md#compaction) is opt-in in the library and on by default in the apps. |
| Fault recovery | Repairs malformed tool arguments, answers unknown tool names with a fallback, rewrites errors so the model can act on them. |
| Provider parity | Anthropic gets its server-side features, other providers client-side equivalents. Switching providers needs no agent change. |

## Next

- [Quickstart](https://zidane.si/docs/quickstart.md): Install, sign in, run a task.
- [Core concepts](https://zidane.si/docs/concepts.md): Turn loop, tools, hooks, sessions.

## Reference

- [`zidane`](https://zidane.si/docs/reference/index.md)
- [`zidane/agent`](https://zidane.si/docs/reference/agent.md)
- [`zidane/providers`](https://zidane.si/docs/reference/providers.md)
- [`zidane/presets`](https://zidane.si/docs/reference/presets.md)
