Using AgentsView Session-History Search¶
A practical guide to the built-in AgentsView integration — letting read-only subagents search prior session history to leverage proven approaches and cross-verify current handling against precedent.
What This Integration Is¶
Agent Flow ships a built-in MCP integration for the agentsview CLI that lets Riko, Senku, and Lawliet search your prior Claude Code (and other supported agent) session history.
- Riko searches prior related sessions during exploration to surface how similar work was handled before.
- Senku leverages proven past approaches when designing an implementation plan.
- Lawliet cross-verifies current handling against precedent found in earlier sessions.
- Loid and Alphonse are intentionally excluded — they are write/verify-only agents; session-history recall is out of scope for their responsibilities.
Unlike personal-kb, this integration is a plugin-shipped .mcp.json entry — there is no manual MCP server registration step. It only requires the agentsview CLI to be installed.
Prerequisites¶
- Install the
agentsviewCLI, v0.38 or later. - The MCP server (
agentsview mcp) reads through the local agentsview daemon, starting it automatically when needed — no separate daemon-start step is required.
If agentsview is not installed, the integration degrades gracefully (see Graceful Degradation below) — no error, no broken startup.
How It Works¶
.mcp.jsonregisters anagentsviewserver entry pointing atscripts/start-agentsview-mcp.sh.start-agentsview-mcp.shis a guard wrapper: it exits 0 (no server) ifAGENT_FLOW_NO_AGENTSVIEW=1is set or theagentsviewbinary is missing; otherwise itexecsagentsview mcp.scripts/detect-agentsview-context.shruns during orchestration init and emits anagentsview:state block:- When
agentsview: available: trueis present in the state file, the orchestrator injects a one-line preamble into everyTask(...)call for Riko, Senku, and Lawliet, telling them prior session history is searchable. See theagentsview-usageskill for query patterns.
The Five Tools¶
All granted tools are accessed via the prefix mcp__plugin_agent-flow_agentsview__*:
| Tool | Purpose |
|---|---|
search_sessions |
Find past sessions matching filters (project, agent, date, outcome) |
list_sessions |
Browse recent sessions without a specific search term |
get_session_overview |
Get metadata/signals for one known session |
get_messages |
Read an exact (paginated) window of messages from a session |
search_content |
Full-text/semantic search across message and tool content spanning all sessions |
Note: get_usage_summary (token usage/cost accounting) is intentionally not granted to any persona — it is out of scope for session-history recall.
See skills/agentsview-usage/SKILL.md (in the repository) for the full query guide, tool decision table, and token hygiene rules.
Opt-Out¶
Set AGENT_FLOW_NO_AGENTSVIEW=1 before starting Claude Code (or for a specific run) to disable the integration entirely:
This disables both:
- The detector (detect-agentsview-context.sh emits available: false with reason: opt-out via AGENT_FLOW_NO_AGENTSVIEW).
- The MCP server (start-agentsview-mcp.sh exits 0 without starting agentsview mcp).
Graceful Degradation¶
Every part of this integration is designed to degrade silently when agentsview is unavailable:
detect-agentsview-context.shalways exits 0, emittingagentsview: available: falsewhen the binary is missing, opted out, or the local archive is unreachable.start-agentsview-mcp.shalways exits 0 when the binary is missing or opted out — it never breaks Claude Code startup.- When
available: false, the orchestrator simply skips injecting the AgentsView preamble; Riko/Senku/Lawliet proceed without session-history search, with no errors surfaced to the user.
Related Documentation¶
- Installation — plugin setup
skills/agentsview-usage/SKILL.md(in repository) — agent query guide- Using Your Personal Knowledge Base — sibling integration for cross-project personal notes/decisions