Skip to content
Agent Gateway
Features

Sessions

Every coding session, captured. Inspect tokens, costs, and compression for each agent run.

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.

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.

Use Filters to narrow the list by API key, team member, coding agent, or squad. Multiple squads include usage from any selected squad; other filter categories narrow that selection further.

Squad filtering uses the squad recorded when requests were made, not current membership. Listed totals include only usage attributed to selected squads. Squad attribution starts when this feature is enabled; older usage remains visible without a squad filter but is not backfilled. Period filtering uses the first and last activity of each aggregate, rather than exact request timestamps. Opening a session shows its full details, not the list's squad-scoped totals.

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.

Session page

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

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 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.

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.

ToolWhat it does
setSessionNameSet a human-readable name (defaults to "Untitled Session")
setSessionGitRepoLink 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.
addSessionPullRequestAttach a PR URL or #number to the session
addSessionCommitAttach 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:

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.

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