toolpath-claude
Derive Toolpath provenance documents from Claude conversation logs.
When Claude Code writes your code, the conversation — the reasoning, the tool calls, the abandoned approaches — is the provenance. This crate reads those conversations directly and maps them to Toolpath documents so every AI-assisted change has a traceable origin.
Overview
Reads Claude Code conversation data from ~/.claude/projects/ and provides:
- Conversation reading: Parse JSONL conversation files into typed structures
- Query: Filter and search conversation entries by role, tool use, text content
- Derivation: Map conversations to Toolpath Path documents
- Watching: Monitor conversation files for live updates (feature-gated)
Derivation
Convert Claude conversations into Toolpath documents:
use ;
let manager = new;
let convo = manager.read_conversation?;
let config = default;
let path = derive_path;
# Ok::
Mapping
| Claude concept | Toolpath concept |
|---|---|
| Session (JSONL file) | Path |
| Project path | path.base.uri as file:///... |
| User message | Step with actor: "human:user" |
| Assistant message | Step with actor: "agent:{model}" |
| Tool use (Write/Edit) | change entry keyed by file path |
| Assistant text | meta.intent |
| Sidechain entries | Steps parented to branch point |
Reading conversations
use ClaudeConvo;
let manager = new;
// List projects
let projects = manager.list_projects?;
// Read a conversation
let convo = manager.read_conversation?;
println!;
// Most recent conversation
let latest = manager.most_recent_conversation?;
// Search
let matches = manager.find_conversations_with_text?;
# Ok::
Querying
use ;
let query = new;
let user_msgs = query.by_role;
let tool_uses = query.tool_uses_by_name;
let errors = query.errors;
let matches = query.contains_text;
Watching
With the watcher feature (enabled by default):
use ;
let config = new;
let mut watcher = new?;
let handle = watcher.start.await?;
// New entries arrive via the handle
while let Some = handle.recv.await
Feature flags
| Feature | Default | Description |
|---|---|---|
watcher |
yes | Filesystem watching via notify + tokio |
Part of Toolpath
This crate is part of the Toolpath workspace. See also:
toolpath-- core types and query APItoolpath-git-- derive from git historytoolpath-dot-- Graphviz DOT renderingtoolpath-cli-- unified CLI (cargo install toolpath-cli)- RFC -- full format specification