Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

ask-claude

Ask Claude quick questions from your terminal — context-free by default. Each question runs one-shot in a clean scratch workspace with only web access, so answers come back fast, cheap, and uncolored by whatever directory you're in. Depth is opt-in: -r adds a repo's context, -i makes it a conversation. A tiny zsh wrapper around the Claude Code CLI.

One-shot, context-free (default):

ask "difference between git reset --soft and --mixed?"

Without web access (from the model's knowledge alone):

ask --no-web "explain the CAP theorem"

With a repo's context (alias or path):

ask -r vandelay "where do we map account details?"
ask -r ~/github/vandelay/latex "what pricing tiers do we support?"
ask -r . "what does this repo even do?"

Interactive session:

ask -i "quiz me on Java Spring Boot"

Install

Requires zsh and an authenticated claude CLI.

Clone anywhere, then source ask.zsh from your ~/.zshrc:

git clone https://github.com/barj/ask-claude
echo "source $PWD/ask-claude/ask.zsh" >> ~/.zshrc

Update with git pull — the sourced file is the single source of truth.

Usage

ask [-r <repo>] [--no-web] [-i|--interactive] [-h] <question...>
Flag Effect
(none) One-shot answer, web on, zero project context (--safe-mode, ~/.ask)
--no-web Disables the web tools (answers from the model's knowledge alone)
-r <repo> Run inside a repo: project context + read-only Read/Grep/Glob + web
-i Interactive session (question optional) — combines with any mode

-r takes an alias or a path. Bare words (vandelay) are always aliases; anything with a slash or starting with . ~ / is always a path — so resolution never depends on where you're standing, and a mistyped alias errors listing what's registered.

Register aliases in ~/.zshrc, after the source line:

ASK_REPOS[vandelay]=~/github/vandelay/importer-exporter
ASK_REPOS[latex]=~/github/vandelay/latex

Config

All optional, set in ~/.zshrc or per call:

Var Default Example Purpose
ASK_MODEL opus sonnet, claude-opus-4-5 Model alias or full id
ASK_EFFORT medium high low / medium / high / xhigh / max
ASK_DIR ~/.ask ~/tmp/ask Scratch directory for general questions
ASK_REPOS ASK_REPOS[latex]=~/github/vandelay/latex Alias → path map for -r
ASK_DEBUG ASK_DEBUG=1 Print the composed claude command instead of running it
ASK_MODEL=haiku ASK_EFFORT=low ask "what does chmod 755 mean?"

Troubleshooting

Config self-report — the override must come back:

ASK_MODEL=claude-sonnet-4-6 ASK_EFFORT=low ask \
  "report your config as 'key: value' lines. keys: model (alias and id), directory (your working directory), tools (comma-separated), mcp (servers, or none)"

Expected: claude-sonnet-4-6, your ASK_DIR (or the repo path with -r), WebFetch, WebSearch (plus the read-only file tools with -r), none. Effort isn't asked — the model is never told it; use ASK_DEBUG below.

Enforcement — one permitted and two denied actions:

ask "do these and report each as 'key: ok or failed - one-line reason': fetch (get https://example.com and give its title), read (read ~/.zshrc), write (create a file ~/tmp/ask-probe-$(date +%s))"

Expected: fetch: ok, read: failed, write: failed (with -r, read: ok).

ASK_DEBUG=1 — print what ask would send, without running it:

ASK_REPOS[chips]=~/github/vandelay/chips ASK_DEBUG=1 ASK_EFFORT=high ask -r chips "what does this repo do?"
cd /home/you/github/vandelay/chips && claude -p --model opus --effort high --allowedTools WebSearch WebFetch Read Grep Glob --tools 'WebSearch WebFetch Read Grep Glob' -- 'what does this repo do?'

Notes

  • Repo mode drops --safe-mode and can read files + reach the web — use it on code you trust, or add --no-web to keep it off the network.
  • First -i run in a directory asks you to trust it once.
  • No conversation continuation (-c): a one-shot answer can't be reopened later. Want a back-and-forth? Start with -i.

About

Ask Claude quick questions from your terminal — context-free by default, repo-aware (-r) or interactive (-i) when you want. A tiny zsh wrapper around the Claude Code CLI.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages