The Claude integration module provides two factory functions targeting different Anthropic surfaces.Documentation Index
Fetch the complete documentation index at: https://reasonblocks.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
make_claude_tools targets the low-level anthropic Python package and returns a (tool_specs, dispatch) tuple you wire into a manual tool_use loop. make_claude_agent_sdk_tools targets the higher-level claude-agent-sdk package and returns @tool-decorated async functions you pass directly to query(...). Both factories expose the same CodebaseMemory and ImportGraph capabilities.
- Anthropic Messages API
- Claude Agent SDK
make_claude_tools
dispatch callable.Parameters
The
CodebaseMemory instance the tools read from and write to. Required — unlike the LangChain factory, memory cannot be None.Optional
ImportGraph. When provided and enable_impact=True, an impact_analysis spec is added to the tool list.Maximum number of findings returned by a single
recall_findings call.Minimum similarity score (0–1) for a finding to be included in recall results.
Include the
store_finding tool spec. Set to False for read-only scenarios.Include the
impact_analysis tool spec when a graph is provided.Returns
A list of
{"name", "description", "input_schema"} dicts in the shape client.messages.create(tools=...) expects.A callable
dispatch(tool_name, tool_input) -> str that executes the named tool and returns its string result. Raises KeyError for unknown tool names so you can surface the model’s error cleanly. Exceptions inside the tool handler are caught and returned as an error string rather than propagated.Manual tool-use loop
run_messages_agent_loop
run_messages_agent_loop runs the full Anthropic Messages tool-use loop for you, handling every tool_use / tool_result turn automatically. Use it when you want batteries-included behavior without writing the loop yourself.Parameters
A synchronous
anthropic.Anthropic client instance. The helper uses client.messages.create internally.The Anthropic model ID to use, e.g.
"claude-opus-4-5" or "claude-haiku-3-5".Initial message list in Anthropic format. Typically
[{"role": "user", "content": "..."}]. The helper appends assistant and tool-result turns in place; pass a copy if you want to preserve the original list.The tool spec list returned by
make_claude_tools.The dispatch callable returned by
make_claude_tools.Optional system prompt. Passed as the
system parameter to client.messages.create when non-empty.Maximum number of
client.messages.create calls before the loop exits with stop_reason="max_steps". Prevents runaway loops from consuming your API quota.max_tokens value forwarded to every client.messages.create call.Return value
The concatenated text from the last assistant turn that did not contain a
tool_use block. Empty string if the run ended via max_steps with no text output.The full message history including all assistant turns and tool-result turns appended during the loop. Useful for continuing the conversation or for debugging.
The stop reason from the final API call, or
"max_steps" if the loop was terminated by the step limit. Common values: "end_turn", "max_steps", "stop_sequence".Every tool call made during the loop as
(tool_name, tool_input, result) tuples, in execution order. Useful for auditing what the agent did.Example
Tools available in both factories
Bothmake_claude_tools and make_claude_agent_sdk_tools expose the same three tools:
| Tool | Always included? | Description |
|---|---|---|
recall_findings(query) | Yes (when memory set) | Search CodebaseMemory for findings matching a natural-language query |
store_finding(content, file_path, finding_type) | When enable_store=True | Persist a new finding to CodebaseMemory |
impact_analysis(file_path) | When graph is set and enable_impact=True | Return dependents and dependencies for a repo file |