# Head tail

> Head tail is an open-source agent skill for developer tools. Lets an agent sample huge logs and transcripts from both ends and report the gap. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mtarcure/claude-vibe-squad/tree/main/.agents/skills/head-tail
- **Repository:** https://github.com/mtarcure/claude-vibe-squad
- **GitHub stars:** 227
- **License:** MIT
- **Skill name:** head-tail
- **Collection:** https://github.com/mtarcure/claude-vibe-squad
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

Head-tail is a narrow reading technique for files that are too large to read whole but whose middle is repetitive, such as build output, test-runner transcripts, generated artifacts and data dumps. The agent sizes the file first, takes a bounded slice from the beginning and the end, labels each slice so they cannot be mistaken for contiguous text, and truncates pathologically long lines so one blob cannot crowd out the rest of the sample.

The skill is strict about what it does not cover. It warns against using the method on source files, briefs, packets or configuration, where the whole-file rule applies instead. When the ends do not answer a question, it tells the agent to search the middle for the relevant error or test name and read matches with context rather than paging through windows. It also requires that any unread range be stated explicitly, and that a build's exit status be captured directly, since a piped pipeline reports the status of its last stage.

The skill is a single SKILL.md file with no bundled scripts. It references a surrounding task packet's efficiency section for batching and whole-file rules, so it is designed to work inside that workflow rather than standalone.

## When your agent uses it

> Use when a log, build transcript, generated artifact, or dump is too large to read whole and its middle is repetitive—sample bounded first/last slices, report the unread gap, and capture producer status separately. Not for source, briefs, packets, or configuration; their whole-file rule comes from the injected task contract.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/head-tail)
- [License: MIT](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/head-tail)

## Features

- **Size-first sampling:** Checks byte size and line count before deciding whether a file needs a partial read at all.
- **Bounded head and tail slices:** Reads a fixed number of lines from each end, with more tail lines when chasing failures.
- **Explicit gap reporting:** States the sampled line ranges and the unread middle so the sample is never mistaken for the whole file.
- **Long-line truncation:** Caps very long lines such as base64 blobs or minified bundles and marks them as truncated.
- **Middle search over paging:** Greps for errors or test names in the unread middle instead of stepping through windows.
- **Separate exit status capture:** Records the build's own exit code before any piping, avoiding the masked status of the last pipeline stage.

## Good for

- Find the error in a 15,000-line CI build log without reading the whole thing
- Check how a test run was invoked from the top of a long transcript
- Scan a large generated data dump for a failure without loading it entirely
- Confirm whether a build actually succeeded when its output is piped through tail

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/head-tail` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/head-tail &&
cp -R "$tmp/.agents/skills/head-tail" ~/.claude/skills/head-tail &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/head-tail` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/head-tail` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/head-tail &&
cp -R "$tmp/.agents/skills/head-tail" ~/.agents/skills/head-tail &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/head-tail` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/head-tail` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/head-tail &&
cp -R "$tmp/.agents/skills/head-tail" ~/.cursor/skills/head-tail &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/head-tail` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mtarcure/claude-vibe-squad.git --path .agents/skills/head-tail
```

Or copy the folder to `~/.gemini/skills/head-tail` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/head-tail`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/head-tail &&
cp -R "$tmp/.agents/skills/head-tail" ~/.copilot/skills/head-tail &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/head-tail` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git
```

Then copy `claude-vibe-squad/.agents/skills/head-tail` into your agent's skills folder as `head-tail`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When should the agent not use Head tail?

Not for source files, briefs, packets or configuration. The skill says those should follow the whole-file rule from the surrounding task contract, since a long dense file is not a sampling candidate.

### What is the deciding test for using Head tail?

Whether the file's middle is repetitive. A long test log qualifies, while a long source file does not.

### Why capture the exit status separately?

A piped command returns the status of its last stage, so piping a build into tail reports tail's status rather than the build's.

### Does Head tail bundle any scripts or tools?

No. The folder contains only the SKILL.md file, and no scripts are listed.

### How do I install Head tail in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/head-tail to use it in all your projects, or to .claude/skills/head-tail in one project.

### Does Head tail run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Head tail?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Head tail?

The closest alternatives to Head tail are Data throughput accelerator, Scope estimation, Diagnosing bugs, Differential review and Bmad run inspector.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Data throughput accelerator](https://ai-powered.com/skills/data-throughput-accelerator): Data throughput accelerator is an open-source agent skill for developer tools.
- [Scope estimation](https://ai-powered.com/skills/scope-estimation): Scope estimation is an open-source agent skill for developer tools.
- [Diagnosing bugs](https://ai-powered.com/skills/diagnosing-bugs): Diagnosing bugs is an open-source agent skill for developer tools.
- [Differential review](https://ai-powered.com/skills/differential-review-mtarcure): Differential review is an open-source agent skill for developer tools.
- [Bmad run inspector](https://ai-powered.com/skills/bmad-run-inspector): Bmad run inspector is an open-source agent skill for developer tools.
- [Benchmark checklist](https://ai-powered.com/skills/benchmark-checklist): Benchmark checklist is an open-source agent skill for developer tools.
- [Ask matt](https://ai-powered.com/skills/ask-matt): Ask matt is an open-source agent skill for developer tools.
- [Shiplog](https://ai-powered.com/skills/shiplog-devallibus): Shiplog is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/head-tail
