context-anchoring

context-anchoring is a skill for Claude Code from techygarg/lattice. It costs 147 tokens per session (2,661 once invoked), scanned A, original, MIT.

A system of per-feature documents that records decisions, constraints, and reasoning throughout design, implementation, bug fixing, and refactoring.

In plain words
What is it for?
Use it to create or update a living record for a feature as it moves from design through implementation and later changes.
Why use it?
It preserves the context that can otherwise disappear between coding sessions, reducing contradictory decisions and forgotten requirements.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the lattice plugin — 33 skills, 1 agent shipped together

Good fit Use it to create or update a living record for a feature as it moves from design through implementation and later changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/techygarg/lattice/context-anchoring
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add techygarg/lattice --skill context-anchoring
Clone the repo
git clone --depth 1 https://github.com/techygarg/lattice

Made for: Claude Code.

Or install lattice, the plugin that ships this one along with the rest of its 33 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-anchoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/techygarg/lattice/context-anchoring/github.svg)](https://agentmods.dev/skills/techygarg/lattice/context-anchoring)
Your own site
<a href="https://agentmods.dev/skills/techygarg/lattice/context-anchoring"><img src="https://agentmods.dev/badge/skills/techygarg/lattice/context-anchoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-anchoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/techygarg/lattice/context-anchoring"><img src="https://agentmods.dev/badge/skills/techygarg/lattice/context-anchoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 147 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 133
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • low Excessive Agency · line 165
    Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.
    Fix: Limit the skill's scope to its documented purpose. Remove instructions that enable the agent to perform actions outside its stated functionality.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00147 $0.02661
Opus 5.5 $0.00059 $0.01064
Sonnet 5.5 $0.00029 $0.00532
Haiku 4.5 $0.00015 $0.00266

Measured 11d ago against content hash ec0ed1b0a938, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

context-anchoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/context-anchoring/SKILL.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context Anchoring

Scope

Feature-level only — anchors decisions as a feature flows from design → implementation → bugfix → refactor.

Config Resolution

This skill manages a directory of per-feature context docs. Resolution order:

  1. Read .lattice/config.yaml in the repo root.
  2. If found and paths.context_base is set → use that directory as the context base (the Create behavior creates it on demand).
  3. If there is no config file or no paths.context_base key → use the default .lattice/context/.

Each feature gets one doc at <context_base>/<feature-name>.md. No default principles, no overlay modes, no override files -- just a thin template and per-feature docs that grow through enrichment.

Why Context Anchors Exist

AI has no persistent memory across sessions. Early decisions get contradicted, naming drifts, and the "why" evaporates -- a forgotten decision becomes a potential contradiction, a lost constraint becomes a violation, an unresolved question becomes a silent assumption.

Context anchor docs prevent this by being:

  • Feature-bound -- one doc per feature, scoped decisions only
  • Decision-focused -- capture what, why, and what-else-was-considered for every choice
  • Append-only -- decisions are never removed or rewritten, only added chronologically
  • Session-spanning -- the doc outlives the conversation and carries context forward
  • Git-native -- lives in the repo, versioned alongside code

Two documents per feature: the requirement doc (static, written upfront, not managed by this skill) defines what to build; the context anchor doc (living, evolving, managed by this skill) captures how and why -- decisions, constraints, reasoning that emerge during development.

The requirement doc may live in this repo or in whatever system the team already tracks requirements in (Jira, Linear, a wiki) -- this atom never writes to it regardless of where it lives.

Document Lifecycle

Three behaviors govern the context anchor doc's lifecycle. Each is triggered reactively (user asks) or proactively (AI suggests). In both cases, the AI always confirms before acting -- propose, user disposes.

Read the full file on GitHub · 166 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago Changed ec0ed1b0a938
  2. 3mo ago First seen · 166 lines · 147 tokens per session scan A df2187d3c96b

Subscribe to this mod's changes

context-anchoring is a skill published in the GitHub repository techygarg/lattice (219 stars, last pushed 12d ago), licensed MIT. It adds 147 tokens to every session and 2,661 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

context-anchoring compared with skills from other repositories

context-anchoring next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context-anchoringtechygarg/latticeSkill21912d agoMITA147Claude Code
learn-from-fixoliver-kriska/claude-elixir-phoenixSkill5804d agoMITA46Claude Code
recalloliver-kriska/claude-elixir-phoenixSkill5804d agoMITA64Claude Code
assigns-auditoliver-kriska/claude-elixir-phoenixSkill5804d agoMITA47Claude Code
compound-docsoliver-kriska/claude-elixir-phoenixSkill5804d agoMITA38Claude Code
name-your-businesstamdogood/builder-essential-skillsSkill2297d agoMITA156Codex
top-one-percenttamdogood/builder-essential-skillsSkill2297d agoMITA111Codex