A new tool called wy wants to answer a question that comes up constantly in AI-assisted development: why did the agent write the code that way. The project connects Git diffs to saved Codex or Claude Code conversations so developers can inspect the reasoning behind specific changes. It runs locally, works offline for core features, and treats the agent's explanation as evidence rather than truth.
What problem wy solves
When an AI coding agent adds a caching layer or changes a database schema, the diff shows what changed but not why. The conversation that produced the change lives in a separate tool. Most developers either accept the change blindly or spend time scrolling through chat history to find the relevant exchange. wy bridges that gap by importing session logs from Codex or Claude Code, matching them to the repository's working directory, and presenting the diff alongside the agent's stated rationale.
How the review workflow works
Installation requires Rust 1.88 or newer, Git, and a C toolchain. The binary installs with cargo install --git https://github.com/grandimam/wy --locked wy-code. Running wy inside a repository loads uncommitted changes and any agent sessions that recorded the same working directory. No advance setup or recorder is needed.
The terminal interface lists changed files. Selecting one with arrow keys or a click shows the diff on one side and available agent notes on the other. Pressing e triggers an enrichment pass that fetches additional context while you continue browsing. Pressing s opens a source selector so you can jump to the exact conversation excerpt or code block cited in the explanation. Tab switches panes, Esc goes back, i asks a follow-up question, and q quits.
Codex is the default answering agent. Typing /agent claude switches to Claude Code. Enrichment requires the chosen CLI to be installed and signed in, but the diff, notes, and saved evidence work without network access.
Evidence tiers and what they mean
wy classifies every explanatory claim into one of three tiers. Recorded means a relevant, explicit justification was found in the agent's observable transcript. Inferred means repository evidence supports a hypothesis but assumptions remain visible. Unexplained means the choice is visible in the code but no motivation could be established from available evidence.
A recorded statement can still be wrong. A linked session does not prove authorship. When wy asks the agent for a fresh assessment, that new answer stays separate from the original rationale and never upgrades it to Recorded.
The project illustrates the system with a configuration cache example. The recorded reason: "I cached load_config to avoid reading the same configuration file on every request." The implementation shows load_config now uses @lru_cache(maxsize=128) to reuse results for identical arguments. The follow-up check asks: if the configuration file changes while the process runs, should the next call see the new contents? Opening citation [1] reveals the saved assistant message and surrounding conversation. Opening [2] shows the supporting code. The answer is a fresh assessment of that evidence, saved with its sources, and flagged if the code changes later.
Three operating modes
- Offline review (
wy review,wy explain,wy ask): local detection, evidence retrieval, and cached investigation. No model or network request. Requires only a Git repository. - Agent explanation (
wy reason,wy why, in-app/reason,/why, or/ask): the installed Codex or Claude CLI receives bounded, redacted evidence and returns a fresh assessment. Requires the selected CLI, sign-in, and available account usage. - Optional model enrichment (
--model): a configured Ollama-compatible endpoint enriches detected decisions or answers follow-ups. Requires an explicitly configured model and endpoint.
Data handling and privacy
wy does not modify application source or execute the code it reviews. Reviews, source snapshots, and normalized conversation excerpts stay in local .wy/ artifacts unless you explicitly request model processing. Private reasoning is excluded. Redaction is best-effort; local artifacts are not encrypted. The project recommends adding .wy/ to your repository's .gitignore before sharing.
Current limitations
The software is experimental at version 0.2.0. The interface, commands, and saved artifact formats are evolving. Explanations should be treated as starting points for investigation, with important claims verified against the cited code and conversation.
Offline detection is deliberately selective and capped at twelve decisions per review. It covers patterns for caching, dependency versions, operational limits, database schemas, and retries. It does not discover every architectural decision. Rust, JavaScript, TypeScript, and JSON use tree-sitter syntax navigation; other text files use line anchors. Retrieval is lexical, and citations need human judgment.
From the checkout, cargo check --locked and cargo test --locked run automated checks that verify regressions, not real-world accuracy. The project is licensed under MIT.