t1k:context
| Field | Value |
|---|---|
| Module | t1k-base |
| Version | 5.15.36 |
| Effort | medium |
| Tools | — |
Keywords: agent-context, context-window, degradation, injection, optimize, tokens
How to invoke
Section titled “How to invoke”/t1k:context[topic or question]T1K Context Engineering
Section titled “T1K Context Engineering”Context engineering curates the smallest high-signal token set for LLM tasks. The goal: maximize reasoning quality while minimizing token usage across all T1K workflows.
When to Activate
Section titled “When to Activate”- Designing/debugging T1K agent systems (cook, fix, debug, test, review)
- Context limits constrain subagent performance
- Optimizing cost/latency in multi-agent pipelines
- Building module-scoped context injection
- Implementing agent memory and cross-session persistence
Core Principles
Section titled “Core Principles”- Context quality > quantity — High-signal tokens beat exhaustive content
- Attention is finite — U-shaped curve favors beginning/end positions
- Progressive disclosure — Load information just-in-time (sessionBaseline → keyword match → references)
- Isolation prevents degradation — Partition work across subagents
- Measure before optimizing — Know your baseline
IMPORTANT: Sacrifice grammar for concision. Pass these rules to subagents.
Quick Reference
Section titled “Quick Reference”| Topic | Reference |
|---|---|
| Measure (start here) | token-audit.md (./references/token-audit.md) |
| Fundamentals | context-fundamentals.md (./references/context-fundamentals.md) |
| Degradation | context-degradation.md (./references/context-degradation.md) |
| Optimization | context-optimization.md (./references/context-optimization.md) |
| Compression | context-compression.md (./references/context-compression.md) |
| Memory | memory-systems.md (./references/memory-systems.md) |
| Multi-Agent | multi-agent-patterns.md (./references/multi-agent-patterns.md) |
| Evaluation | evaluation.md (./references/evaluation.md) |
| Tool/Skill Design | tool-design.md (./references/tool-design.md) |
| Pipelines | project-development.md (./references/project-development.md) |
| Runtime Awareness | runtime-awareness.md (./references/runtime-awareness.md) |
| T1K Patterns | t1k-patterns.md (./references/t1k-patterns.md) |
Measure First — Principle 5 Has a Runner
Section titled “Measure First — Principle 5 Has a Runner”bun .claude/scripts/t1k-token-audit.cjs --days 7 --textEmits facts from the session transcripts: Claude-quota vs routed-provider split,
mean context carried per request, cache read:write ratio, boot cost, and
mid-session cache busts. Establish this baseline before optimizing anything —
and before trusting a routing percentage, which counts spawns, not tokens, and
excludes the main session entirely. Reading the output: token-audit.md (./references/token-audit.md).
Key Metrics
Section titled “Key Metrics”- Token utilization: warning 70%, optimize 80%
- Multi-agent cost: ~15x single agent baseline
- Compaction target: 50–70% reduction, <5% quality loss
- Cache hit target: 70%+ for stable workloads
- Anthropic context/request: < 120K (above ~300K, read volume dominates the bill)
Four-Bucket Strategy
Section titled “Four-Bucket Strategy”- Write — Save context externally (scratchpads, files,
plans/) - Select — Pull only relevant context (module scoping, skill activation)
- Compress — Reduce tokens while preserving info
- Isolate — Split across subagents (context partitioning)
Runtime Awareness
Section titled “Runtime Awareness”T1K hooks auto-inject usage awareness via PostToolUse. Thresholds: 70% WARNING, 90% CRITICAL.
See runtime-awareness.md (./references/runtime-awareness.md) for configuration details.
Anti-Patterns
Section titled “Anti-Patterns”- Exhaustive context over curated context
- Critical info in middle positions
- No compaction triggers before limits
- Single agent for parallelizable tasks
- Injecting all installed module skills into every subagent
- Duplicating hook logic in AI responses
Security
Section titled “Security”- Never include secrets, tokens, or credentials in context passed to subagents
- Scope injected context to the minimum needed for the task
- Do not log or persist sensitive tool outputs in
plans/or memory files - Follow
rules/security.mdfor all context-handling operations