> ## Documentation Index
> Fetch the complete documentation index at: https://www.edgee.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sessions

> Every coding session, captured. Inspect tokens, costs, and compression — and share the report with one link.

A **session** is one run of your coding agent through Edgee. Sessions are the per-run unit of Edgee's **Observability** feature: every request, every compression event, every cost delta, all attached to a single ID.

Every time you `edgee launch claude`, `edgee launch codex`, or `edgee launch opencode`, the CLI assigns a unique session ID and captures every request that flows through the gateway during that run. When the session ends, you get a link to a detailed report.

![Session detail with savings, model usage, and request ledger.](https://mintcdn.com/edgee/ZJH-mHY-14RdSp8t/images/console/session.png?fit=max\&auto=format\&n=ZJH-mHY-14RdSp8t\&q=85\&s=c9744a880d379ba63d5d081ec8ef44d4)

Local demonstration with fictional members and illustrative usage data.

## Open and investigate a session

1. Open **Sessions**, choose a period, and find the agent run.
2. Open the session and review requests, duration, token volume, and cost.
3. Compare the model breakdown with the requested model; routing can change which model serves a request.
4. Inspect a request in the ledger, or use **Logs** to investigate its error and routing details.

![Sessions list for the demonstration organization.](https://mintcdn.com/edgee/ZJH-mHY-14RdSp8t/images/console/sessions.png?fit=max\&auto=format\&n=ZJH-mHY-14RdSp8t\&q=85\&s=eebac1f773541c1933224a361a59c403)

Local demonstration with fictional members and illustrative usage data.

## What's tracked

Each session records:

* **Tokens** — input, output, total, with per-model breakdown
* **Cost** — dollar cost computed from real-time provider pricing
* **Compression** — tokens saved, % reduction, and savings broken down by tool
* **Requests** — count, errors, average response time, request cadence over time
* **Duration** — first to last request
* **Models used** — distribution across Claude, GPT, etc.

## Two views: private and public

Every session has two URLs.

### Private view (org)

`/~/<org-slug>/sessions/<session-id>` — visible only to authenticated members of your organization.
This is the full view: editable session name, GitHub repo / PRs / commits, request-level logs, error breakdown,
CLI version, request cadence sparkline.

### Public view

`/sessions/<session-id>` — anyone with the URL can view.

The public page shows:

* Your name and avatar (from the API key's owner)
* Total requests, tokens, cost, duration
* Models used and compression savings
* Per-tool compression breakdown

It does **not** show: session name, GitHub metadata, PR / commit links, individual request payloads, or error details.

> [!WARNING]
>
> Sharing a session URL exposes your name, avatar, total cost, tokens, and model usage to anyone who opens the link.
> Don't share it if any of these are sensitive. The URL is unguessable but unauthenticated — treat it like a public Gist.

## Sharing

From the session page in the console, click **Share** to:

* **Copy public link** to the public URL
* **Share on X / LinkedIn** with a pre-filled card
* **Open public page** to review what anyone with the link will see before sharing it

Public sessions are also eligible for the [leaderboard](https://www.edgee.ai/leaderboard) — top sessions by
compression savings, tokens, or cost over the last day, week, or month.

![Session Share menu with public link and preview actions.](https://mintcdn.com/edgee/ZJH-mHY-14RdSp8t/images/console/session-share.png?fit=max\&auto=format\&n=ZJH-mHY-14RdSp8t\&q=85\&s=71c9e2381fdac67c03e486f0a877b945)

Local demonstration with fictional data.

## Linking sessions to GitHub

Sessions can be tied to the actual code work they produced — the repository, the pull requests opened or edited,
and the commits made. Once linked, the session report shows clickable links to GitHub right next to the token
and cost stats.

### Prerequisite: install the Edgee GitHub App

GitHub repository linking only works for repos your organization has connected via the **Edgee GitHub App**. Without the
App, calls to `setSessionGitRepo` naming a GitHub repo are silently ignored (the API returns `ignored`) and no repo appears on the
session page. Repositories on other hosts — GitLab, Bitbucket, Azure DevOps — are stored as-is and need no App.

To install:

1. Go to **Integrations → GitHub** in the Edgee Console
2. Click **Install GitHub App** and select the org and repos you want to link
3. Approve on GitHub

Repos selected during install become eligible. You can update the selection from GitHub's App settings later.

### What gets shown

Once a session has GitHub metadata attached, the private session page displays:

* **Repo** — `owner/repo`, linked to GitHub
* **Pull requests** — every PR URL or `#number` attached during the session, clickable
* **Commits** — every commit SHA or commit URL, clickable

This makes the session a self-contained record of "what the agent did" — code-level changes alongside
token / cost / compression metrics.

For an organization-wide rollup of repo and PR activity across every team member's sessions, see
[Connect GitHub](https://www.edgee.ai/docs/features/integrations/github.md).

### How metadata gets attached

The agent attaches GitHub metadata itself: Claude Code or Codex calls the MCP tools below during the session.
The MCP tools are documented in the next section.

## Enriching sessions with MCP tools

When you run Claude Code or Codex through Edgee, the agent has access to four MCP tools that attach metadata to
the running session.

| Tool | What it does |
| - | - |
| `setSessionName` | Set a human-readable name (defaults to "Untitled Session") |
| `setSessionGitRepo` | Link the session to a git repo. Accepts `owner/repo`, a full URL, or an SSH URL; the host (GitHub, GitLab, Bitbucket, Azure DevOps) is detected from the identifier. GitHub repos require the Edgee GitHub App — otherwise silently ignored. |
| `addSessionPullRequest` | Attach a PR URL or `#number` to the session |
| `addSessionCommit` | Attach a commit SHA or commit URL to the session. Requires the session to have a repo set first — otherwise silently ignored. |

All four require the session ID, which the CLI exposes to the agent automatically.

### Example: agent self-tags its work

In a `CLAUDE.md` or system prompt, you can instruct the agent:

```md theme={"dark"}
At the start of the session, call setSessionName with a 3-6 word summary of the task.
After every commit, call addSessionCommit with the commit SHA.
After creating or editing a PR, call addSessionPullRequest with the PR URL.
```

The session report will then show the task name, the linked repo, every commit made during the session, and any PRs touched —
without you typing anything in the console.

> [!NOTE]
>
> `addSessionPullRequest` and `addSessionCommit` are append-only and de-duped. Calling them multiple times with the
> same value is safe.

## Finding past sessions

* **CLI** — `edgee stats` lists your most recent sessions
* **Console** — `/~/<org-slug>/sessions` shows the full list with filtering and search
* **End-of-run link** — every `edgee launch` prints the session URL when the agent exits

## Next steps

* [Edgee CLI](https://www.edgee.ai/docs/features/cli.md) — launch agents and start a session
* [Observability](https://www.edgee.ai/docs/features/observability.md) — aggregate metrics across all sessions
* [Team management](https://www.edgee.ai/docs/features/team.md) — see sessions across your whole team


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.