# claude logs Command

> It prints what a background job did just now.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude logs, Background session output

## Think of it like

It is like a peek through the window at a friend who is at work.

## Definition

claude logs prints the recent output of a background session, by its ID or its name. You read what it has been doing without opening the chat. It is a quick check from the shell, or from a script that watches several sessions.

## Example

Emma has five sessions running. Before she picks which one to open, she runs claude logs on each to see which are stuck.

## Example code

```bash
claude logs 7c5dcf5d
```

Show this session's recent output.

## Why it matters

Looking costs nothing. You only open a session when it needs you.

## Common mistake

Expecting the whole history. It shows recent output. The full chat is in the session itself.

## Three principles

- **Recent output.** Not the full chat.
- **No attach.** Just a look.
- **By ID or name.** From any shell.

## Related terms

- [claude attach Command](https://learn.benibix.com/term/ai/claude-attach-command)
- [Background Session](https://learn.benibix.com/term/ai/background-session)
- [Session Transcript](https://learn.benibix.com/term/ai/session-transcript)

## Taught in

- [Background Session Commands](https://learn.benibix.com/learn/ai-claude-code-commands/background-session-commands): Claude Code Commands, 7/17

![A supervisor process runs the background sessions. claude attach, logs, respawn and rm act on one session. claude daemon acts on the supervisor.](https://learn.benibix.com/diagrams/cli-daemon.svg)

---

Source: https://learn.benibix.com/term/ai/claude-logs-command
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
