Quick Start
Start the AGH daemon, create a real session for the current repository, follow live events, stop it, and resume it.
- Audience
- Operators running durable agent work
- Focus
- Getting Started guidance shaped for scanability, day-two clarity, and operator context.
This tutorial takes you from a bootstrapped AGH install to one durable session you can inspect, stop, and resume. It is intentionally repository-aware: you will create the session from the project you actually want AGH to manage.
Before you begin: Complete Installation, export
your provider API key in the current shell, and cd into a repository you want the session to use.
1. Start the daemon
agh daemon startIf you want to watch the daemon logs in the current terminal instead of detaching, use:
agh daemon start --foregroundVerify that the daemon is available:
agh daemon status2. Register the current repository as a workspace
AGH can use the current directory directly, but registering the workspace gives you a stable name you can reuse in later commands.
agh workspace add "$PWD" --name currentConfirm the registration:
agh workspace info current3. Create your first session
Create a session for the workspace you just registered:
agh session new --workspace current --agent general --name first-runIf you prefer not to register a workspace first, use:
agh session new --cwd "$PWD" --agent generalThe key point is explicit workspace context. That keeps the first session tied to the repository you expect, instead of relying on an implicit working directory.
4. Find the session ID
List sessions and note the ID:
agh session listFor scripts or copy-paste into later commands, JSON is often easier:
agh session list -o jsonThe examples below use sess_1234 as a placeholder for your real session ID.
5. Send a repository-aware prompt
Use a prompt that makes the workspace matter:
agh session prompt sess_1234 "Summarize the top-level structure of this repository and tell me what I should read first."AGH records the prompt, the agent response, tool calls, permission decisions, and usage events in the per-session event store.
6. Follow the live event stream
agh session events sess_1234 --followThis is the fastest way to see what AGH means by a durable session: every important step appears as an event instead of disappearing into one terminal transcript.
When you are done following, press Ctrl+C.
7. Stop the session
agh session stop sess_1234The session keeps its history in ~/.agh/sessions/sess_1234/events.db. Stopping ends live work; it
does not delete the durable record.
8. Resume the same session
agh session resume sess_1234Then inspect the stored history:
agh session history sess_1234This is the core AGH promise in one loop: the session is durable, inspectable, and resumable.
What You Just Proved
You verified that AGH can:
- run a local daemon
- attach work to one explicit repository
- persist session events durably
- stop live work without losing history
- resume the same session later
Next Steps
- Your First Custom Agent shows how to add a
workspace-scoped
AGENT.md. - Web UI shows how to inspect the same daemon state in the browser.
- Session Lifecycle explains what AGH is storing and why.