---
title: "Session context"
description: "What every session starts with, how work resumes, and how the context budget is kept."
canonical_url: "https://razcue-agent-kit.vercel.app/en/concepts/session-context"
---
# Session context

> What every session starts with, how work resumes, and how the context budget is kept.

The `SessionStart` hook injects, in about 1.3k tokens:

- the profile — voice for your technical level, reply language, git flow, method, stack;
- the lanes and one line about the living specs (capabilities and requirement counts) and the QA setup;
- **Resume** — where the last session stopped (branch, uncommitted files) and each active work item with its next task;
- the knowledge index (one line per entry) and the script index.

Claude Code caps hook context at 10,000 characters, so the hook renders under 9,500: when needed it collapses global knowledge groups, then the scripts list, then project groups, and clips summaries to 160 characters.

## Resume

A `Stop` hook writes `.agent-kit/checkpoint.json` after every turn. Keep `status` and the next open task of work files accurate — a new session picks them up automatically.

## Budget

`agent-kit context` measures what loads every session: the `CLAUDE.md` / `AGENTS.md` chain, skill listings, the session context, and skills Claude Code can't see. `--sections` ranks every heading by tokens. `agent-kit doctor` fails above `contextBudget` (default 8000 tokens). The [adopt guide](https://razcue-agent-kit.vercel.app/en/guides/adopt-existing-project) shows how to shrink a big `AGENTS.md`.

## Debugging hooks

Start Claude Code with `AGENT_KIT_HOOK_LOG=/tmp/agent-kit-hooks.log`: every agent-kit hook appends one line when it runs.


## Sitemap

See the full [sitemap](https://razcue-agent-kit.vercel.app/sitemap.md) for all pages.
