# AI use cases for Habitat CLI (wusterbuilds/habitat-cli)

Repo: [wusterbuilds/habitat-cli](https://github.com/wusterbuilds/habitat-cli) | Use cases: 5 | Page: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/

HT is a local observability CLI that captures Codex and Claude Code sessions into a private SQLite ledger you can search, with optional upload to a Habitat-compatible team workspace.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Find past coding agent sessions by keyword: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/search-past-agent-sessions-locally/
- Review every step of one agent session: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/review-what-an-agent-did-in-a-session/
- Find out why agent sessions stopped capturing: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/diagnose-broken-agent-session-capture/
- Share selected project sessions with a team: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/share-project-sessions-with-a-team-workspace/
- Script HT setup for managed machines: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/automate-workspace-setup-from-a-script/

## How to find past coding agent sessions by keyword with Habitat CLI

Repo: [wusterbuilds/habitat-cli](https://github.com/wusterbuilds/habitat-cli) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Search your captured Codex and Claude Code sessions on your own machine.

**Who it is for:** A developer who remembers an agent solved a problem last month but cannot find the session.

**The problem:** Past agent conversations are scattered across provider logs and hard to search by topic.

**The outcome:** A list of matching local sessions you can open and review, with no account or network needed.

### Steps

1. Run `curl -fsSL https://app.use-habitat.com/install.sh | sh` to install the latest checksum-verified release.
2. Run `ht install` to install hooks and the local background service.
3. Run `ht sync` to reconcile provider history.
4. Run `ht sessions search "migration"` and replace the query with your own keyword.
5. Run `ht sessions show SESSION_ID` with an ID from the results to inspect one session.

### Prompt to paste into your agent

```text
In the habitat-cli repo, install HT locally, run `ht sync`, then run `ht sessions search "<keyword>"`. Expected output: a list of local sessions that match the keyword. Verify that each result includes a session ID you can pass to `ht sessions show`.
```

### Caveat

HT is under active development and CLI changes are expected before 1.0, so re-check `ht help` after upgrades.

Risk, credentials: Captured sessions can contain pasted secrets or project content, so review the privacy model before capturing sensitive projects.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/search-past-agent-sessions-locally/

## How to review every step of one agent session with Habitat CLI

Repo: [wusterbuilds/habitat-cli](https://github.com/wusterbuilds/habitat-cli) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Open a captured Codex or Claude Code session and check its recorded activity.

**Who it is for:** A reviewer who needs to confirm what an agent changed or asked during a specific task.

**The problem:** Without a record, checking an agent's work means rebuilding the history from memory or raw logs.

**The outcome:** A readable view of one session plus a status check that shows capture is healthy.

### Steps

1. Run `ht sessions list` to find the session you want.
2. Run `ht sessions show SESSION_ID` with the ID from the list.
3. Run `ht status` to confirm capture and delivery health.

### Prompt to paste into your agent

```text
In the habitat-cli repo, run `ht sessions list`, then `ht sessions show <SESSION_ID>` for the session the user names. Expected output: the recorded events for that session. Verify that the output matches the session ID you requested.
```

### Caveat

HT never modifies Codex or Claude Code transcripts, but the captured copy in the local ledger may still contain sensitive text.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/review-what-an-agent-did-in-a-session/

## How to find out why agent sessions stopped capturing with Habitat CLI

Repo: [wusterbuilds/habitat-cli](https://github.com/wusterbuilds/habitat-cli) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Use preflight, status, and doctor to diagnose and repair local capture.

**Who it is for:** An engineer who notices recent agent sessions are missing from HT.

**The problem:** Capture can stop silently, leaving gaps in the session record.

**The outcome:** A clear health picture and repair guidance for the capture problem.

### Steps

1. Run `ht preflight --json` for a read-only environment inspection.
2. Run `ht status` for concise capture and delivery health.
3. Run `ht doctor` for detailed diagnostics and repair guidance.
4. Run `ht sync` to reconcile provider history after fixing the issue.

### Prompt to paste into your agent

```text
In the habitat-cli repo, run `ht preflight --json` and `ht doctor`, then summarize the findings for <PROJECT_PATH>. Expected output: a short list of problems and suggested repairs. Verify that you have not changed hooks or the service without asking the user first.
```

### Caveat

The README says a real Codex hook must be reviewed and trusted by the user, so an agent cannot complete that step for them.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/diagnose-broken-agent-session-capture/

## How to share selected project sessions with a team with Habitat CLI

Repo: [wusterbuilds/habitat-cli](https://github.com/wusterbuilds/habitat-cli) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Connect HT to a Habitat workspace and upload chosen project sessions.

**Who it is for:** A team lead who wants shared history of agent work on one project.

**The problem:** Agent sessions stay on individual laptops, so teammates cannot see what was tried.

**The outcome:** Selected project sessions are delivered to one workspace with a backfill window you choose.

### Steps

1. Run `ht install` if HT is not yet installed.
2. Run `ht setup` and log in when prompted.
3. Choose the project and a 30-day, 90-day, or all-time backfill in the guided setup.
4. Approve the Codex hook trust step yourself, since setup does not bypass it.
5. Run `ht status` to confirm delivery health.

### Prompt to paste into your agent

```text
In the habitat-cli repo, guide the user through `ht setup` for the project at <PROJECT_PATH>. Do not launch Codex or Claude Code, and ask before uploading content. Expected output: a confirmed workspace and project routing. Verify with `ht status` that delivery is healthy.
```

### Caveat

The README describes Habitat Cloud sharing as optional and separate from local use, and it does not list pricing or plan details.

Risk, credentials: Setup logs into a workspace and stores credentials, so use an account you control and review what will be uploaded.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/share-project-sessions-with-a-team-workspace/

## How to script HT setup for managed machines with Habitat CLI

Repo: [wusterbuilds/habitat-cli](https://github.com/wusterbuilds/habitat-cli) | Difficulty: Advanced | Time: 30 minutes | Basis: From the README

Run non-interactive setup with an API key piped in and JSON output.

**Who it is for:** A platform or IT operator who provisions developer machines with a managed installer.

**The problem:** Interactive setup does not scale across many machines.

**The outcome:** A scripted setup that routes a project and backfills history without terminal prompts.

### Steps

1. Make sure your managed installer has the workspace API key in an environment variable such as HABITAT_API_KEY.
2. Run `ht preflight --json` to inspect the environment read-only before changing anything.
3. Run `printf '%s' "$HABITAT_API_KEY" | ht setup --api-key-stdin --project /path/to/project --backfill 30d --non-interactive --json`. (inferred, check the README)
4. Check the JSON output for the workspace and project routing result.

### Prompt to paste into your agent

```text
In the habitat-cli repo, run `ht preflight --json`, then ask the operator to approve before running `ht setup` with `--api-key-stdin`, `--project <PROJECT_PATH>`, `--backfill 30d`, `--non-interactive`, and `--json`. Expected output: JSON describing the setup result. Verify that the key was passed on stdin and not written to the command line.
```

### Caveat

The README says a real Codex hook must still be reviewed and trusted by the user, so scripted setup does not remove that manual step.

Risk, credentials: The workspace API key grants upload access, so store it in a secrets manager and never paste it into logs or prompts.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/automate-workspace-setup-from-a-script/
