Skip to main content
Glama
Infinite Code Next

Infinite Code Next

by Kawai-Senpai

record

Capture verified findings, decisions, warnings, and failed attempts as durable, code-anchored memories so future agents keep context and avoid repeating dead ends.

Instructions

Write what you learned. One call becomes many durable, anchored facts.

WHEN TO USE: after any verified finding or change - not at the end of the session, when the detail has already gone. Skip it only for purely mechanical work such as fixing a typo. AFTER THIS: nothing. This is the call that makes the next session cheaper, and the fields that pay off most are failed_attempts and warnings, because nothing else in the toolchain records what was tried and rejected.

You supply the semantics; the server resolves names to real symbols, anchors each memory to the code, derives the edges you did not mention (callers, tests, blast radius), and flags contradictions with what it already knows. Nothing you write is ever silently overwritten.

Use kind='checkpoint' at the end of a task to distil the session. When index_state is partial, unresolved references may appear in the index later. Check which references resolved before relying on a code link.

WRITE LIKE THE NEXT AGENT HAS NO CONTEXT, because it does not. Every entry should survive being read alone, months later, by someone who was not here.

Thin, nearly useless:  "settle must be idempotent"
Actually useful:       "settle() must be idempotent: a retried webhook
                        must not double-charge. We learned this from
                        the Feb duplicate-charge incident, where the
                        payment provider retried after a 502 that had
                        already succeeded. The guard is the
                        idempotency_key column, unique per invoice."

The second one costs you a few extra seconds now and saves the next agent an afternoon. State the failure it prevents, the evidence it rests on, and the mechanism that enforces it - not just the rule.

Args: summary: what happened, in one full sentence. Required. kind: bug_fix | decision | refactor | investigation | checkpoint | incident | note. reasoning: why this happened and why it was done this way. Two or three sentences. This is attached to every memory the call produces, so it is the cheapest way to make all of them self-contained. files: file paths this touches. symbols: symbol names this touches, e.g. RefreshCoordinator.acquire. changes: what actually changed. invariants: things that must remain true, and what breaks if they are not. "X must hold, because otherwise Y" beats "X must hold". warnings: things a future agent must not do, and the symptom it causes. A warning nobody can recognise in the wild will not be heeded. failed_attempts: what was tried, why it was rejected, and how the failure showed itself. This is the highest-value field in the system - nothing else in your toolchain records it, and it is what stops the next agent spending a day on a dead end you already walked down. decisions: choices made and the alternatives rejected. contracts: assumptions other code or repos rely on. performance: performance-relevant facts. security: security-relevant facts. conventions: local conventions worth following. rationale: why the code is shaped the way it is. bugs: bugs this code has caused before. migrations: migration steps or ordering constraints. tests: tests that cover this. contracts_with: cross-repository dependencies, as [{"repo": "acme/billing", "entity": "charge_customer", "kind": "CONSUMES_CONTRACT"}]. kind is one of PROVIDES_CONTRACT, CONSUMES_CONTRACT, MIRRORS, RELATED_TO. The other repository does not need to be indexed, or even present, for this to be recorded. caused_by: memory ids this event follows from, building the causal chain an agent sees as "why does this code exist": decision -> bug -> failed fix -> accepted fix -> invariant -> test. Pass ids, or [{"memory": "mem_x", "kind": "CAUSED"}] where kind is CAUSED, LED_TO, ESTABLISHED, REFINES or DEPENDS_ON. evidence: proof that what this records actually happened. Either experiment run ids (from experiment()), whose commit, command, exit code and metrics are written into every memory, or recorded runs (from graph(action='run'), named by their folder such as '20260917-160603-perms'), whose command, exit code, timing and hottest functions are written in the same way, with the path of the full report. The claim then carries its proof instead of asking to be believed. authority: 'agent' or 'human'. Human memories cannot be rewritten by an agent. root: repository path. Defaults to the server's working directory.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "summary": "<summary>"
    },
    "name": "record"
  }
}

Input Schema

NameRequiredDescriptionDefault
bugsNo
kindNonote
rootNo
filesNo
testsNo
changesNo
summaryYes
symbolsNo
evidenceNo
securityNo
warningsNo
authorityNoagent
caused_byNo
contractsNo
decisionsNo
rationaleNo
reasoningNo
invariantsNo
migrationsNo
conventionsNo
performanceNo
contracts_withNo
failed_attemptsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full load and does well: it discloses that the server resolves names to real symbols, derives unmentioned edges ("callers, tests, blast radius"), flags contradictions, and that "Nothing you write is ever silently overwritten," plus the human-vs-agent authority rule and the partial index_state caveat. Gaps remain on failure behavior and on how an incorrect memory is corrected or superseded, so a follow-up record is the only implied remedy.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with purpose then WHEN TO USE, and most length is earned by 23 parameters. But the 'Thin, nearly useless' / 'Actually useful' worked example and coaching asides ("costs you a few extra seconds now") are style guidance rather than definitional content and could be trimmed without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be explained, and the description covers invocation timing, evidence sourcing, authority semantics, and every parameter. The remaining gap is operational: no statement of what happens when the call fails validation or how to amend an already-written memory, which matters for a 23-param write tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 23 parameters, and the description compensates for essentially all of them: it defines each field's intent, gives the closed enum for kind, restricts caused_by to ids or a {memory, kind} shape, specifies contracts_with's object shape and allowed edge kinds, and documents defaults (root defaults to the server working directory; authority is 'agent' or 'human').

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Write what you learned. One call becomes many durable, anchored facts" names a specific verb and resource, and the body clarifies what those facts are ("anchors each memory to the code"). It also distinguishes itself from siblings by naming the competing paths (experiment(), graph(action='run')) and asserting "nothing else in the toolchain records what was tried and rejected."

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

An explicit WHEN TO USE block says to record immediately after any verified finding or change rather than at session end, and names the concrete exclusion: "Skip it only for purely mechanical work such as fixing a typo." It also routes the agent on the two evidence sources (experiment() run ids vs. graph(action='run') folders) and marks kind='checkpoint' for end-of-task distillation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.