think-in-code

A set of command-line patterns for analysing many files or dependencies in one pass. A monorepo, for example, is one repository containing multiple projects or packages.

In plain words
What is it for?
Use it to audit file sizes, find exported symbols, inspect dependency versions, scan a codebase, or count lines across many files.
Why use it?
It produces compact totals and matches without loading every file into the agent’s conversation, which saves time and context.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fusengine/agents/think-in-code
Any agent
npx skills add fusengine/agents --skill think-in-code
Clone the repo
git clone --depth 1 https://github.com/fusengine/agents

Made for: Claude Code, Codex.

Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 972 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.00972
Opus 5 $0.00015 $0.00486
Sonnet 5 $0.00006 $0.00194
Haiku 4.5 $0.00003 $0.00097

Measured 2d ago against content hash 24dd7079ef3e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

think-in-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ai-pilot/skills/think-in-code/SKILL.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

The reduction is typically ~60x in tokens consumed versus reading each file individually and tallying manually.

Think-in-Code Skill

Principle

1 Bash script = N Read calls avoided.

When you'd read 10 files sequentially to extract a summary, you waste tokens loading full contents into context. Instead: 1 shell pipeline returns the compact aggregated result.

Heuristic: if your task is "for each file in set, compute/extract X, then aggregate" → write the script. Reserve Read for targeted inspection of a specific file you already know matters.

5 Runnable Patterns

1. File size audit (> 100 lines violations)

find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.py" -o -name "*.php" \) \
  -not -path "*/node_modules/*" -not -path "*/vendor/*" \
  | xargs wc -l 2>/dev/null \
  | awk '$1 > 100 && $2 != "total" {print $1, $2}' \
  | sort -rn | head -20

2. Multi-grep symbols (compact JSON)

rg --json -g '*.ts' -g '*.tsx' 'export (function|class|const) (\w+)' src/ \
  | jq -r 'select(.type=="match") | "\(.data.path.text):\(.data.line_number) \(.data.lines.text)"' \
  | head -50

3. Dependencies with versions

# Node
jq -r '.dependencies, .devDependencies | to_entries[] | "\(.key)@\(.value)"' package.json 2>/dev/null

# PHP
jq -r '.require, ."require-dev" | to_entries[] | "\(.key)@\(.value)"' composer.json 2>/dev/null

4. Error log scan

grep -rEn 'ERROR|FATAL|Exception|panic:|stack trace' \
  --include="*.log" logs/ 2>/dev/null \
  | tail -30

5. Lines of code by extension

find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.py" -o -name "*.php" \) \
  -not -path "*/node_modules/*" -not -path "*/vendor/*" -not -path "*/.git/*" \
  -exec wc -l {} + \
  | awk '{ext=$2; sub(/.*\./,"",ext); sum[ext]+=$1} END {for (e in sum) print sum[e], e}' \
  | sort -rn

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 97 lines · 31 tokens per session scan A 24dd7079ef3e

Subscribe to this mod's changes

think-in-code is a skill published in the GitHub repository fusengine/agents (25 stars, last pushed 29d ago), licensed MIT. It adds 31 tokens to every session and 972 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.