{"version":"2.1.317","anchor":"bash-head-output-detection-helper","canonical_anchor":"bash-head-output-detection-helper","heading":"Claude Code can tell when a head command cut a file's output short","tier":"notice","area":"Bash","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317\/e\/bash-head-output-detection-helper","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317","markdown":"### Claude Code can tell when a `head` command cut a file's output short\n\nFor a plain head command on a file, Claude Code now compares the lines returned with the number asked for to tell if the output was cut off\n\n**Unclear.** It is not clear what Claude Code does differently once it knows the output was cut short.\n\n**What**\n\nClaude Code runs shell commands through its Bash tool, which is how it types commands into a terminal for you. Its handling of the `head` command has changed. `head` shows only the first lines of a file. For a plain command of the form `head -n N file`, Claude Code now counts the lines that came back and compares that count with N, the number of lines asked for. This tells it whether `head` stopped early and the file has more lines than were shown.\n\nIt does not apply this check when the output begins with `head: `, which is how `head` starts its error messages.\n\n**Why**\n\nThe check can be used to decide whether a command's result is only part of the file.\n\n- Area: Bash\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}