Reference

Context blocks

A context block is a labelled piece of standing instructions — “we use pnpm”, “API errors look like this”, “never deploy on Fridays” — that is attached to an agent’s context by rule instead of being found by search. Memories are what your agent learned; blocks are what you want it to always know.

Blocks or memories?

  • Use a block for conventions and rules that should apply every time, especially team ones. Team blocks are team policy: only owners and admins can write them.
  • Use a memory for facts learned along the way. Memories are retrieved when relevant and can be superseded when they change.

How blocks are attached

context_assemble (and the Claude Code plugin’s session-start hook) puts blocks at the top of the bundle, ahead of memories. Blocks and the profile use at most 40% of the token budget; a block cut short is marked as truncated. Each block has an attach_mode:

ModeIncluded when
alwaysEvery bundle. The default.
globOne of the request’s paths matches the block’s globs (for example apps/api/**).
agentOnly the label and description are listed; the agent asks for the body when it needs it.
manualOnly when the request names it in blocks.

Personal blocks come first, then each team’s, in position order. A scope holds up to 100 blocks of up to 20,000 characters each.

Managing blocks

From an agent, with the MCP tools:

text
context_block_set   { label: "conventions/api-errors",
                      content: "Errors are { error: { code, message } } with an HTTP status.",
                      attach_mode: "glob", globs: ["apps/api/**"], team: "acme-eng" }
context_blocks_list { team: "acme-eng" }

Or from the dashboard’s Blocks page, over REST (PUT /api/context-blocks/:label), or with the kognite CLI:

bash
kognite blocks list
kognite blocks set conventions/api-errors --file api-errors.md --attach glob --globs "apps/api/**"
kognite blocks rm conventions/api-errors

Import your rules files

You probably already wrote these instructions for another tool. Import them, and every agent connected to Kognite gets them, in every client:

FileBecomes
AGENTS.md, CLAUDE.mdalways at the repo root; glob on its folder when nested.
.github/copilot-instructions.mdalways.
.github/instructions/*.instructions.mdapplyTo becomes the globs.
.cursor/rules/*.mdcalwaysApply → always, globs → glob, description → agent, otherwise manual.
.windsurf/rules/*.mdtrigger: always_on, glob, model_decision (agent) or manual.

Labels come from the path (agents-md, cursor/react…), and a file longer than the block limit is split into parts. From the repo root:

bash
kognite rules import --dry-run        # preview what would be created
kognite rules import                  # personal blocks
kognite rules import --team acme-eng  # team blocks (owner or admin)

Or upload or paste the files on the dashboard’s Blocks page, or call POST /api/context-blocks/import with { files: [{ path, content }] } and an optional mode (upsert, skip_existing or dry_run). Re-importing updates the same labels.