Loading...
Loading...
Use this when you are exploring the codebase. It lets you ask the AI who wrote code questions about how things work and why they chose to build things the way they did. Think of it as asking the engineer who wrote the code for help understanding it.
npx skill4agent add git-ai-project/git-ai ask<system-reminder>The user selected the lines 2 to 4 from /path/to/file.rs:
_flush_logs(args: &[String]) {
flush::handle_flush_logs(args);
}/ask--linesSelect some code or mention a specific file/symbol, thenyour question./ask
max_turns: 4Task tool settings:
subagent_type: "general-purpose"
max_turns: 4BashReadblame --show-promptsearchgit-ai blame --show-promptsearch# Get blame + prompts for a line range (pipe to get prompt dump appended):
git-ai blame src/commands/blame.rs -L 23,54 --show-prompt | cat
# Interactive (TTY) mode shows prompt hashes inline:
# 7a4471d (cursor [abc123e] 2026-02-06 14:20:05 -0800 23) code_here
# Piped mode appends raw prompt messages after a --- separator:
# ---
# Prompt [abc123e]
# [{"type":"user","text":"Write a function..."},{"type":"assistant","text":"Here is..."}]git-ai search{question}{file_path}{start}-{end}You are answering a question about code by finding the original AI conversation
that produced it. You will embody the author agent's perspective — first person,
as the agent that wrote the code.
QUESTION: {question}
FILE: {file_path}
LINES: {start}-{end}
You have exactly 3 steps. Do them in order, then stop.
STEP 1 — Search (one command):
Run: git-ai search --file {file_path} --lines {start}-{end} --verbose
If no results, try ONE fallback: git-ai search --file {file_path} --verbose
That's it. Do not run more than 2 git-ai commands total.
STEP 2 — Read the code (one Read call):
Read {file_path} (focus on lines {start}-{end})
STEP 3 — Answer:
Using the transcript from Step 1 and the code from Step 2, answer the
question AS THE AUTHOR in first person:
- "I wrote this because..."
- "The problem I was solving was..."
- "I chose X over Y because..."
Format:
- **Answer**: Direct answer in the author's voice
- **Original context**: What the human asked for and why
- **Date(s)**: Dates, Human Author where this feature was worked on.
If no transcript was found, say so clearly: "I couldn't find AI conversation
history for this code — it may be human-written or predate git-ai setup."
In that case, analyze the code objectively (not first person).
HARD CONSTRAINTS:
- Do NOT use Glob, Grep, or Task tools. You only have Bash and Read.
- Do NOT run more than 2 git-ai commands.
- Do NOT read .claude/, .cursor/, .agents/, or any agent log directories.
- Do NOT search JSONL transcripts or session logs directly.
- All conversation data comes from `git-ai search` only.--linesLINES:/ask why is this like that/ask why does this function use recursion instead of iteration?/ask what problem was being solved on lines 100-150 of src/main.rs?/ask why was this approach chosen over using a HashMap?