repo: Bash reads dropped where the shell could not have moved (conservative limits of #369)

Open
#374 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@antonwolfy is already working on this.

Since Nov 4, 2026.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
bash, python
Domain
devtools

Research direction

The payload names no files, so start from the Bash command splitter that #369 added to the Python tracing code and find where it ends a part at an inner ; inside $( ) or backticks. Reproduce with cd $(printf sub; true) | cat; cat AGENTS.md and check that the trailing relative read is currently dropped. Done means that case and the & and source .venv/bin/activate forms record the read when bash would leave the foreground directory alone, and reads the agent may not have seen stay dropped.

Written by the indexing model from the issue text.

Description

#369 derives read events from Claude Code Bash commands and tracks whether a command may have moved the Bash shell (cd, pushd, popd, eval, source, .). Once the shell may have moved, later relative reads are not recorded, in that call and in the calls after it.

Where the parser cannot tell whether a directory builtin ran in the foreground shell, #369 assumes it did. That only drops reads, so guidance_read, reach's fetched, skill use and uptake can undercount, but they never count a file the agent was not shown. This issue collects the forms that are dropped this way although bash would leave the foreground directory alone. A fix for each is welcome, as long as it does not keep a read the agent may not have seen.

  • A $( ) or backtick substitution holding a separator, inside a piped or backgrounded directory command: cd $(printf sub; true) | cat; cat AGENTS.md, cd $(printf sub; true) & cat AGENTS.md, and the backtick forms. The splitter ends the part at the inner ; before the outer | or & is seen (https://github.com/intel/dokimi/pull/369#discussion_r4447632218).
  • A source .venv/bin/activate in the foreground: it counts as moving the shell, so later relative Bash reads in the trace are not recorded.
  • A cd inside a shell function the agent defines and then calls is not followed (listed in the contract's limits).

A more complete fix would read the command with a real shell parser in place of the hand-written splitter. That is a dependency decision for a separate PR.

Dominant language
Python
Stars
11
Forks
9
Avg merge
1d 11h
Merged PRs (30d)
318

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from intel/dokimi

All issues in intel/dokimi

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.