pratyaksha-context-eng-harness
Long-context discipline for Claude Code, grounded in Vedic epistemology.
Typed retrieval (Avacchedaka), conflict-resolution by sublation (bādha),
witness invariants (Sākṣī), event-boundary compaction, and a 7-class
hallucination taxonomy (Khyātivāda) — surfaced as 15 MCP tools, 3
skills, 3 agents, 4 slash commands, and 3 lifecycle hooks.
New here? Jump to QUICKSTART.md for a
30-minute hands-on tour with five challenging end-to-end examples.
Why
Long context windows do not solve long-context problems. The failure modes
that hurt agents in production are not "the window is too small" but
topic drift, stale-claim retrieval, conflicting sources,
discourse-boundary blindness, and silent confabulation. This
plugin addresses each one with a discrete, auditable mechanism:
| Failure mode | Mechanism | MCP tool(s) |
|---|
| Topic drift in retrieval | Avacchedaka-typed query | context_insert, context_retrieve |
| Stale / contradicted claims | Sublation (bādha) | sublate_with_evidence, context_sublate |
| Conflicting sources | Pairwise conflict detection | detect_conflict |
| System-prompt drift | Sākṣī (witness) invariant | set_sakshi, get_sakshi |
| Discourse-boundary blindness | Surprise-spike compaction | boundary_compact, compact |
| Silent confabulation | Khyātivāda 7-class taxonomy | classify_khyativada |
| Token-budget blindness | Local cost ledger | budget_status, budget_record |
Mechanisms compose: every retrieval is typed; every conflict is sublated
without deletion; every Manas/Buddhi turn carries the Sākṣī as a true
system message; every long phase ends with a scoped compaction.
Install
This repo ships as a Claude Code marketplace plugin. Pick one of three
paths.
A. One-line install via Claude Code (recommended)
# 0. One-time prerequisite (skip if already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh
# 1. From any Claude Code session (CLI, VS Code, Cursor, or desktop):
/plugin marketplace add SharathSPhD/pratyaksha-context-eng-harness
/plugin install pratyaksha-context-eng-harness@pratyaksha-context-eng-harness
The first MCP tool call takes ~30 s while uv downloads mcp,
pydantic, and tiktoken. Subsequent calls are instant.
B. Local clone (for development or air-gapped machines)
git clone https://github.com/SharathSPhD/pratyaksha-context-eng-harness.git ~/.claude/plugins/pratyaksha-context-eng-harness
/plugin marketplace add ~/.claude/plugins/pratyaksha-context-eng-harness
/plugin install pratyaksha-context-eng-harness@pratyaksha-context-eng-harness
C. Cursor / IDE smoke-test (MCP-only, no plugin loader)
If you only want the 15 MCP tools (no skills/agents/commands/hooks),
register the server directly. From the cloned repo root:
uv run --no-project mcp/server.py # smoke-test it boots; Ctrl-C to exit
Then point your IDE at mcp/server.py (Cursor / VS Code / any
MCP-aware client). See the Cursor smoke-test
section below for an exact ~/.cursor/mcp.json
snippet.
No claude mcp add, no virtualenv, no pip install. The plugin's
mcp/server.py is a PEP 723
self-installing script — uv reads its inline header and provisions
dependencies on first run.
Components
MCP server: pratyaksha
15 tools across 6 families:
Family | Tools
--------------------- | --------------------------------------------------
Avacchedaka store | context_insert / context_retrieve / context_get /
| context_sublate / list_qualificands
Sublation | sublate_with_evidence / detect_conflict
Compaction | compact / boundary_compact / context_window
Witness (Sākṣī) | set_sakshi / get_sakshi
Hallucination class | classify_khyativada
Budget / observability| budget_status / budget_record
All tools are exposed under the mcp__pratyaksha_mcp__* namespace.
Mutating calls are appended to a JSONL audit log at
~/.cache/pratyaksha/audit.jsonl; you can tail -f it during a
long session to watch exactly what the agent did.
Skills