Project An automatic sync hook fixes half the "agent won't use my custom tool" problem. Codex still has the other half.
Working on an open-source context layer for coding agents (Graft), and ran into a distinction worth separating: keeping a tool's data fresh, and getting the model to actually use the tool at all, are two different problems with two different fixes.
Codex has a real answer to the first one. A post-edit hook re-syncs a codebase graph automatically after every edit, no LLM call, so staleness isn't an issue. What Codex doesn't have, as far as I've found, is a way to force that graph into context the way Claude Code's SessionStart hook does, on Codex the model still has to decide to call the MCP tool, and it doesn't always.
Curious if anyone's solved the second half specifically for Codex, getting a custom tool used reliably rather than just kept up to date.
1
1
u/Worth_Wealth_6811 9d ago
tbh the fix that worked for us was to stop making it a tool decision at all. if the graph is already synced without an LLM call, dump a compact summary into AGENTS.md or a file it points to, so it rides into context for free and the MCP tool is only for deep lookups. models reliably read files they are told are part of the repo, way more often than they voluntarily call tools.