error-handling

A quick reference for recovering from errors while using Post-Cortex, a system for searching and managing conversation knowledge. It lists common causes, retry timing, and fallback searches when a session, workspace, or query fails.

In plain words
What is it for?
Use it to retry temporary connection or timeout errors, find valid sessions and workspaces, and broaden searches from a session to a workspace or the whole system.
Why use it?
It gives a clear next action when an identifier is invalid, a search times out, or no results are found. This avoids stopping after the first failed search or retrying blindly.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/julymetodiev/post-cortex/error-handling
Clone the repo
git clone --depth 1 https://github.com/julymetodiev/post-cortex
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 253 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00253
Opus 5 $0.00000 $0.00127
Sonnet 5 $0.00000 $0.00051
Haiku 4.5 $0.00000 $0.00025

Measured 2d ago against content hash 268f8a5c93fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

error-handling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

crates/post-cortex-daemon/src/bin/templates/agents/error-handling.md · 37 lines

What it actually says

Error Handling

Quick reference for Post-Cortex error recovery.

Common Errors

Error Cause Recovery
Session not found Invalid session_id session(action="list") → select valid
Workspace not found Invalid workspace_id manage_workspace(action="list") → select valid
Search timeout Query too broad Reduce limit, narrow query
No results No matches Broaden query, try global scope

Retry Strategy

For transient errors (timeout, connection):

  1. Wait 0.5s
  2. Retry up to 3 times
  3. Double wait time each retry

Fallback Patterns

Search Fallback (session → workspace → global)

1. Try semantic_search with scope="session"
2. If no results → try scope="workspace"
3. If no results → try scope="global"
4. If still nothing → try query_conversation_context with keyword

Session Fallback

1. Try to use session_id from CLAUDE.md
2. If not found → session(action="list") to find alternatives
3. If no sessions → session(action="create")
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 37 lines · 0 tokens per session scan A 268f8a5c93fb

Subscribe to this mod's changes

error-handling is an agent published in the GitHub repository julymetodiev/post-cortex (20 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 253 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

code-mapper

Maps a codebase using team-based deep analysis with priority-driven agent assignments. Use after initial project setup, when pending-analysis memories appear, or periodically to refresh the knowledge graph.

cogniplex/codemem · 39 tokens

architecture-reviewer

Wave 3 agent: analyzes module boundaries, dependency patterns, and layering decisions across the entire codebase. Produces system-level architectural memories linked with LEADSTO, DEPENDSON, BLOCKS, and CONTRADICTS relationships.

cogniplex/codemem · 51 tokens

baseline-scanner

Wave 1 agent: creates baseline context memories for batches of source files and packages. Produces 1 memory per file + 1 per package, linked with PARTOF edges.

cogniplex/codemem · 40 tokens

symbol-analyst

Wave 2 agent: performs deep analysis of critical and important symbols. Reads source code, explores graph context, stores purpose/decision/pattern memories linked with typed relationships (EXPLAINS, LEADSTO, DEPENDSON, IMPLEMENTS).

cogniplex/codemem · 54 tokens

api-mapper

Wave 2 agent: documents API endpoints in a module or router group. Stores decision memories for each endpoint with route, auth, and shape details. Links endpoints with DEPENDSON, LEADSTO, and PARTOF relationships.

cogniplex/codemem · 50 tokens

pattern-hunter

Wave 2 agent: discovers cross-file patterns within Louvain clusters. Identifies naming conventions, shared structures, and recurring approaches. Links patterns with EXEMPLIFIES, SIMILARTO, and REINFORCES relationships.

cogniplex/codemem · 49 tokens