Your agent needs a thinking log (or it'll gaslight you about what it tried)
Your agent tells you it "tried everything" but you have no idea what it actually did. It says the API is down, but did it check the right endpoint? It claims the file doesn't exist, but did it look in the right directory?
This is the agent accountability problem. Your agent makes dozens of decisions and attempts behind the scenes, but when something goes wrong, you get a summary that might be completely wrong.
The solution is a thinking log — a persistent record of every decision, attempt, and discovery your agent makes. Not just the final result, but the actual work.
Here's the pattern that solves this:
You have access to a thinking log at ~/agent_thinking.md For every significant action or decision: 1. Log what you're about to try and why 2. Log the actual result (success/failure/partial) 3. Log what you learned that changes your approach Format: ## [timestamp] Task: [brief description] **Attempting:** [what you're doing] **Result:** [what happened] **Learning:** [what this tells you] **Next:** [what you'll try next] This log persists across conversations. Always check it first.
The magic happens when your agent actually uses this log. Instead of starting fresh every conversation, it reads its own thinking history. It sees what failed yesterday and doesn't repeat the same mistakes.
But here's the key insight: the log forces your agent to be honest about what it actually tried.
Without a thinking log, your agent will tell you "I checked the database connection" when it actually just assumed the connection was fine. With a thinking log, it has to write down exactly what it checked and what the response was.
Pro tip: Make the thinking log append-only. Your agent can read the whole history but can only add to the bottom. This prevents it from "editing" its past attempts to look smarter.
I've been running this pattern for three months with my coding agent. The difference is night and day. When a deployment fails, I can see exactly which commands it ran, what errors it got, and what it tried next. When it says "the tests are passing," I can verify it actually ran them.
The thinking log also catches a subtle but critical problem: agents that give up too early. Without accountability, your agent might try one approach, hit a minor obstacle, and immediately pivot to something completely different. With a thinking log, you can see this pattern and adjust.
Here's what a real entry looks like:
## 2024-12-19 14:23 Task: Deploy API changes to staging **Attempting:** Running `git push staging main` **Result:** Permission denied (publickey) **Learning:** SSH key not configured for staging remote **Next:** Check SSH config and add staging key ## 2024-12-19 14:25 Task: Deploy API changes to staging **Attempting:** Adding staging SSH key from 1Password **Result:** Key added successfully, git push worked **Learning:** Staging deploys need manual SSH setup **Next:** Document this in deployment runbook
Notice how the agent learns from the failure and documents it for next time. That's the behavior you want.
The thinking log works because it creates accountability without slowing your agent down. It's just a markdown file that grows over time, but it fundamentally changes how your agent approaches problems.
Start with the basic pattern above. Your agent will resist at first — it's easier to just "try things" without documentation. But once the log builds up, your agent becomes dramatically more effective because it stops repeating the same debugging loops.