By SharathSPhD
Long-context discipline for Claude Code: Avacchedaka-typed retrieval, sublation, witness-consciousness invariants, event-boundary compaction, and Khyātivāda hallucination classification. 15 MCP tools, 3 skills, 3 agents, 4 commands, 3 hooks.
Show local token budget gauge plus recent cost ledger entries (per-model totals, last N calls). Optionally reset the gauge.
Force a boundary-triggered compaction on the recent conversation window with optional scope (qualificand, task_context) and z-score threshold.
Show current state of the Pratyakṣa context store — qualificand surface, per-bucket counts, mean precisions, witness invariant token count, and recent ledger spend.
Manually sublate (bādha) one element by another, or sublate with new evidence. Refuses if newer precision does not strictly exceed older.
Slow/deliberate verifier subagent. Ratifies or rejects a Manas draft by fresh tool calls, sublates contradicted store elements, inserts new evidence with calibrated precision, and produces the final user-facing answer. Use when `manas` returns `needs_buddhi: true`, when the user asks for citations or certainty, or when a previously-unverified draft is about to drive a side-effecting action.
Fast/intuitive draft subagent. Produces a first-pass answer cheaply using only the typed context store and the witness invariant. Use when the user asks a question that can plausibly be answered from existing knowledge, before paying the cost of full verification with `buddhi`.
Witness-invariants enforcer. Owns the session Sākṣī. Use at session start to derive the witness invariant from the workspace `CLAUDE.md` and the user's first turn, whenever the user declares a new hard project rule, whenever an active hypothesis or contract enters scope, and as a periodic audit during long sessions to confirm the invariant has not silently drifted.
Use at session start to capture the session-stable invariant (Sākṣī) — user identity, project hard rules, the active hypothesis or contract under test — and ensure it is pushed as a real Claude `system` message at every model call. Use whenever the user changes the project, switches contexts, or states a new hard constraint that must persist across all subsequent reasoning.
Discipline for long-context Claude Code sessions. Use when the working session crosses ~30k tokens, when the agent is about to consume retrieval results, when a tool produces multi-file output that may contain stale claims, or when the user asks for "what do we know about X right now" — anywhere implicit context drift would silently corrupt subsequent reasoning.
Use when the agent encounters two retrieved claims that contradict each other, when fresh tool output disagrees with a previously-stored claim, when the user corrects an earlier statement, or when `detect_conflict` flags a pair. Resolves the conflict via sublation (precision-weighted overwrite with audit trail) instead of silent deletion or arbitrary tie-breaking.
Admin access level
Server config contains admin-level keywords
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
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.
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.
This repo ships as a Claude Code marketplace plugin. Pick one of three paths.
# 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.
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
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.
pratyaksha15 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.
npx claudepluginhub sharathsphd/pratyaksha-context-eng-harness --plugin pratyaksha-context-eng-harnessMonitor and steer multi-agent Claude Code trajectories using dynamical systems theory. Computes finite-time Lyapunov exponents (FTLE) over semantic embedding sequences to classify regime (CONVERGING / CYCLING / EXPLORING / DIVERGING / STUCK / OSCILLATING / PLATEAU) and prescribe interventions before a task derails.
TRIZ 40 Inventive Principles engine for systematic contradiction resolution, ARIZ-85C analysis, and benchmark arena
Pratyabhijna x Active Inference creative-cognition engine v0.4 (mechanism study). Builds on v0.3's clean Haiku CLI substrate (no API key) and event-gated, always-shadow-revision cascade. v0.4 makes cit_temperature causal via best-of-K candidate width, makes the free-energy budget a hard gate inside run_cascade (HaikuRateLimitError on 429), adds a pluggable commit-policy stack (always_draft / always_revise / event_gated / learned_gate / oracle) so Experiments A/B/C from the v0.3 adversarial review run on a single cascade pass, and re-enables a stratified Sonnet LLM-judge bridge for construct validity (32-item subset, $5 cap, frozen prompt sha). Ships 19 MCP tools (18 v0.3 + judge_pair), 5 skills, 5 agents, 5 slash commands, and 3 lifecycle hooks.
Closed-loop autonomous AEO/LLM-SEO citation engineering. Audits your site, drafts the fix as a PR, measures the lift after merge. Powered by the Claude Code subscription CLI — no API keys.
Harness-native ECC operator layer - 67 agents, 271 skills, 92 legacy command shims, reusable hooks, rules, selective install profiles, and production-ready workflows for Claude Code, Codex, OpenCode, Cursor, and related agent harnesses
Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review
Comprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
A growing collection of Claude-compatible academic workflow bundles. Covers scientific figures, manuscript writing and polishing, reviewer assessment, citation retrieval, data availability, paper reading, literature search, response letters, paper-to-PPTX conversion, and evidence-grounded Chinese invention patent drafting. Rules are organized as reusable skill folders with explicit workflows and quality checks.
Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques