Skip to content

repo_map — structural map of the codebase

repo_map generates a structural overview of the workspace: directory tree, top-level classes, and function signatures. Use it before broad refactors — it’s cheaper than read_file-ing every candidate.

ArgTypeRequiredDefaultDescription
pathstringno.Directory to map. Resolved against the env’s workdir.
max_depthintegerno(unlimited)Maximum directory depth to traverse.
{"path": "chimera/tools", "max_depth": 2}
from chimera.tools.repo_map import RepoMapTool
tool = RepoMapTool()
result = tool.execute({"path": "chimera/core"}, env=local_env)
print(result.output)
chimera/core/
├── agent.py
│ class Agent
│ def __init__(self, provider, tools, ...)
│ def run(self, task, env)
├── loop.py
│ class ReActLoop
│ def step(self)
│ def cancel(self)
├── tool.py
│ class BaseTool
│ def execute(self, args, env)
...
  • Multi-language support: Python, JavaScript / TypeScript, Go, and Rust are recognised. Unknown extensions fall back to the bare filename.
  • For pure import topology, prefer import_graph.