context forge
Reduce token usage and prevent context overflow through bounded search, quiet tool output, and targeted verification.
$1.50
Works with the AI Agents you already use
context forge
Example session with this skill installed
I need to fix the auth timeout in the API, but this repo is huge. Use Context Forge to find the leak and fix it without blowing the context window.
- Read your context and instructions
- Compiled the context forge
I have initiated a bounded search to locate the auth timeout logic while minimizing token usage.
Search and Verification Summary
| Phase | Tool/Command | Result | Tokens Saved (Est) |
|---|---|---|---|
| Anchor | rg -l "session_timeout" | Found src/auth/session.py | 15k (skipped full tree) |
| Locate | sed -n '40,60p' | Identified hardcoded 300s limit | 8k (selective read) |
| Change | git diff | Updated to env.SESSION_TTL | N/A |
| Verify | pytest tests/auth/test_session.py | 1 pass, 0 fail (exit 0) | 22k (quiet mode) |
Implementation Details
# src/auth/session.py
def get_session_duration():
# Context Forge: Replaced hardcoded integer with env lookup
# to resolve the reported timeout issue in production.
return int(os.getenv("SESSION_TTL", 3600))
Next steps
- Review the diff in
src/auth/session.pyto ensure the environment variable fallback is acceptable. - Run the specific test file again if you need to see the full trace of the passing session.
- Archive the current session log to
references/handoffs.mdif further auth work is required.
Connects securely to your tools. The creator never sees your data.
About this skill
Token bloat kills agent performance and increases latency. Context Forge implements a strict evidence-based loop to solve the problem of agents reading too much code and hitting context limits. It forces the agent to identify the smallest possible set of files, symbols, and logs required to resolve a task, keeping the session lean and the token count low.
What it does
- Bounded evidence loops minimizes reads by starting with symptoms and expanding only when necessary.
- Selective verification prioritizes narrow test selectors over full suite runs to save context.
- Smart tool output intercepts noisy logs and commands to extract only the exit status and relevant error excerpts.
- Context compaction manages long-form sessions by distilling history into high-density handoffs.
- Contract-first editing ensures changes respect existing boundaries to prevent regression without massive refactoring.
How it works
- Anchor the task by identifying a single entry point like a failing test or specific symbol.
- Locate targets using scoped searches and definition lookups before reading file bodies.
- Change the code using the smallest complete diff while maintaining adjacent contracts.
- Verify outcomes using quiet modes or output capture scripts to confirm the fix with minimal noise.
- Close by reporting the verified outcome and surfacing only material limitations.
Frameworks & tools
This skill is framework-agnostic and works with any codebase. It includes patterns for ripgrep, grep, and a capture.py script for handling noisy terminal output.
Why this beats prompting it yourself
Most agents default to reading entire files and running full test suites, which quickly exhausts context windows. Context Forge provides a structured logic for bounded exploration that agents cannot maintain through simple instructions alone.
Use cases
- Debugging large repositories where grep returns too many matches.
- Fixing specific bugs in long-running chat sessions near the token limit.
- Performing targeted refactors without triggering unnecessary file reads.
- Managing handoffs between different agents or session restarts.
Known limitations
Requires a functional terminal environment for search and capture scripts. Effectiveness scales with the granularity of the project's test suite.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Requires local shell access for grep/ripgrep. Works best on repositories with modular structures and granular test suites. Not a replacement for a language server.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 10 days ago
- Software
Git