Context engineering for engineers who ship.
npx skills add johnnichev/nv-context -g -yAuto-detects your tools, commands, and linters. Finds landmines with parallel agents. Generates configs, hooks, session management, and token budgets so every AI coding agent works at maximum effectiveness.
Live experience: skills.nichevlabs.com · production case studies, the research library, and the full synthesis.
Three real codebases. Same skill. Real numbers.
| Repo | Before | After | What changed |
|---|---|---|---|
| selectools (Python SDK, 4,612 tests) | L3, 49/60 | L5–L6, 58/60 | CLAUDE.md 440 → 67 lines (-85%). Token budget cut 53%. |
| nichevlabs (multi-product SaaS, orchestrated by selectools) | L4, 17/60 | L6, 49/60 | SESSION.md 805 → 59 lines (-93%). Saved 15.8K tokens per session. 81 bugs surfaced. |
| sheriff (Python + TypeScript) | L4, 36/60 | L5, 42/60 | Incremental polish on an already-strong setup. Coverage gate added. |
Benchmark: 100% pass rate on 3 test scenarios vs 45.8% baseline (+54.2% delta).
"Most agent failures are not model failures. They are context failures." Philipp Schmid, Google DeepMind
Your AI agent is smart. But it keeps running the wrong test command, touching files it shouldn't, and forgetting your rules mid-session. You've tried writing a CLAUDE.md. Maybe you ran /init. It didn't help. Research proves why:
| Finding | Source |
|---|---|
| Auto-generated configs reduce success by 3% | ETH Zurich |
| Experienced devs are 19% slower with bad AI context | METR Study |
| 40%+ of AI project failures stem from poor context | IntuitionLabs |
| Using 40% of context window outperforms using 90% | Dex Horthy |
| A focused 300-token context beats unfocused 113K tokens | FlowHunt |
Bad context doesn't just not help. It actively hurts.
nv:context applies 200+ research sources to set up your repo correctly. In under 3 minutes:
- Interviews you about your tools, pain points, landmines, and workflow preferences
- Analyzes your codebase for non-obvious patterns, exact commands, and architectural gotchas
- Scores your setup with the Hierarchy of Leverage framework
- Generates tailored configs, only for tools you use, only content agents can't discover themselves
- Sets up hooks for deterministic enforcement (auto-format, branch protection, PostCompact re-injection)
- Creates session management: HANDOFF.md, .claudeignore, Document-and-Clear workflow
- Installs compounding engineering: your codebase gets smarter with every PR review
your-repo/
AGENTS.md # Universal: read by 25+ AI coding tools
CLAUDE.md # Claude-specific with @imports (<50 lines)
tests/CLAUDE.md # Testing scope
src/CLAUDE.md # Source scope
HANDOFF.md # Session handoff template
.claudeignore # Exclude irrelevant files from context
.claude/settings.local.json # Hooks (auto-format, branch protection, PostCompact)
.cursor/rules/*.mdc # Cursor scoped rules (if you use Cursor)
.github/copilot-instructions.md # Copilot config (if you use Copilot)
.github/workflows/
learn-from-reviews.yml # Auto-learn from PR reviews
Works with: Claude Code, Cursor, GitHub Copilot, Aider, Codeium, Continue, Windsurf, Zed, and 17 more AI coding tools via the universal AGENTS.md format.
Option 1: Skills CLI (recommended)
npx skills add johnnichev/nv-context -g -yOption 2: One-liner
mkdir -p ~/.claude/skills/nv-context && curl -o ~/.claude/skills/nv-context/SKILL.md \
https://raw.githubusercontent.com/johnnichev/nv-context/main/skills/nv-context/SKILL.mdOption 3: Clone with templates
git clone https://github.com/johnnichev/nv-context.git
mkdir -p ~/.claude/skills/nv-context
cp -r nv-context/skills/nv-context/* ~/.claude/skills/nv-context/Then open any project and run:
/nv-context
Not just L0–L6 maturity. Scores each layer independently:
Hierarchy of Leverage Score
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Verification [██████████] 10/10
CLAUDE.md quality [████████░░] 8/10
Hooks [██░░░░░░░░] 2/10 <- biggest gap
Skills [████████░░] 8/10
Subagent patterns [░░░░░░░░░░] 0/10
Session management [████████░░] 8/10
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Overall 36/60
Top recommendation: Set up hooks for auto-format
and PostCompact re-injection to reach 48/60.
Know exactly how much context you're spending before a conversation starts:
Context Budget Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
System prompt ~2,500 tokens
CLAUDE.md ~800 tokens
Skill descriptions ~400 tokens
MCP tools ~1,200 tokens
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Baseline cost ~4,900 tokens
Available for work ~123,100 (96%)
Status: HEALTHY
The #1 complaint: "my agent forgets rules mid-session." nv:context installs a hook that automatically re-injects critical context after compaction fires. Your landmines and boundaries survive context compression.
Research proves "don't use X" makes agents MORE likely to use X. nv:context scans your configs and rewrites:
BEFORE: "don't use moment.js"
AFTER: "MUST use date-fns for all date operations"
BEFORE: "avoid raw SQL queries"
AFTER: "MUST use the ORM query builder for database operations"
Tag PR reviews with @claude-learn and the learning auto-creates a PR adding it to AGENTS.md. Your context improves with every code review.
Not just root configs. Generates scoped files per directory:
CLAUDE.md # Orientation (50-100 lines)
tests/CLAUDE.md # Testing patterns, async rules
src/CLAUDE.md # Import conventions, code patterns
src/api/CLAUDE.md # API-specific patterns
Agents only load what's relevant to where they're working.
Built into every file nv:context generates:
- Less is more. Every line must earn its place.
- Landmines, not maps. Document what agents can't discover.
- Commands beat prose. Snippets over paragraphs.
- Context is finite. 150–200 instruction budget.
- Progressive disclosure. Layer context by need.
- Hooks for determinism. 100% compliance for critical rules.
- Negative instructions backfire. "MUST use Y", not "don't use X".
- Compact proactively. 60% safe, 70% degrading, 85% hallucinating.
Read the full synthesis → · 10 laws, 4 universal operations, the complete framework.
200+ external sources. 12 research logs. 471 KB of focused notes.
This isn't pop AI. Every recommendation in the skill links back to a real source: published papers, production data, experienced practitioners. Six parallel research agents synthesized 200+ sources into 12 focused logs, organized by research dimension.
Browse the full research library →
| Log | Coverage |
|---|---|
| Definitions & Theory | Karpathy, Schmid, Anthropic, academic foundations |
| Articles & Blog Posts | 36 deep-analyzed articles |
| X/Twitter Discourse | 50+ posts from 15+ thought leaders |
| YouTube & Talks | 15 videos, 11 podcasts, 5 conference talks |
| Tools & Frameworks | 50+ tools across 10 categories |
| Agent Config Patterns | 10 config formats, ETH Zurich data |
| Reddit & Forums | Practitioner war stories, anti-patterns |
| GitHub Discussions | 40+ real CLAUDE.md files, hooks, skills |
| Community Wisdom | Dev.to, HackerNews, METR study |
| Advanced Patterns | Boris Cherny's workflow, hierarchy of leverage |
| Python Patterns | MCP SDK, Pydantic AI, Python-specific patterns |
| Workflow Patterns | RPI, subagents, TDD, debugging, worktrees |
Featured sources: Anthropic, ETH Zurich, Google DeepMind, Manus, LangChain, GitHub (2,500-repo analysis), JetBrains (NeurIPS 2025), METR, Boris Cherny (Claude Code creator), Dex Horthy (12-Factor Agents).
Read the full synthesis · Or read it on GitHub
- Quickstart: 2-minute install guide
- Manifesto: the philosophy
- Hierarchy of Leverage: the framework
- FAQ: common questions
nv:context is part of the nv: skills collection:
- nv:context (this repo) · context engineering for AI agents
- nv:dev · TDD, debugging, code review workflows
- nv:ops · release workflows, incident response, observability
- nv:design · Vibe Design methodology (the skill that built skills.nichevlabs.com)
nv:context improves when practitioners share what works. Open an issue or PR with:
- Patterns that improved your agent performance
- Anti-patterns you discovered the hard way
- Research we should include
- Tool-specific configs we're missing
MIT
Built by johnnichev. For engineers who ship. Live experience: skills.nichevlabs.com