thoughtbox:knowledge-query

thoughtbox:knowledge-query is a skill for Claude Code, Codex from Kastalien-Research/thoughtbox. It costs 102 tokens per session (917 once invoked), scanned A, original, MIT.

A search process for retrieving information from Thoughtbox's connected knowledge graph, which stores related entities, observations, and findings from past sessions. It searches prior sessions and entities, follows their relationships, and combines the relevant results.

In plain words
What is it for?
Use it to recall what is already known, find related past work, check earlier decisions, and build on stored knowledge.
Why use it?
It helps recover earlier decisions and insights instead of rediscovering them. It also shows how a topic connects to related concepts and findings.

Skill for Claude CodeCodex

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 skills/kastalien-research/thoughtbox/thoughtbox-knowledge-query
Any agent
npx skills add Kastalien-Research/thoughtbox --skill thoughtbox-knowledge-query
Clone the repo
git clone --depth 1 https://github.com/Kastalien-Research/thoughtbox

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for thoughtbox:knowledge-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/kastalien-research/thoughtbox/thoughtbox-knowledge-query.svg)](https://agentmods.dev/skills/kastalien-research/thoughtbox/thoughtbox-knowledge-query)
Your own site
<a href="https://agentmods.dev/skills/kastalien-research/thoughtbox/thoughtbox-knowledge-query"><img src="https://agentmods.dev/badge/skills/kastalien-research/thoughtbox/thoughtbox-knowledge-query.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 917 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.00102 $0.00917
Opus 5 $0.00051 $0.00458
Sonnet 5 $0.00020 $0.00183
Haiku 4.5 $0.00010 $0.00092

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

Security

Grade A, and why

thoughtbox:knowledge-query 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 5d 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.

.agents/skills/thoughtbox-knowledge-query/SKILL.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Thoughtbox Knowledge Query

The knowledge graph accumulates insights across sessions. This skill retrieves and synthesizes that accumulated knowledge so you don't rediscover what's already known.

Workflow

Phase 1: Search

Cast a wide net across both sessions and the knowledge graph:

// Search sessions by keyword
async () => {
  const sessions = await tb.session.search("authentication", 10);
  return sessions;
}
// Search entities by name pattern and type
async () => {
  const entities = await tb.knowledge.listEntities({
    name_pattern: "auth",
    types: ["Concept", "Insight"],
    limit: 20
  });
  return entities;
}
// Get graph statistics for context
async () => tb.knowledge.stats()

Phase 2: Traverse

For relevant entities, explore their neighborhood in the graph:

async () => {
  return await tb.knowledge.queryGraph({
    start_entity_id: "entity-uuid-here",
    max_depth: 2,
    relation_types: ["BUILDS_ON", "DEPENDS_ON", "RELATES_TO"]
  });
}
// Returns: connected entities and relations within 2 hops

Check observations for temporal context:

async () => {
  return await tb.knowledge.getEntity("entity-uuid-here");
  // Includes observations array with timestamps and content
}

Phase 3: Retrieve Session Context (If Needed)

For deep dives, retrieve the full session that produced an insight. Use the subagent-summarize pattern to avoid context pollution:

Spawn a subagent with:
  "Retrieve and summarize Thoughtbox session [ID].
   Call: async () => tb.session.get('[ID]')
   Extract only information about [TOPIC].
   Return a 3-5 sentence summary. No raw thoughts."

This keeps the full session (~800 tokens) in the subagent's context and returns only ~80 tokens to yours. 10x context reduction.

Phase 4: Synthesize

Combine findings from entities, relations, observations, and sessions into a coherent answer:

## Knowledge Query: "[topic]"

### Entities Found
- [Concept] "entity-name" — summary from properties
  - Observation (date): "..."
  - Related to: entity-B (BUILDS_ON), entity-C (DEPENDS_ON)

### Session Context
- Session "title" (date, N thoughts): [summary from subagent]

### Gaps
- No entities found for [sub-topic] — consider creating one
- Session from [date] may be outdated — verify current state

Read the full file on GitHub · 129 lines

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. 5d ago First seen · 129 lines · 102 tokens per session scan A 39b715fb7c45

Subscribe to this mod's changes

thoughtbox:knowledge-query is a skill published in the GitHub repository Kastalien-Research/thoughtbox (64 stars, last pushed 1mo ago), licensed MIT. It adds 102 tokens to every session and 917 once invoked, about $0.0005 per session on Opus 5. 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 skills, from other repositories

forget

Delete specific observations from agentmemory after showing them and getting explicit confirmation. Use when the user says "forget this", "delete memory", "remove that note", or wants to scrub specific data for privacy.

rohitg00/agentmemory · 43 tokens

handoff

Resume the most recent agent session for the current working directory, leading with any unanswered question. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.

rohitg00/agentmemory · 55 tokens

agentmemory-hooks

The agentmemory plugin hooks that capture observations automatically across the agent session lifecycle. Use when explaining how memory gets captured without manual saves, when debugging missing observations, or when tuning what gets recorded.

rohitg00/agentmemory · 42 tokens

session-history

Show what happened in recent past sessions on this project as a clean timeline. Use when the user asks "what did we do last time", "session history", "past sessions", or wants an overview of previous work.

rohitg00/agentmemory · 47 tokens

agentmemory-agents

How agentmemory wires into host coding agents via the connect command. Use when installing agentmemory into a specific agent, when asked which agents are supported, or when a connect adapter writes the wrong config path.

rohitg00/agentmemory · 46 tokens

agentmemory-config

Skill "agentmemory-config" from rohitg00/agentmemory, covering quick start, defaults worth knowing, ports, see also and reference.

rohitg00/agentmemory · 44 tokens